Skip to content

Commit 9420342

Browse files
committed
Dockerfile.1.3-py36-cuda10
1 parent e0d13d5 commit 9420342

File tree

1 file changed

+71
-65
lines changed

1 file changed

+71
-65
lines changed

python-pytorch/Dockerfile.1.3-py36-cuda10

Lines changed: 71 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
FROM nvidia/cuda:10.0-devel-ubuntu18.04
22

33
# TensorFlow version is tightly coupled to CUDA and cuDNN so it should be selected carefully
4+
ENV TENSORFLOW_VERSION=2.1.0
45
ENV PYTORCH_VERSION=1.3.0
5-
ENV TORCHVISION_VERSION=0.4.1
6+
ENV TORCHVISION_VERSION=0.5.0
67
ENV TORCHAUDIO_VERSION=0.4.0
8+
ENV TORCHTEXT_VERSION=0.5.0
79
ENV TENSORBOARDX_VERSION=1.9
8-
ENV CUDNN_VERSION=7.6.0.64-1+cuda10.0
10+
ENV MXNET_VERSION=1.5.1
11+
ARG CUDA=10.0
12+
ARG LIBNVINFER=6.0.1-1
13+
ARG LIBNVINFER_MAJOR_VERSION=6
14+
ENV CUDNN_VERSION=7.6.4.38-1+cuda10.0
915
ENV NCCL_VERSION=2.4.8-1+cuda10.0
1016
ENV DEBIAN_FRONTEND=noninteractive
1117
ENV mecab_dicdir /usr/local/lib/mecab/dic/mecab-ko-dic
1218

13-
# Python 2.7 or 3.6 is supported by Ubuntu Bionic out of the box
19+
# Python 2.7 or 3.67 is supported by Ubuntu Bionic out of the box
1420
ARG python=3.6
1521
ENV PYTHON_VERSION=${python}
1622

1723
ENV PYTHONUNBUFFERED=1 \
18-
LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/nvidia/lib64" \
24+
LD_LIBRARY_PATH="/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/nvidia/lib64:/usr/local/cuda/lib64/stubs:/usr/include/x64_64-linux-gnu" \
1925
PATH="/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin/mecab" \
2026
LANG=C.UTF-8
2127

@@ -44,6 +50,16 @@ RUN apt-get update -y && \
4450
libmpdec2 \
4551
pdsh curl sudo net-tools \
4652
iputils-ping \
53+
libcublas10=10.2.1.243-1 \
54+
libcublas-dev=10.2.1.243-1 \
55+
cuda-command-line-tools-${CUDA/./-} \
56+
cuda-nvrtc-${CUDA/./-} \
57+
cuda-nvrtc-dev-${CUDA/./-} \
58+
cuda-cudart-dev-${CUDA/./-} \
59+
cuda-cufft-dev-${CUDA/./-} \
60+
cuda-curand-dev-${CUDA/./-} \
61+
cuda-cusolver-dev-${CUDA/./-} \
62+
cuda-cusparse-dev-${CUDA/./-} \
4763
libcudnn7=${CUDNN_VERSION} \
4864
libnccl2=${NCCL_VERSION} \
4965
libnccl-dev=${NCCL_VERSION} \
@@ -72,12 +88,22 @@ RUN apt-get update -y && \
7288
libfreetype6-dev \
7389
fonts-nanum \
7490
fonts-nanum-coding \
75-
fonts-nanum-extra
91+
fonts-nanum-extra && \
92+
find /usr/local/cuda-${CUDA}/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete
93+
# && rm /usr/lib/x86_64-linux-gnu/libcudnn_static_v7.a
7694

7795
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
7896
apt-get update -y && \
7997
apt-get install -y nodejs
8098

99+
RUN apt-get update && \
100+
apt-get install -y --no-install-recommends libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \
101+
libnvinfer-dev=${LIBNVINFER}+cuda${CUDA} \
102+
libnvinfer-plugin-dev=${LIBNVINFER}+cuda${CUDA} \
103+
libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \
104+
&& apt-get clean \
105+
&& rm -rf /var/lib/apt/lists/*
106+
81107
# OFED
82108
ENV STAGE_DIR=/tmp
83109
RUN mkdir -p ${STAGE_DIR}
@@ -118,34 +144,37 @@ RUN curl https://bootstrap.pypa.io/get-pip.py | python3 && \
118144
# Install TensorFlow, Keras, PyTorch and MXNet
119145
RUN python3 -m pip install pip --no-cache-dir -Iv \
120146
Cython==0.29.13 \
121-
numpy==1.16.5 \
147+
numpy==1.16.3 \
122148
scipy==1.4.1 \
123149
scikit-image==0.16.2 \
124-
scikit-learn==0.21.3 \
125-
matplotlib==3.1.3 \
150+
scikit-learn==0.22.2 \
126151
tornado==6.0.4 \
127152
pystan==2.19.1.1 \
128-
notebook==6.0.3
129-
130-
RUN python3 -m pip install --no-cache-dir \
153+
pycairo==1.19.0 \
154+
matplotlib==3.1.3
155+
RUN python3 -m pip install pip --no-cache-dir \
156+
Cartopy==0.17.0 \
157+
notebook==6.0.3
158+
159+
WORKDIR /tmp
160+
COPY ./requirements.20.01.txt /tmp
161+
RUN python3 -m pip install --no-cache-dir -Ir requirements.20.01.txt
162+
163+
RUN python3 -m pip install pip --no-cache-dir \
164+
pandas==1.0.1 \
131165
https://download.pytorch.org/whl/cu100/torch-${PYTORCH_VERSION}%2Bcu100-cp36-cp36m-linux_x86_64.whl \
132166
https://download.pytorch.org/whl/cu100/torchvision-${TORCHVISION_VERSION}%2Bcu100-cp36-cp36m-linux_x86_64.whl \
133-
https://download.pytorch.org/whl/torchaudio-${TORCHAUDIO_VERSION}-cp36-cp36m-linux_x86_64.whl && \
167+
https://download.pytorch.org/whl/torchaudio-${TORCHAUDIO_VERSION}-cp36-cp36m-linux_x86_64.whl \
168+
torchtext==${TORCHTEXT_VERSION} && \
134169
python3 -m pip install --no-cache-dir tensorboardX==${TENSORBOARDX_VERSION}
170+
135171
RUN python3 -m pip install --no-cache-dir --extra-index-url \
136172
https://developer.download.nvidia.com/compute/redist/cuda/10.0 \
137-
nvidia-dali
138-
139-
WORKDIR /tmp
140-
COPY ./requirements.20.03.txt /tmp
141-
RUN python3 -m pip install --no-cache-dir -Ir requirements.20.03.txt
173+
nvidia-dali
142174

143175
RUN python3 -m pip install --no-cache-dir -Iv \
144-
tensorwatch==0.8.10 \
145-
jupyterlab-nvdashboard==0.2.0 \
146-
&& \
147-
python3 -m pip install --no-cache-dir konlpy h5py && \
148-
rm -f /tmp/*.whl /tmp/requirements.20.03.txt
176+
konlpy h5py && \
177+
rm -f /tmp/*.whl /tmp/requirements.20.01.txt
149178

150179
RUN apt-get update && \
151180
apt-get install -y \
@@ -272,44 +301,6 @@ RUN git clone --recursive https://github.com/Microsoft/LightGBM && \
272301
cd ../python-package && \
273302
python3 setup.py install --precompile
274303

275-
# add 19.09.06
276-
RUN git clone https://github.com/scikit-optimize/scikit-optimize.git && \
277-
cd scikit-optimize && \
278-
python3 -m pip install -r requirements.txt && \
279-
python3 setup.py develop
280-
281-
RUN python3 -m pip install --no-cache-dir imbalanced-learn && \
282-
python3 -m pip install --no-cache-dir bayesian-optimization && \
283-
python3 -m pip install --no-cache-dir scikit-plot && \
284-
python3 -m pip install --no-cache-dir vecstack && \
285-
python3 -m pip install --no-cache-dir category_encoders && \
286-
python3 -m pip install --no-cache-dir scikit-surprise && \
287-
python3 -m pip install --no-cache-dir folium && \
288-
python3 -m pip install --no-cache-dir lime && \
289-
python3 -m pip install --no-cache-dir pyldavis && \
290-
python3 -m pip install --no-cache-dir mlxtend && \
291-
python3 -m pip install --no-cache-dir dtreeviz && \
292-
python3 -m pip install --no-cache-dir pyglet && \
293-
python3 -m pip install --no-cache-dir descartes && \
294-
python3 -m pip install --no-cache-dir pydot && \
295-
python3 -m pip install --no-cache-dir tpot && \
296-
python3 -m pip install --no-cache-dir catboost && \
297-
rm -rf /root/.cache && \
298-
rm -f /tmp/*.whl
299-
300-
# Jupyter notebook extension
301-
RUN mkdir -p /home/work/.jupyter/nbextension
302-
WORKDIR /home/work/.jupyter/nbextension
303-
304-
RUN jupyter nbextensions_configurator enable && \
305-
jupyter contrib nbextension install && \
306-
jupyter nbextension enable --py --sys-prefix widgetsnbextension && \
307-
jupyter contrib nbextension install && \
308-
jupyter serverextension enable --py jupyterlab --sys-prefix && \
309-
jupyter labextension install @jupyter-widgets/jupyterlab-manager && \
310-
git clone https://github.com/lambdalisue/jupyter-vim-binding vim_binding && \
311-
jupyter nbextension enable /home/work/.jupyter/nbextension/vim_binding/vim_binding
312-
313304
# Install Open MPI
314305
RUN mkdir /tmp/openmpi && \
315306
cd /tmp/openmpi && \
@@ -320,7 +311,7 @@ RUN mkdir /tmp/openmpi && \
320311
make -j $(nproc) all && \
321312
make install && \
322313
ldconfig && \
323-
rm -rf /tmp/openmpi
314+
rm -rf /tmp/openmp*i
324315

325316
# Install Horovod, temporarily using CUDA stubs
326317
RUN ldconfig /usr/local/cuda/targets/x86_64-linux/lib/stubs && \
@@ -331,8 +322,10 @@ RUN ldconfig /usr/local/cuda/targets/x86_64-linux/lib/stubs && \
331322

332323
RUN python3 -m pip install --no-cache-dir \
333324
mpi4py==3.0.3 \
334-
nni
335-
325+
nni && \
326+
rm -rf /root/.cache && \
327+
rm -rf /tmp/*
328+
336329
# Install OpenSSH for MPI to communicate between containers
337330
RUN apt-get install -y --no-install-recommends openssh-client openssh-server && \
338331
mkdir -p /var/run/sshd
@@ -343,9 +336,22 @@ RUN cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_confi
343336
mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config
344337

345338
# Install ipython kernelspec
346-
RUN python3 -m ipykernel install --display-name "PyTorch 1.3 on Python 3.6 (CUDA 10.0)" && \
339+
Run python3 -m ipykernel install --display-name "PyTorch 1.3 on Python 3.6 (CUDA 10.0)" && \
347340
cat /usr/local/share/jupyter/kernels/python3/kernel.json
348341

342+
# Jupyter notebook extension
343+
RUN mkdir -p /home/work/.jupyter/nbextension
344+
WORKDIR /home/work/.jupyter/nbextension
345+
346+
RUN jupyter nbextensions_configurator enable && \
347+
jupyter contrib nbextension install && \
348+
jupyter nbextension enable --py --sys-prefix widgetsnbextension && \
349+
jupyter contrib nbextension install && \
350+
jupyter serverextension enable --py jupyterlab --sys-prefix && \
351+
jupyter labextension install @jupyter-widgets/jupyterlab-manager && \
352+
git clone https://github.com/lambdalisue/jupyter-vim-binding vim_binding && \
353+
jupyter nbextension enable /home/work/.jupyter/nbextension/vim_binding/vim_binding
354+
349355
# Backend.AI specifics
350356
LABEL ai.backend.kernelspec="1" \
351357
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
@@ -357,7 +363,7 @@ LABEL ai.backend.kernelspec="1" \
357363
ai.backend.resource.min.cuda.shares=0.1 \
358364
ai.backend.runtime-type="python" \
359365
ai.backend.runtime-path="/usr/bin/python3" \
360-
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8070,jupyterlab:http:8090"
366+
ai.backend.service-ports="ipython:pty:3000,tensorboard:http:6006,jupyter:http:8080,jupyterlab:http:8090"
361367

362368
WORKDIR /home/work
363369
# vim: ft=dockerfile

0 commit comments

Comments
 (0)