-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
80 lines (71 loc) · 2.95 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM nvidia/cuda:11.4.2-devel-ubuntu20.04
MAINTAINER [email protected]
ENV DEBIAN_FRONTEND=nonintercative
RUN apt-get update && apt-get install -y software-properties-common && \
apt-get install -y --no-install-recommends \
build-essential \
clinfo \
cmake \
git \
libboost-all-dev \
libfftw3-dev \
libfontconfig1-dev \
libfreeimage-dev \
liblapack-dev \
liblapacke-dev \
libopenblas-dev \
ocl-icd-opencl-dev \
opencl-headers \
wget \
xorg-dev && \
rm -rf /var/lib/apt/lists/*
# Setting up symlinks for libcuda and OpenCL ICD
RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/lib/libcuda.so.1 && \
ln -s /usr/lib/libcuda.so.1 /usr/lib/libcuda.so && \
mkdir -p /etc/OpenCL/vendors && \
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd && \
echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf
ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
WORKDIR /root
# Build GLFW from source
RUN git clone --depth 1 --branch 3.3.4 https://github.com/glfw/glfw.git && \
cd glfw && \
mkdir build && \
cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr .. && \
make -j4 && \
make install
RUN cd /tmp && \
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \
echo "deb https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list && \
add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" && \
apt update -y && apt install -y intel-basekit
SHELL ["/bin/bash", "-c"]
# AF_DISABLE_GRAPHICS - Environment variable to disable graphics at
# runtime due to lack of graphics support by docker - visit
# http://arrayfire.org/docs/configuring_environment.htm#af_disable_graphics
# for more information
ENV AF_PATH=/opt/arrayfire AF_DISABLE_GRAPHICS=1
ARG COMPILE_GRAPHICS=OFF
RUN source /opt/intel/oneapi/setvars.sh && \
git clone --depth 1 --recursive https://github.com/arrayfire/arrayfire.git -b master && \
cd arrayfire && mkdir build && cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/arrayfire-3 \
-DCMAKE_BUILD_TYPE=Release \
-DAF_BUILD_CPU=ON \
-DAF_BUILD_CUDA=ON \
-DAF_BUILD_DOCS=OFF \
-DAF_BUILD_EXAMPLES=ON \
-DAF_BUILD_OPENCL=ON \
-DAF_BUILD_UNIFIED=ON \
-DAF_WITH_FREEIMAGE_STATIC=OFF && \
# -DCOMPUTES_DETECTED_LIST="30;35;37;50;52;60" \
make -j8 && make install && \
mkdir -p ${AF_PATH} && ln -s /opt/arrayfire-3/* ${AF_PATH}/ && \
echo "${AF_PATH}/lib" >> /etc/ld.so.conf.d/arrayfire.conf && \
echo "/usr/local/cuda/nvvm/lib64" >> /etc/ld.so.conf.d/arrayfire.conf && \
ldconfig
WORKDIR /root/arrayfire