-
Notifications
You must be signed in to change notification settings - Fork 18
/
cntk-cu9.2-dnn7.2-18.09.dockerfile
56 lines (51 loc) · 2.17 KB
/
cntk-cu9.2-dnn7.2-18.09.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
#################################################################################
#
# Dockerfile for:
# * CNTK v2.5.1
# * CUDA9.2 + cuDNN7.2 + NCCL2.2
# * Keras v2.2.2
#
# This image is based on "honghu/intelpython3:gpu-cu9.2-dnn7.2-18.09",
# where "Intel® Distribution for Python" is installed.
#
#################################################################################
#
# More Information
# * Intel® Distribution for Python:
# https://software.intel.com/en-us/distribution-for-python
#
#################################################################################
#
# Software License Agreement
# If you use the docker image built from this Dockerfile, it means
# you accept the following agreements:
# * Intel® Distribution for Python:
# https://software.intel.com/en-us/articles/end-user-license-agreement
# * NVIDIA cuDNN:
# https://docs.nvidia.com/deeplearning/sdk/cudnn-sla/index.html
# * NVIDIA NCCL:
# https://docs.nvidia.com/deeplearning/sdk/nccl-sla/index.html
#
#################################################################################
FROM honghu/intelpython3:gpu-cu9.2-dnn7.2-18.09
LABEL maintainer="Chi-Hung Weng <wengchihung@gmail.com>"
ARG CNTK_VER=2.5.1
ARG KERAS_VER=2.2.2
# Install "openmpi-bin", which is required by CNTK.
RUN apt update && apt install -y --no-install-recommends \
openmpi-bin && \
apt clean && \
rm -rf /var/lib/apt/lists/*
# CNTK looks for "libmpi_cxx.so.1", not "libmpi_cxx.so.20".
RUN ln -s /usr/lib/x86_64-linux-gnu/libmpi_cxx.so.20 /usr/lib/x86_64-linux-gnu/libmpi_cxx.so.1
# Install CNTK & Keras.
RUN pip install https://cntk.ai/PythonWheel/GPU/cntk_gpu-${CNTK_VER}-cp36-cp36m-linux_x86_64.whl && \
pip --no-cache-dir install keras==${KERAS_VER} && \
rm -rf /tmp/pip* && \
rm -rf /root/.cache
# Tell Keras to use CNTK as its backend.
WORKDIR /root/.keras
RUN wget -O /root/.keras/keras.json https://raw.githubusercontent.com/chi-hung/DockerKeras/master/keras-cntk.json
# Add a MNIST example.
WORKDIR /workspace
RUN wget -O /workspace/DemoKerasMNIST.ipynb https://raw.githubusercontent.com/chi-hung/PythonDataMining/master/code_examples/KerasMNISTDemo.ipynb