1
- FROM nvidia/cuda:10.1-devel-ubuntu18.04
1
+ FROM nvidia/cuda:10.1-cudnn7- devel-ubuntu18.04
2
2
3
3
# TensorFlow version is tightly coupled to CUDA and cuDNN so it should be selected carefully
4
4
ARG CUDA=10.1
5
- ARG LIBNVINFER=6.0.1 -1
6
- ARG LIBNVINFER_MAJOR_VERSION=6
5
+ ARG LIBNVINFER=7.2.3 -1
6
+ ARG LIBNVINFER_MAJOR_VERSION=7
7
7
ARG CUDNN=7.6.5.32-1
8
- ENV CUDNN_VERSION 7.6.5.32
9
8
ENV NCCL=2.6.4
10
9
ENV NCCL_VERSION=2.6.4-1+cuda10.1
10
+ ENV CUDNN_VERSION 7.6.5.32
11
11
ENV MLNX_OFED_VERSION=5.1-2.3.7.1
12
12
ENV MKL_VERSION=2020.3
13
13
ENV MKL_BUILD=279
14
- ENV NUMPY_VERSION 1.18.5
15
- ENV SCIPY_VERSION 1.5 .2
16
-
17
- # Python 2.7 or 3.6 is supported by Ubuntu Bionic out of the box
14
+ ENV NUMPY_VERSION 1.20.2
15
+ ENV SCIPY_VERSION 1.6 .2
16
+ ENV OPENMPI 4.1.0
17
+ # Python 3.8 is supported by Ubuntu Bionic out of the box
18
18
ARG python=3.8
19
19
ENV PYTHON_VERSION=${python}
20
20
@@ -23,7 +23,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
23
23
CPLUS_INCLUDE_PATH=/usr/include/gdal \
24
24
C_INCLUDE_PATH=/usr/include/gdal \
25
25
PYTHONUNBUFFERED=1 \
26
- LIBRARY_PATH=" /usr/local/cuda/lib64/stubs:/opt/intel/compilers_and_libraries_2020.3.279/linux/mkl/lib/intel64" \
26
+ LIBRARY_PATH=/usr/local/cuda/lib64/stubs \
27
27
_CUDA_COMPAT_PATH="/usr/local/cuda/compat" \
28
28
LD_LIBRARY_PATH="/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/compat/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:/usr/include/x86_64-linux-gnu:/opt/intel/compilers_and_libraries_2020.3.279/linux/mkl/lib/intel64" \
29
29
PATH="/usr/local/mpi/bin:/usr/local/ucx:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/bin/cmake/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/tensorrt/bin:/usr/local/src/lightgbm/LightGBM:/usr/local/bin/mecab" \
@@ -33,7 +33,6 @@ ENV DEBIAN_FRONTEND=noninteractive \
33
33
# Set default shell to /bin/bash
34
34
SHELL ["/bin/bash", "-cu"]
35
35
36
- WORKDIR /tmp
37
36
RUN rm -fr /var/lib/apt/lists/* && \
38
37
apt-get update -y && \
39
38
apt-get install -y --no-install-recommends software-properties-common wget && \
@@ -115,32 +114,35 @@ RUN rm -fr /var/lib/apt/lists/* && \
115
114
echo "/opt/intel/ipp/lib/intel64" >> /etc/ls.so.conf && \
116
115
echo "/opt/intel/lib/intel64" >> /etc/ls.so.conf && \
117
116
echo "/opt/intel/mkl/lib/intel64" >> /etc/ls.so.conf && \
118
- find /usr/local/cuda-${CUDA}/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete && \
119
- ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
117
+ find /usr/local/cuda-${CUDA}/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete
118
+
119
+ WORKDIR /tmp
120
+ RUN curl -fsSL https://developer.download.nvidia.com/compute/redist/nccl/v2.6/nccl_2.6.4-1+cuda10.1_x86_64.txz -O && \
121
+ tar --no-same-owner --keep-old-files --lzma -xvf nccl_${NCCL}-1+cuda10.1_x86_64.txz -C /usr/local/cuda/lib64/ --strip-components=2 --wildcards '*/lib/libnccl.so.*' && \
122
+ tar --no-same-owner --keep-old-files --lzma -xvf nccl_${NCCL}-1+cuda10.1_x86_64.txz -C /usr/lib/pkgconfig/ --strip-components=3 --wildcards '*/lib/pkgconfig/*' && \
123
+ rm nccl_${NCCL}-1+cuda10.1_x86_64.txz && \
124
+ ldconfig
125
+
126
+ RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
120
127
echo "/usr/local/cuda/lib64/stubs" > /etc/ld.so.conf.d/z-cuda-stubs.conf && \
121
128
ldconfig
122
129
123
130
# Install CUDA-10.1 + cuDNN 7.6.5
124
- RUN apt-get update && \
125
- apt-get install -y --no-install-recommends \
126
- libcudnn7=$CUDNN_VERSION-1+cuda10.1 \
127
- libcudnn7-dev=$CUDNN_VERSION-1+cuda10.1 && \
128
- ln -s /usr/local/cuda-10.1 /usr/local/cuda && \
131
+ RUN ln -s /usr/local/cuda-10.1 /usr/local/cuda && \
129
132
ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5 /usr/local/cuda/lib64/libcudnn.so && \
130
- rm -rf /var/lib/apt/lists/* && \
131
- apt-mark hold libcudnn7 && \
132
133
ldconfig
133
134
134
- RUN curl -sL https://deb.nodesource.com/setup_10 .x | bash - && \
135
+ RUN curl -sL https://deb.nodesource.com/setup_14 .x | bash - && \
135
136
apt-get update -y && \
136
- apt-get install -y --no-install-recommends nodejs
137
+ apt-get install -y nodejs
137
138
138
- RUN apt-get update -y && \
139
+ RUN apt-get update && \
139
140
apt-get install -y --no-install-recommends \
140
- libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \
141
+ libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \
141
142
libnvinfer-dev=${LIBNVINFER}+cuda${CUDA} \
143
+ libnvinfer-plugin7 \
142
144
libnvinfer-plugin-dev=${LIBNVINFER}+cuda${CUDA} \
143
- libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} && \
145
+ && \
144
146
apt-get clean && \
145
147
rm -rf /var/lib/apt/lists/*
146
148
@@ -149,26 +151,23 @@ RUN mkdir -p /etc/OpenCL/vendors && \
149
151
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
150
152
151
153
# OFED
152
- ENV STAGE_DIR=/tmp
153
- RUN mkdir -p ${STAGE_DIR}
154
- ENV MLNX_OFED_VERSION=4.6-1.0.1.1
155
- RUN cd ${STAGE_DIR} && \
156
- wget -q -O - http://www.mellanox.com/downloads/ofed/MLNX_OFED-${MLNX_OFED_VERSION}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu18.04-x86_64.tgz | tar xzf -
157
- RUN cd ${STAGE_DIR}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu18.04-x86_64 && \
154
+ WORKDIR /tmp
155
+ RUN wget -q -O - https://www.mellanox.com/downloads/ofed/MLNX_OFED-5.1-2.3.7.1/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu18.04-x86_64.tgz | tar xzf - && \
156
+ cd /tmp/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu18.04-x86_64 && \
158
157
./mlnxofedinstall --user-space-only --without-fw-update --all -q && \
159
- cd ${STAGE_DIR} && \
160
- rm -rf ${STAGE_DIR} /MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu18.04-x86_64*
158
+ cd /tmp && \
159
+ rm -rf /tmp /MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu18.04-x86_64*
161
160
162
161
# nvidia-peer
163
- RUN mkdir -p ${STAGE_DIR} && \
164
- git clone https://github.com/Mellanox/nv_peer_memory.git ${STAGE_DIR} /nv_peer_memory && \
165
- cd ${STAGE_DIR} /nv_peer_memory && \
162
+ WORKDIR /tmp
163
+ RUN git clone https://github.com/Mellanox/nv_peer_memory.git /tmp /nv_peer_memory && \
164
+ cd /tmp /nv_peer_memory && \
166
165
./build_module.sh && \
167
- cd ${STAGE_DIR} && \
168
- tar xzf ${STAGE_DIR} /nvidia-peer-memory_1.1.orig.tar.gz && \
169
- cd ${STAGE_DIR} /nvidia-peer-memory-1.1 && \
166
+ cd /tmp && \
167
+ tar xzf /tmp /nvidia-peer-memory_1.1.orig.tar.gz && \
168
+ cd /tmp /nvidia-peer-memory-1.1 && \
170
169
dpkg-buildpackage -us -uc && \
171
- dpkg -i ${STAGE_DIR} /nvidia-peer-memory_1.1-0_all.deb
170
+ dpkg -i /tmp /nvidia-peer-memory_1.1-0_all.deb
172
171
173
172
RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-Linux-x86_64.sh \
174
173
-q -O /tmp/cmake-install.sh && \
@@ -204,33 +203,16 @@ RUN rm /usr/bin/python /usr/bin/python3 && \
204
203
WORKDIR /tmp
205
204
RUN curl https://bootstrap.pypa.io/get-pip.py | python3 && \
206
205
python3 -m pip install --no-cache-dir -U setuptools pip && \
207
- python3 -m pip install --no-cache-dir cython pybind11
208
-
209
- RUN python3 -m pip install --no-cache-dir --upgrade -Iv \
210
- Cython==0.29.21 \
211
- tornado==6.0.4 \
212
- pystan==2.19.1.1 \
213
- pycairo==1.19.0 \
214
- python-language-server[all] \
215
- matplotlib==3.1.1
216
-
217
- RUN cd /tmp && \
218
- git clone --recursive https://github.com/bodono/scs-python.git && \
219
- cd scs-python && \
220
- python3 setup.py install --scs --gpu
206
+ python3 -m pip install --no-cache-dir cython pybind11 python-lsp-server
221
207
222
208
WORKDIR /tmp
209
+ # OpenBlas
223
210
RUN git clone -q --branch=master git://github.com/xianyi/OpenBLAS.git && \
224
211
cd OpenBLAS && \
225
- make DYNAMIC_ARCH=1 NO_AFFINITY=1 NUM_THREADS=48 FC=gfortran NO_CBLAS=1 NO_LAPACK=1 NO_LAPACKE=1 && \
212
+ make DYNAMIC_ARCH=1 NO_AFFINITY=1 NUM_THREADS=48 FC=gfortran && \
226
213
make install
227
-
228
- RUN git clone --recursive https://github.com/bodono/scs-python.git && \
229
- cd /tmp/scs-python && \
230
- python setup.py install --scs --gpu
231
-
232
- RUN cd /tmp && \
233
- git clone --branch=v${NUMPY_VERSION} --depth=1 https://github.com/numpy/numpy.git numpy && \
214
+ # Numpy
215
+ RUN git clone --branch=v${NUMPY_VERSION} --depth=1 https://github.com/numpy/numpy.git numpy && \
234
216
cd numpy && \
235
217
git checkout -b v${NUMPY_VERSION} && \
236
218
cp site.cfg.example site.cfg && \
@@ -241,7 +223,7 @@ RUN cd /tmp && \
241
223
echo "lapack_libs =" >> site.cfg && \
242
224
python3 setup.py bdist_wheel -d /tmp
243
225
244
- # Install scipy
226
+ # Scipy
245
227
RUN cd /tmp && \
246
228
git clone --branch=v${SCIPY_VERSION} --depth=1 https://github.com/scipy/scipy.git scipy && \
247
229
cd scipy && \
@@ -252,32 +234,31 @@ RUN cd /tmp && \
252
234
echo "library_dirs = /opt/intel/compilers_and_libraries_2020.3.279/linux/mkl/lib/intel64" >> site.cfg && \
253
235
echo "mkl_libs = mkl_rt" >> site.cfg && \
254
236
echo "lapack_libs =" >> site.cfg && \
255
- python3 -m pip install -U --no-cache-dir /tmp/numpy-1.18.5-cp36-cp36m-linux_x86_64 .whl && \
237
+ python3 -m pip install -U --no-cache-dir /tmp/numpy-* .whl && \
256
238
python3 setup.py install
257
-
258
-
259
- RUN python3 -m pip install pip --no-cache-dir \
260
- Cartopy==0.18.0 \
261
- notebook==6.0.3
262
-
263
- WORKDIR /tmp
264
- COPY ./requirements.py38.txt /tmp
265
- RUN python3 -m pip install --no-cache-dir -r requirements.py38.txt && \
266
- rm -f /tmp/*.whl /tmp/requirements.py38.txt
239
+ RUN cd /tmp && \
240
+ git clone --recursive https://github.com/bodono/scs-python.git && \
241
+ cd scs-python && \
242
+ python3 setup.py install --scs --gpu
267
243
268
244
# install NLP packages *mecab-ko & khai*
269
- WORKDIR /tmp
270
- RUN curl -LO https://bitbucket.org/eunjeon/mecab-ko/downloads/mecab-0.996-ko-0.9.2.tar.gz && \
245
+ RUN apt-get update && \
246
+ apt-get install -y \
247
+ openjdk-8-jdk \
248
+ automake \
249
+ && \
250
+ cd /tmp && \
251
+ curl -LO https://bitbucket.org/eunjeon/mecab-ko/downloads/mecab-0.996-ko-0.9.2.tar.gz && \
271
252
tar zxfv mecab-0.996-ko-0.9.2.tar.gz && \
272
253
cd mecab-0.996-ko-0.9.2 && \
273
254
./configure && \
274
255
make -j$(nproc) && \
275
256
make check && \
276
257
make install
277
-
278
- # Install mecab-ko-dic
279
- WORKDIR /tmp
280
- RUN curl -LO https://bitbucket.org/eunjeon/mecab-ko-dic/downloads/mecab-ko-dic-2.1.1-20180720.tar.gz && \
258
+ RUN echo "Install mecab-ko-dic" && \
259
+ cd /tmp && \
260
+ ldconfig && \
261
+ curl -LO https://bitbucket.org/eunjeon/mecab-ko-dic/downloads/mecab-ko-dic-2.1.1-20180720.tar.gz && \
281
262
tar -zxvf mecab-ko-dic-2.1.1-20180720.tar.gz && \
282
263
cd mecab-ko-dic-2.1.1-20180720 && \
283
264
./autogen.sh && \
@@ -289,6 +270,11 @@ RUN curl -LO https://bitbucket.org/eunjeon/mecab-ko-dic/downloads/mecab-ko-dic-2
289
270
git clone https://bitbucket.org/eunjeon/mecab-python-0.996.git && \
290
271
python3 -m pip install /tmp/mecab-python-0.996
291
272
273
+ WORKDIR /tmp
274
+ COPY ./requirements.py38.txt /tmp
275
+ RUN python3 -m pip install --no-cache-dir -r requirements.py38.txt && \
276
+ rm -f /tmp/*.whl /tmp/requirements.py38.txt
277
+
292
278
# OpenCV
293
279
RUN ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h && \
294
280
apt-get install -y \
@@ -319,7 +305,7 @@ RUN ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h && \
319
305
rm -rf /var/lib/apt/lists/
320
306
321
307
WORKDIR /tmp
322
- ENV OPENCV_VERSION="4.5.1 "
308
+ ENV OPENCV_VERSION="4.5.2 "
323
309
RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
324
310
wget -O opencv-contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && \
325
311
unzip ${OPENCV_VERSION}.zip && \
@@ -332,7 +318,7 @@ RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
332
318
-D BUILD_opencv_java=OFF \
333
319
-D WITH_CUDA=ON \
334
320
-D CUDA_NVCC_FLAGS=--expt-relaxed-constexpr \
335
- -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-11 .1 \
321
+ -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10 .1 \
336
322
-D ENABLE_FAST_MATH=1 \
337
323
-D CUDA_FAST_MATH=1 \
338
324
-D WITH_CUBLAS=1 \
@@ -344,7 +330,7 @@ RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
344
330
-D WITH_V4L=ON \
345
331
-D BUILD_TESTS=OFF \
346
332
-D BUILD_PERF_TESTS=OFF \
347
- -D OPENCV_EXTRA_MODULES_PATH="../../opencv_contrib-4.5.1 /modules" \
333
+ -D OPENCV_EXTRA_MODULES_PATH="../../opencv_contrib-4.5.2 /modules" \
348
334
-D CMAKE_BUILD_TYPE=RELEASE \
349
335
-D CMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") \
350
336
-D PYTHON_EXECUTABLE=$(which python3) \
@@ -369,7 +355,7 @@ RUN cd /usr/local/src && mkdir lightgbm && cd lightgbm && \
369
355
git clone --recursive --branch stable --depth 1 https://github.com/microsoft/LightGBM && \
370
356
cd LightGBM && mkdir build && cd build && \
371
357
cmake -DUSE_GPU=1 -DOpenCL_LIBRARY=/usr/local/cuda/lib64/libOpenCL.so -DOpenCL_INCLUDE_DIR=/usr/local/cuda/include/ .. && \
372
- make OPENCL_HEADERS=/usr/local/cuda-11 .1/targets/x86_64-linux/include LIBOPENCL=/usr/local/cuda-11 .1/targets/x86_64-linux/lib -j$(nproc) && \
358
+ make OPENCL_HEADERS=/usr/local/cuda-10 .1/targets/x86_64-linux/include LIBOPENCL=/usr/local/cuda-10 .1/targets/x86_64-linux/lib -j$(nproc) && \
373
359
cd /usr/local/src/lightgbm/LightGBM/python-package && \
374
360
python3 setup.py install --precompile
375
361
@@ -427,6 +413,7 @@ RUN curl -fL https://github.com/cdr/code-server/releases/download/v3.9.2/code-se
427
413
mv /usr/local/lib/code-server-3.9.2-linux-amd64 /usr/local/lib/code-server-3.9.2 && \
428
414
ln -s /usr/local/lib/code-server-3.9.2/bin/code-server /usr/local/bin/code-server
429
415
416
+ # Install Jupyterlab extensions
430
417
RUN jupyter nbextensions_configurator enable && \
431
418
jupyter contrib nbextension install && \
432
419
jupyter nbextension enable --py --sys-prefix widgetsnbextension && \
@@ -444,6 +431,7 @@ RUN jupyter nbextensions_configurator enable && \
444
431
445
432
# Clean up
446
433
RUN apt autoclean && \
434
+ ln -s /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcusolver.so.11 /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcusolver.so.10 && \
447
435
sed -i 's/source \/ usr\/ local\/ nvm\/ nvm.sh//' /etc/bash.bashrc && \
448
436
ln -sf /usr/share/terminfo/x/xterm-color /usr/share/terminfo/x/xterm-256color && \
449
437
rm -rf /var/lib/apt/lists/* && \
0 commit comments