Last active
May 18, 2018 13:14
-
-
Save w1th0utnam3/3b42a5b75a5b05bce8145303fb698770 to your computer and use it in GitHub Desktop.
DolfinX and Loopy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dockerfile to build the FEniCS-X development libraries | |
# with support for Loopy and Intel OpenCL drivers | |
# | |
# Authors: | |
# Jack S. Hale <[email protected]> | |
# Lizao Li <[email protected]> | |
# Garth N. Wells <[email protected]> | |
# Jan Blechta <[email protected]> | |
# Fabian Löschner <[email protected]> | |
FROM fenicsproject/dolfinx:latest | |
LABEL maintainer="fenics-project <[email protected]>" | |
WORKDIR /tmp | |
# Install OpenCL loader and packages required to install Intel OpenCL driver | |
RUN apt-get -qq update && \ | |
apt-get -y --with-new-pkgs -o Dpkg::Options::="--force-confold" upgrade && \ | |
apt-get -y install \ | |
ocl-icd-opencl-dev \ | |
rpm2cpio \ | |
cpio && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
# Install Intel OpenCL driver | |
ARG INTELCL_VERSION_SHORT=16.1.2 | |
ARG INTELCL_VERSION_FULL=16.1.2_x64_rh_6.4.0.37 | |
RUN cd /tmp && \ | |
wget http://registrationcenter-download.intel.com/akdlm/irc_nas/12556/opencl_runtime_${INTELCL_VERSION_FULL}.tgz && \ | |
tar -xvf opencl_runtime_${INTELCL_VERSION_FULL}.tgz && \ | |
cd ./opencl_runtime_* && \ | |
TGT_DIR="/opt/intel-opencl-icd-${INTELCL_VERSION_SHORT}/lib" && \ | |
mkdir -p "$TGT_DIR" && \ | |
rpm2cpio rpm/opencl-*-intel-cpu-*.x86_64.rpm | cpio -idmv && \ | |
cp ./opt/intel/opencl-*/lib64/* "$TGT_DIR" && \ | |
mkdir -p /etc/OpenCL/vendors && \ | |
echo "$TGT_DIR/libintelocl.so" > /etc/OpenCL/vendors/intel.icd && \ | |
cd /tmp && \ | |
rm -rf /tmp/* | |
# Select the "Intel CPU device" added by the Intel driver as default PyOpenCL device | |
ENV PYOPENCL_CTX='0' | |
# Install PyOpenCL | |
RUN pip3 install --no-cache-dir pyopencl | |
# Install Loopy | |
RUN pip3 install --no-cache-dir git+https://github.com/inducer/loopy.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment