forked from flashlight/flashlight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-CUDA-Base
65 lines (63 loc) · 2.85 KB
/
Dockerfile-CUDA-Base
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
# ==================================================================
# module list
# ------------------------------------------------------------------
# Ubuntu 18.04
# CUDA 10.0
# CuDNN 7-dev
# cmake 3.10 (git)
# arrayfire 3.7.1 (git, CUDA backend)
# OpenMPI latest (apt)
# ==================================================================
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
rm -rf /var/lib/apt/lists/* \
/etc/apt/sources.list.d/cuda.list \
/etc/apt/sources.list.d/nvidia-ml.list && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
build-essential \
ca-certificates \
cmake \
wget \
git \
vim \
emacs \
nano \
htop \
g++ \
# ssh for OpenMPI
openssh-server openssh-client \
# OpenMPI
libopenmpi-dev libomp-dev openmpi-bin \
# nccl: for flashlight
libnccl2 libnccl-dev \
libglfw3-dev && \
# ==================================================================
# cmake 3.10 (for MKLDNN)
# ------------------------------------------------------------------
apt-get purge -y cmake && \
# for cmake
DEBIAN_FRONTEND=noninteractive $APT_INSTALL zlib1g-dev libcurl4-openssl-dev && \
cd /tmp && wget https://cmake.org/files/v3.10/cmake-3.10.3.tar.gz && \
tar -xzvf cmake-3.10.3.tar.gz && cd cmake-3.10.3 && \
./bootstrap --system-curl && \
make -j$(nproc) && make install && cmake --version && \
# ==================================================================
# arrayfire https://github.com/arrayfire/arrayfire/wiki/
# ------------------------------------------------------------------
cd /tmp && git clone --recursive https://github.com/arrayfire/arrayfire.git && \
wget https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz && tar xf boost_1_70_0.tar.gz && \
cd arrayfire && git checkout v3.7.1 && git submodule update --init --recursive && \
mkdir build && cd build && \
CXXFLAGS=-DOS_LNX cmake .. -DCMAKE_BUILD_TYPE=Release -DAF_BUILD_CPU=OFF -DAF_BUILD_OPENCL=OFF -DAF_BUILD_EXAMPLES=OFF -DBOOST_INCLUDEDIR=/tmp/boost_1_70_0 && \
make -j$(nproc) && make install && \
# ==================================================================
# config & cleanup
# ------------------------------------------------------------------
ldconfig && \
apt-get clean && \
apt-get -y autoremove && \
rm -rf /var/lib/apt/lists/* /tmp/* ~/* && \
# If the driver is not found (during docker build) the cuda driver api need to be linked against the
# libcuda.so stub located in the lib[64]/stubs directory
ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/lib/x86_64-linux-gnu/libcuda.so.1