From 291ff97cd2302661e6e007b587f49a656a257a6d Mon Sep 17 00:00:00 2001 From: yuyang18 Date: Tue, 30 Aug 2016 16:15:45 +0000 Subject: [PATCH] Try Fix docker hub build. ISSUE=4599521 git-svn-id: https://svn.baidu.com/idl/trunk/paddle@1434 1ad973e4-5ce8-4261-8a94-b56d1f490c56 --- paddle/scripts/docker/Dockerfile.m4 | 4 +- paddle/scripts/docker/build.sh | 47 ++-------------------- paddle/scripts/docker/cpu-demo/Dockerfile | 4 +- paddle/scripts/docker/cpu-demo/build.sh | 47 ++-------------------- paddle/scripts/docker/cpu-devel/Dockerfile | 4 +- paddle/scripts/docker/cpu-devel/build.sh | 47 ++-------------------- paddle/scripts/docker/cpu/Dockerfile | 4 +- paddle/scripts/docker/cpu/build.sh | 47 ++-------------------- paddle/scripts/docker/generate.sh | 6 +++ paddle/scripts/docker/gpu-demo/Dockerfile | 4 +- paddle/scripts/docker/gpu-demo/build.sh | 47 ++-------------------- paddle/scripts/docker/gpu-devel/Dockerfile | 4 +- paddle/scripts/docker/gpu-devel/build.sh | 47 ++-------------------- paddle/scripts/docker/gpu/Dockerfile | 4 +- paddle/scripts/docker/gpu/build.sh | 47 ++-------------------- 15 files changed, 41 insertions(+), 322 deletions(-) diff --git a/paddle/scripts/docker/Dockerfile.m4 b/paddle/scripts/docker/Dockerfile.m4 index 6d0554cf4e..e5574254d9 100644 --- a/paddle/scripts/docker/Dockerfile.m4 +++ b/paddle/scripts/docker/Dockerfile.m4 @@ -1,11 +1,9 @@ -FROM ubuntu:14.04 +FROM PADDLE_BASE_IMAGE MAINTAINER PaddlePaddle Dev Team COPY build.sh /root/ -ENV LOWEST_DL_SPEED=0 ENV WITH_GPU=PADDLE_WITH_GPU ENV IS_DEVEL=PADDLE_IS_DEVEL ENV WITH_DEMO=PADDLE_WITH_DEMO ENV PIP_INSTALL_ARGS "" ENV PIP_GENERAL_ARGS "" -ENV CUDNN_DOWNLOAD_SUM 40d506d0a8a00a3faccce1433346806b8cd2535683b6f08a63683ce6e474419f RUN cd /root/ && bash build.sh diff --git a/paddle/scripts/docker/build.sh b/paddle/scripts/docker/build.sh index 8b2a2b8e81..3083afbe48 100644 --- a/paddle/scripts/docker/build.sh +++ b/paddle/scripts/docker/build.sh @@ -13,54 +13,16 @@ apt-get install -y cmake libprotobuf-dev protobuf-compiler git \ libgoogle-glog-dev libgflags-dev libatlas-dev libatlas3-base g++ m4 python-pip\ python-protobuf python-numpy python-dev swig -if [ ${WITH_GPU} == "ON" ]; then # install cuda - cd ~ - apt-get install -y aria2 wget - echo "Downloading cuda tookit" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 -s 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run - if [ $? -eq 0 ]; then - break - fi - done - - set -e - wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run.md5 - md5sum -c cuda_7.5.18_linux.run.md5 - chmod +x cuda_7.5.18_linux.run - ./cuda_7.5.18_linux.run --extract=$PWD - mv cuda-linux64-rel-7.5.18-*.run tmp - rm *.run *.run.md5 - mv tmp cuda-linux64.run - ./cuda-linux64.run -noprompt - rm *.run - - echo "Downloading cudnn v5.1" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-7.5-linux-x64-v5.1.tgz - if [ $? -eq 0 ]; then - break - fi - done - set -e - echo "$CUDNN_DOWNLOAD_SUM cudnn-7.5-linux-x64-v5.1.tgz" | sha256sum -c --strict - - tar -xzf cudnn-7.5-linux-x64-v5.1.tgz -C /usr/local - rm cudnn-7.5-linux-x64-v5.1.tgz - ldconfig - export PATH=/usr/local/cuda/bin:$PATH - apt-get purge -y aria2 +if [ ${WITH_GPU} == 'ON' ]; then + ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so /usr/lib/libcudnn.so fi -set -e + cd ~ git clone https://github.com/baidu/Paddle.git paddle cd paddle mkdir build cd build -cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON +cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON -DCUDNN_ROOT=/usr/ make -j `nproc` # because durning make install, there are several warning, so set +e, do not cause abort make install @@ -75,7 +37,6 @@ if [ ${WITH_DEMO} == "ON" ]; then fi if [ ${IS_DEVEL} == "OFF" ]; then # clean build packages. cd ~ - # TODO(yuyang18): Do clean for devel package, and cuda devel tools rm -rf paddle fi apt-get clean -y diff --git a/paddle/scripts/docker/cpu-demo/Dockerfile b/paddle/scripts/docker/cpu-demo/Dockerfile index a2b05cd387..e968d47a78 100644 --- a/paddle/scripts/docker/cpu-demo/Dockerfile +++ b/paddle/scripts/docker/cpu-demo/Dockerfile @@ -1,11 +1,9 @@ -FROM ubuntu:14.04 +FROM ubuntu/ubuntu:14.04 MAINTAINER PaddlePaddle Dev Team COPY build.sh /root/ -ENV LOWEST_DL_SPEED=0 ENV WITH_GPU=OFF ENV IS_DEVEL=ON ENV WITH_DEMO=ON ENV PIP_INSTALL_ARGS "" ENV PIP_GENERAL_ARGS "" -ENV CUDNN_DOWNLOAD_SUM 40d506d0a8a00a3faccce1433346806b8cd2535683b6f08a63683ce6e474419f RUN cd /root/ && bash build.sh diff --git a/paddle/scripts/docker/cpu-demo/build.sh b/paddle/scripts/docker/cpu-demo/build.sh index 8b2a2b8e81..3083afbe48 100644 --- a/paddle/scripts/docker/cpu-demo/build.sh +++ b/paddle/scripts/docker/cpu-demo/build.sh @@ -13,54 +13,16 @@ apt-get install -y cmake libprotobuf-dev protobuf-compiler git \ libgoogle-glog-dev libgflags-dev libatlas-dev libatlas3-base g++ m4 python-pip\ python-protobuf python-numpy python-dev swig -if [ ${WITH_GPU} == "ON" ]; then # install cuda - cd ~ - apt-get install -y aria2 wget - echo "Downloading cuda tookit" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 -s 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run - if [ $? -eq 0 ]; then - break - fi - done - - set -e - wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run.md5 - md5sum -c cuda_7.5.18_linux.run.md5 - chmod +x cuda_7.5.18_linux.run - ./cuda_7.5.18_linux.run --extract=$PWD - mv cuda-linux64-rel-7.5.18-*.run tmp - rm *.run *.run.md5 - mv tmp cuda-linux64.run - ./cuda-linux64.run -noprompt - rm *.run - - echo "Downloading cudnn v5.1" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-7.5-linux-x64-v5.1.tgz - if [ $? -eq 0 ]; then - break - fi - done - set -e - echo "$CUDNN_DOWNLOAD_SUM cudnn-7.5-linux-x64-v5.1.tgz" | sha256sum -c --strict - - tar -xzf cudnn-7.5-linux-x64-v5.1.tgz -C /usr/local - rm cudnn-7.5-linux-x64-v5.1.tgz - ldconfig - export PATH=/usr/local/cuda/bin:$PATH - apt-get purge -y aria2 +if [ ${WITH_GPU} == 'ON' ]; then + ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so /usr/lib/libcudnn.so fi -set -e + cd ~ git clone https://github.com/baidu/Paddle.git paddle cd paddle mkdir build cd build -cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON +cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON -DCUDNN_ROOT=/usr/ make -j `nproc` # because durning make install, there are several warning, so set +e, do not cause abort make install @@ -75,7 +37,6 @@ if [ ${WITH_DEMO} == "ON" ]; then fi if [ ${IS_DEVEL} == "OFF" ]; then # clean build packages. cd ~ - # TODO(yuyang18): Do clean for devel package, and cuda devel tools rm -rf paddle fi apt-get clean -y diff --git a/paddle/scripts/docker/cpu-devel/Dockerfile b/paddle/scripts/docker/cpu-devel/Dockerfile index 48be5e07ea..6fb23877ac 100644 --- a/paddle/scripts/docker/cpu-devel/Dockerfile +++ b/paddle/scripts/docker/cpu-devel/Dockerfile @@ -1,11 +1,9 @@ -FROM ubuntu:14.04 +FROM ubuntu/ubuntu:14.04 MAINTAINER PaddlePaddle Dev Team COPY build.sh /root/ -ENV LOWEST_DL_SPEED=0 ENV WITH_GPU=OFF ENV IS_DEVEL=ON ENV WITH_DEMO=OFF ENV PIP_INSTALL_ARGS "" ENV PIP_GENERAL_ARGS "" -ENV CUDNN_DOWNLOAD_SUM 40d506d0a8a00a3faccce1433346806b8cd2535683b6f08a63683ce6e474419f RUN cd /root/ && bash build.sh diff --git a/paddle/scripts/docker/cpu-devel/build.sh b/paddle/scripts/docker/cpu-devel/build.sh index 8b2a2b8e81..3083afbe48 100644 --- a/paddle/scripts/docker/cpu-devel/build.sh +++ b/paddle/scripts/docker/cpu-devel/build.sh @@ -13,54 +13,16 @@ apt-get install -y cmake libprotobuf-dev protobuf-compiler git \ libgoogle-glog-dev libgflags-dev libatlas-dev libatlas3-base g++ m4 python-pip\ python-protobuf python-numpy python-dev swig -if [ ${WITH_GPU} == "ON" ]; then # install cuda - cd ~ - apt-get install -y aria2 wget - echo "Downloading cuda tookit" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 -s 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run - if [ $? -eq 0 ]; then - break - fi - done - - set -e - wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run.md5 - md5sum -c cuda_7.5.18_linux.run.md5 - chmod +x cuda_7.5.18_linux.run - ./cuda_7.5.18_linux.run --extract=$PWD - mv cuda-linux64-rel-7.5.18-*.run tmp - rm *.run *.run.md5 - mv tmp cuda-linux64.run - ./cuda-linux64.run -noprompt - rm *.run - - echo "Downloading cudnn v5.1" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-7.5-linux-x64-v5.1.tgz - if [ $? -eq 0 ]; then - break - fi - done - set -e - echo "$CUDNN_DOWNLOAD_SUM cudnn-7.5-linux-x64-v5.1.tgz" | sha256sum -c --strict - - tar -xzf cudnn-7.5-linux-x64-v5.1.tgz -C /usr/local - rm cudnn-7.5-linux-x64-v5.1.tgz - ldconfig - export PATH=/usr/local/cuda/bin:$PATH - apt-get purge -y aria2 +if [ ${WITH_GPU} == 'ON' ]; then + ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so /usr/lib/libcudnn.so fi -set -e + cd ~ git clone https://github.com/baidu/Paddle.git paddle cd paddle mkdir build cd build -cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON +cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON -DCUDNN_ROOT=/usr/ make -j `nproc` # because durning make install, there are several warning, so set +e, do not cause abort make install @@ -75,7 +37,6 @@ if [ ${WITH_DEMO} == "ON" ]; then fi if [ ${IS_DEVEL} == "OFF" ]; then # clean build packages. cd ~ - # TODO(yuyang18): Do clean for devel package, and cuda devel tools rm -rf paddle fi apt-get clean -y diff --git a/paddle/scripts/docker/cpu/Dockerfile b/paddle/scripts/docker/cpu/Dockerfile index ee96da4e68..c93e64a209 100644 --- a/paddle/scripts/docker/cpu/Dockerfile +++ b/paddle/scripts/docker/cpu/Dockerfile @@ -1,11 +1,9 @@ -FROM ubuntu:14.04 +FROM ubuntu/ubuntu:14.04 MAINTAINER PaddlePaddle Dev Team COPY build.sh /root/ -ENV LOWEST_DL_SPEED=0 ENV WITH_GPU=OFF ENV IS_DEVEL=OFF ENV WITH_DEMO=OFF ENV PIP_INSTALL_ARGS "" ENV PIP_GENERAL_ARGS "" -ENV CUDNN_DOWNLOAD_SUM 40d506d0a8a00a3faccce1433346806b8cd2535683b6f08a63683ce6e474419f RUN cd /root/ && bash build.sh diff --git a/paddle/scripts/docker/cpu/build.sh b/paddle/scripts/docker/cpu/build.sh index 8b2a2b8e81..3083afbe48 100644 --- a/paddle/scripts/docker/cpu/build.sh +++ b/paddle/scripts/docker/cpu/build.sh @@ -13,54 +13,16 @@ apt-get install -y cmake libprotobuf-dev protobuf-compiler git \ libgoogle-glog-dev libgflags-dev libatlas-dev libatlas3-base g++ m4 python-pip\ python-protobuf python-numpy python-dev swig -if [ ${WITH_GPU} == "ON" ]; then # install cuda - cd ~ - apt-get install -y aria2 wget - echo "Downloading cuda tookit" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 -s 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run - if [ $? -eq 0 ]; then - break - fi - done - - set -e - wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run.md5 - md5sum -c cuda_7.5.18_linux.run.md5 - chmod +x cuda_7.5.18_linux.run - ./cuda_7.5.18_linux.run --extract=$PWD - mv cuda-linux64-rel-7.5.18-*.run tmp - rm *.run *.run.md5 - mv tmp cuda-linux64.run - ./cuda-linux64.run -noprompt - rm *.run - - echo "Downloading cudnn v5.1" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-7.5-linux-x64-v5.1.tgz - if [ $? -eq 0 ]; then - break - fi - done - set -e - echo "$CUDNN_DOWNLOAD_SUM cudnn-7.5-linux-x64-v5.1.tgz" | sha256sum -c --strict - - tar -xzf cudnn-7.5-linux-x64-v5.1.tgz -C /usr/local - rm cudnn-7.5-linux-x64-v5.1.tgz - ldconfig - export PATH=/usr/local/cuda/bin:$PATH - apt-get purge -y aria2 +if [ ${WITH_GPU} == 'ON' ]; then + ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so /usr/lib/libcudnn.so fi -set -e + cd ~ git clone https://github.com/baidu/Paddle.git paddle cd paddle mkdir build cd build -cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON +cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON -DCUDNN_ROOT=/usr/ make -j `nproc` # because durning make install, there are several warning, so set +e, do not cause abort make install @@ -75,7 +37,6 @@ if [ ${WITH_DEMO} == "ON" ]; then fi if [ ${IS_DEVEL} == "OFF" ]; then # clean build packages. cd ~ - # TODO(yuyang18): Do clean for devel package, and cuda devel tools rm -rf paddle fi apt-get clean -y diff --git a/paddle/scripts/docker/generate.sh b/paddle/scripts/docker/generate.sh index 5040aa149d..ad63d0de14 100644 --- a/paddle/scripts/docker/generate.sh +++ b/paddle/scripts/docker/generate.sh @@ -2,26 +2,32 @@ set -e cd `dirname $0` m4 -DPADDLE_WITH_GPU=OFF -DPADDLE_IS_DEVEL=OFF -DPADDLE_WITH_DEMO=OFF \ + -DPADDLE_BASE_IMAGE=ubuntu/ubuntu:14.04\ Dockerfile.m4 > cpu/Dockerfile cp build.sh cpu/ m4 -DPADDLE_WITH_GPU=OFF -DPADDLE_IS_DEVEL=ON -DPADDLE_WITH_DEMO=OFF \ + -DPADDLE_BASE_IMAGE=ubuntu/ubuntu:14.04\ Dockerfile.m4 > cpu-devel/Dockerfile cp build.sh cpu-devel/ m4 -DPADDLE_WITH_GPU=OFF -DPADDLE_IS_DEVEL=ON -DPADDLE_WITH_DEMO=ON \ + -DPADDLE_BASE_IMAGE=ubuntu/ubuntu:14.04\ Dockerfile.m4 > cpu-demo/Dockerfile cp build.sh cpu-demo/ m4 -DPADDLE_WITH_GPU=ON -DPADDLE_IS_DEVEL=OFF -DPADDLE_WITH_DEMO=OFF \ + -DPADDLE_BASE_IMAGE=nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04 \ Dockerfile.m4 > gpu/Dockerfile cp build.sh gpu/ m4 -DPADDLE_WITH_GPU=ON -DPADDLE_IS_DEVEL=ON -DPADDLE_WITH_DEMO=OFF \ + -DPADDLE_BASE_IMAGE=nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04 \ Dockerfile.m4 > gpu-devel/Dockerfile cp build.sh gpu-devel/ m4 -DPADDLE_WITH_GPU=ON -DPADDLE_IS_DEVEL=ON -DPADDLE_WITH_DEMO=ON \ + -DPADDLE_BASE_IMAGE=nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04 \ Dockerfile.m4 > gpu-demo/Dockerfile cp build.sh gpu-demo/ diff --git a/paddle/scripts/docker/gpu-demo/Dockerfile b/paddle/scripts/docker/gpu-demo/Dockerfile index 018056373d..6e32117e92 100644 --- a/paddle/scripts/docker/gpu-demo/Dockerfile +++ b/paddle/scripts/docker/gpu-demo/Dockerfile @@ -1,11 +1,9 @@ -FROM ubuntu:14.04 +FROM nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04 MAINTAINER PaddlePaddle Dev Team COPY build.sh /root/ -ENV LOWEST_DL_SPEED=0 ENV WITH_GPU=ON ENV IS_DEVEL=ON ENV WITH_DEMO=ON ENV PIP_INSTALL_ARGS "" ENV PIP_GENERAL_ARGS "" -ENV CUDNN_DOWNLOAD_SUM 40d506d0a8a00a3faccce1433346806b8cd2535683b6f08a63683ce6e474419f RUN cd /root/ && bash build.sh diff --git a/paddle/scripts/docker/gpu-demo/build.sh b/paddle/scripts/docker/gpu-demo/build.sh index 8b2a2b8e81..3083afbe48 100644 --- a/paddle/scripts/docker/gpu-demo/build.sh +++ b/paddle/scripts/docker/gpu-demo/build.sh @@ -13,54 +13,16 @@ apt-get install -y cmake libprotobuf-dev protobuf-compiler git \ libgoogle-glog-dev libgflags-dev libatlas-dev libatlas3-base g++ m4 python-pip\ python-protobuf python-numpy python-dev swig -if [ ${WITH_GPU} == "ON" ]; then # install cuda - cd ~ - apt-get install -y aria2 wget - echo "Downloading cuda tookit" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 -s 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run - if [ $? -eq 0 ]; then - break - fi - done - - set -e - wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run.md5 - md5sum -c cuda_7.5.18_linux.run.md5 - chmod +x cuda_7.5.18_linux.run - ./cuda_7.5.18_linux.run --extract=$PWD - mv cuda-linux64-rel-7.5.18-*.run tmp - rm *.run *.run.md5 - mv tmp cuda-linux64.run - ./cuda-linux64.run -noprompt - rm *.run - - echo "Downloading cudnn v5.1" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-7.5-linux-x64-v5.1.tgz - if [ $? -eq 0 ]; then - break - fi - done - set -e - echo "$CUDNN_DOWNLOAD_SUM cudnn-7.5-linux-x64-v5.1.tgz" | sha256sum -c --strict - - tar -xzf cudnn-7.5-linux-x64-v5.1.tgz -C /usr/local - rm cudnn-7.5-linux-x64-v5.1.tgz - ldconfig - export PATH=/usr/local/cuda/bin:$PATH - apt-get purge -y aria2 +if [ ${WITH_GPU} == 'ON' ]; then + ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so /usr/lib/libcudnn.so fi -set -e + cd ~ git clone https://github.com/baidu/Paddle.git paddle cd paddle mkdir build cd build -cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON +cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON -DCUDNN_ROOT=/usr/ make -j `nproc` # because durning make install, there are several warning, so set +e, do not cause abort make install @@ -75,7 +37,6 @@ if [ ${WITH_DEMO} == "ON" ]; then fi if [ ${IS_DEVEL} == "OFF" ]; then # clean build packages. cd ~ - # TODO(yuyang18): Do clean for devel package, and cuda devel tools rm -rf paddle fi apt-get clean -y diff --git a/paddle/scripts/docker/gpu-devel/Dockerfile b/paddle/scripts/docker/gpu-devel/Dockerfile index 55c66882b7..2e34d96e15 100644 --- a/paddle/scripts/docker/gpu-devel/Dockerfile +++ b/paddle/scripts/docker/gpu-devel/Dockerfile @@ -1,11 +1,9 @@ -FROM ubuntu:14.04 +FROM nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04 MAINTAINER PaddlePaddle Dev Team COPY build.sh /root/ -ENV LOWEST_DL_SPEED=0 ENV WITH_GPU=ON ENV IS_DEVEL=ON ENV WITH_DEMO=OFF ENV PIP_INSTALL_ARGS "" ENV PIP_GENERAL_ARGS "" -ENV CUDNN_DOWNLOAD_SUM 40d506d0a8a00a3faccce1433346806b8cd2535683b6f08a63683ce6e474419f RUN cd /root/ && bash build.sh diff --git a/paddle/scripts/docker/gpu-devel/build.sh b/paddle/scripts/docker/gpu-devel/build.sh index 8b2a2b8e81..3083afbe48 100644 --- a/paddle/scripts/docker/gpu-devel/build.sh +++ b/paddle/scripts/docker/gpu-devel/build.sh @@ -13,54 +13,16 @@ apt-get install -y cmake libprotobuf-dev protobuf-compiler git \ libgoogle-glog-dev libgflags-dev libatlas-dev libatlas3-base g++ m4 python-pip\ python-protobuf python-numpy python-dev swig -if [ ${WITH_GPU} == "ON" ]; then # install cuda - cd ~ - apt-get install -y aria2 wget - echo "Downloading cuda tookit" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 -s 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run - if [ $? -eq 0 ]; then - break - fi - done - - set -e - wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run.md5 - md5sum -c cuda_7.5.18_linux.run.md5 - chmod +x cuda_7.5.18_linux.run - ./cuda_7.5.18_linux.run --extract=$PWD - mv cuda-linux64-rel-7.5.18-*.run tmp - rm *.run *.run.md5 - mv tmp cuda-linux64.run - ./cuda-linux64.run -noprompt - rm *.run - - echo "Downloading cudnn v5.1" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-7.5-linux-x64-v5.1.tgz - if [ $? -eq 0 ]; then - break - fi - done - set -e - echo "$CUDNN_DOWNLOAD_SUM cudnn-7.5-linux-x64-v5.1.tgz" | sha256sum -c --strict - - tar -xzf cudnn-7.5-linux-x64-v5.1.tgz -C /usr/local - rm cudnn-7.5-linux-x64-v5.1.tgz - ldconfig - export PATH=/usr/local/cuda/bin:$PATH - apt-get purge -y aria2 +if [ ${WITH_GPU} == 'ON' ]; then + ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so /usr/lib/libcudnn.so fi -set -e + cd ~ git clone https://github.com/baidu/Paddle.git paddle cd paddle mkdir build cd build -cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON +cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON -DCUDNN_ROOT=/usr/ make -j `nproc` # because durning make install, there are several warning, so set +e, do not cause abort make install @@ -75,7 +37,6 @@ if [ ${WITH_DEMO} == "ON" ]; then fi if [ ${IS_DEVEL} == "OFF" ]; then # clean build packages. cd ~ - # TODO(yuyang18): Do clean for devel package, and cuda devel tools rm -rf paddle fi apt-get clean -y diff --git a/paddle/scripts/docker/gpu/Dockerfile b/paddle/scripts/docker/gpu/Dockerfile index cb62cb4713..2dd678d55a 100644 --- a/paddle/scripts/docker/gpu/Dockerfile +++ b/paddle/scripts/docker/gpu/Dockerfile @@ -1,11 +1,9 @@ -FROM ubuntu:14.04 +FROM nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04 MAINTAINER PaddlePaddle Dev Team COPY build.sh /root/ -ENV LOWEST_DL_SPEED=0 ENV WITH_GPU=ON ENV IS_DEVEL=OFF ENV WITH_DEMO=OFF ENV PIP_INSTALL_ARGS "" ENV PIP_GENERAL_ARGS "" -ENV CUDNN_DOWNLOAD_SUM 40d506d0a8a00a3faccce1433346806b8cd2535683b6f08a63683ce6e474419f RUN cd /root/ && bash build.sh diff --git a/paddle/scripts/docker/gpu/build.sh b/paddle/scripts/docker/gpu/build.sh index 8b2a2b8e81..3083afbe48 100644 --- a/paddle/scripts/docker/gpu/build.sh +++ b/paddle/scripts/docker/gpu/build.sh @@ -13,54 +13,16 @@ apt-get install -y cmake libprotobuf-dev protobuf-compiler git \ libgoogle-glog-dev libgflags-dev libatlas-dev libatlas3-base g++ m4 python-pip\ python-protobuf python-numpy python-dev swig -if [ ${WITH_GPU} == "ON" ]; then # install cuda - cd ~ - apt-get install -y aria2 wget - echo "Downloading cuda tookit" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 -s 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run - if [ $? -eq 0 ]; then - break - fi - done - - set -e - wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run.md5 - md5sum -c cuda_7.5.18_linux.run.md5 - chmod +x cuda_7.5.18_linux.run - ./cuda_7.5.18_linux.run --extract=$PWD - mv cuda-linux64-rel-7.5.18-*.run tmp - rm *.run *.run.md5 - mv tmp cuda-linux64.run - ./cuda-linux64.run -noprompt - rm *.run - - echo "Downloading cudnn v5.1" - set +e - for ((i=0; i<100; i++)) - do - aria2c -x 10 --lowest-speed-limit=${LOWEST_DL_SPEED} http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-7.5-linux-x64-v5.1.tgz - if [ $? -eq 0 ]; then - break - fi - done - set -e - echo "$CUDNN_DOWNLOAD_SUM cudnn-7.5-linux-x64-v5.1.tgz" | sha256sum -c --strict - - tar -xzf cudnn-7.5-linux-x64-v5.1.tgz -C /usr/local - rm cudnn-7.5-linux-x64-v5.1.tgz - ldconfig - export PATH=/usr/local/cuda/bin:$PATH - apt-get purge -y aria2 +if [ ${WITH_GPU} == 'ON' ]; then + ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so /usr/lib/libcudnn.so fi -set -e + cd ~ git clone https://github.com/baidu/Paddle.git paddle cd paddle mkdir build cd build -cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON +cmake .. -DWITH_DOC=OFF -DWITH_GPU=${WITH_GPU} -DWITH_SWIG_PY=ON -DCUDNN_ROOT=/usr/ make -j `nproc` # because durning make install, there are several warning, so set +e, do not cause abort make install @@ -75,7 +37,6 @@ if [ ${WITH_DEMO} == "ON" ]; then fi if [ ${IS_DEVEL} == "OFF" ]; then # clean build packages. cd ~ - # TODO(yuyang18): Do clean for devel package, and cuda devel tools rm -rf paddle fi apt-get clean -y -- GitLab