From 2d74d6900c064c55a5951a41ccc16dedc5ef8032 Mon Sep 17 00:00:00 2001 From: Nikos Karampatziakis Date: Tue, 8 Nov 2016 14:39:17 -0800 Subject: [PATCH 1/3] Added build-arg to 1bit image --- Tools/docker/CNTK-GPU-1bit-Image/Dockerfile | 28 ++++++++++++++++++++- Tools/docker/CNTK-GPU-Image/Dockerfile | 6 ++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Tools/docker/CNTK-GPU-1bit-Image/Dockerfile b/Tools/docker/CNTK-GPU-1bit-Image/Dockerfile index f00996a84..22e1c4f2e 100644 --- a/Tools/docker/CNTK-GPU-1bit-Image/Dockerfile +++ b/Tools/docker/CNTK-GPU-1bit-Image/Dockerfile @@ -1,5 +1,27 @@ FROM nvidia/cuda:7.5-cudnn5-devel +ARG ENABLE_1BIT_SGD + +ENV MSG1BIT "\ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\ +You are attempting to build the Image of CNTK with 1-bit Stochastic Gradient\n\ +Descent (1bit-SGD) enabled. Before proceeding further please ensure you \n\ +understand the license difference between CNTK and 1bit-SGD. See \n\ +https://github.com/Microsoft/CNTK/wiki/Enabling-1bit-SGD#license-difference-between-cntk-and-1bit-sgd\n\ +\n\ +To build the Image pass the following parameter to Docker:\n\ +\n\ + --build-arg ENABLE_1BIT_SGD=true\n\ +\n\ +Example:\n\ +\n\ + docker build -t cntk --build-arg ENABLE_1BIT_SGD=true ./CNTK-GPU-1bit-Image\n\ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\ +\n\ +" + +RUN test x$ENABLE_1BIT_SGD = "xtrue" || (echo $MSG1BIT; exit 1) + RUN apt-get update && apt-get install -y --no-install-recommends \ autotools-dev \ build-essential \ @@ -169,6 +191,10 @@ RUN conda create --name cntk-py34 python=3.4.3 numpy scipy jupyter matplotlib pi ENV PATH /root/anaconda3/envs/cntk-py34/bin/:$PATH +ENV TMP_LD_LIBRARY_PATH = $LD_LIBRARY_PATH + +ENV LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64/stubs/:$TMP_LD_LIBRARY_PATH + WORKDIR /cntk # Build CNTK @@ -203,4 +229,4 @@ RUN cd Examples/Image/DataSets/MNIST && \ ENV PATH=/cntk/build/gpu/release/bin:/usr/local/mpi/bin:$PATH ENV PYTHONPATH /cntk/bindings/python:$PYTHONPATH -ENV LD_LIBRARY_PATH /cntk/bindings/cntk/libs:$LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH /cntk/bindings/cntk/libs:$TMP_LD_LIBRARY_PATH diff --git a/Tools/docker/CNTK-GPU-Image/Dockerfile b/Tools/docker/CNTK-GPU-Image/Dockerfile index 1da427523..2d3286e18 100644 --- a/Tools/docker/CNTK-GPU-Image/Dockerfile +++ b/Tools/docker/CNTK-GPU-Image/Dockerfile @@ -169,6 +169,10 @@ RUN conda create --name cntk-py34 python=3.4.3 numpy scipy jupyter matplotlib pi ENV PATH /root/anaconda3/envs/cntk-py34/bin/:$PATH +ENV TMP_LD_LIBRARY_PATH = $LD_LIBRARY_PATH + +ENV LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64/stubs/:$TMP_LD_LIBRARY_PATH + WORKDIR /cntk # Build CNTK @@ -202,4 +206,4 @@ RUN cd Examples/Image/DataSets/MNIST && \ ENV PATH=/cntk/build/gpu/release/bin:/usr/local/mpi/bin:$PATH ENV PYTHONPATH /cntk/bindings/python:$PYTHONPATH -ENV LD_LIBRARY_PATH /cntk/bindings/cntk/libs:$LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH /cntk/bindings/cntk/libs:$TMP_LD_LIBRARY_PATH From ad753521dce3961c1d7d33cfcd96173a121df4cf Mon Sep 17 00:00:00 2001 From: Nikos Karampatziakis Date: Tue, 8 Nov 2016 14:52:28 -0800 Subject: [PATCH 2/3] Added readme on Dockerfiles --- Tools/docker/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Tools/docker/README.md diff --git a/Tools/docker/README.md b/Tools/docker/README.md new file mode 100644 index 000000000..5382858e6 --- /dev/null +++ b/Tools/docker/README.md @@ -0,0 +1,8 @@ +# CNTK Dockerfiles + +The Dockerfiles provided here can be used to build CNTK on machines with only CPU, or with GPU with or without 1bit-SGD. +If you plan to use the 1bit-SGD version, please make sure you understand the +[license difference between CNTK and 1bit-SGD](https://github.com/Microsoft/CNTK/wiki/Enabling-1bit-SGD). + +See also [this page](https://github.com/Microsoft/CNTK/wiki/CNTK-Docker-Containers) +that provides general instructions on getting things working with docker. From f3272f9d37b9ff3add008c63aaf4dce4acc0814f Mon Sep 17 00:00:00 2001 From: Nikos Karampatziakis Date: Tue, 8 Nov 2016 14:55:10 -0800 Subject: [PATCH 3/3] Modified python paths --- Tools/docker/CNTK-GPU-1bit-Image/Dockerfile | 2 +- Tools/docker/CNTK-GPU-Image/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/docker/CNTK-GPU-1bit-Image/Dockerfile b/Tools/docker/CNTK-GPU-1bit-Image/Dockerfile index 22e1c4f2e..ae1a4505f 100644 --- a/Tools/docker/CNTK-GPU-1bit-Image/Dockerfile +++ b/Tools/docker/CNTK-GPU-1bit-Image/Dockerfile @@ -229,4 +229,4 @@ RUN cd Examples/Image/DataSets/MNIST && \ ENV PATH=/cntk/build/gpu/release/bin:/usr/local/mpi/bin:$PATH ENV PYTHONPATH /cntk/bindings/python:$PYTHONPATH -ENV LD_LIBRARY_PATH /cntk/bindings/cntk/libs:$TMP_LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH /cntk/bindings/python/cntk/libs:$TMP_LD_LIBRARY_PATH diff --git a/Tools/docker/CNTK-GPU-Image/Dockerfile b/Tools/docker/CNTK-GPU-Image/Dockerfile index 2d3286e18..9bbf8f9ce 100644 --- a/Tools/docker/CNTK-GPU-Image/Dockerfile +++ b/Tools/docker/CNTK-GPU-Image/Dockerfile @@ -206,4 +206,4 @@ RUN cd Examples/Image/DataSets/MNIST && \ ENV PATH=/cntk/build/gpu/release/bin:/usr/local/mpi/bin:$PATH ENV PYTHONPATH /cntk/bindings/python:$PYTHONPATH -ENV LD_LIBRARY_PATH /cntk/bindings/cntk/libs:$TMP_LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH /cntk/bindings/python/cntk/libs:$TMP_LD_LIBRARY_PATH