diff --git a/Dockerfile b/Dockerfile index ccd43be668e7acb1a82bb88f5938755a5d3974d1..c4502e863f2d9fb771f88218a795a44283818186 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # A image for building paddle binaries # Use cuda devel base image for both cpu and gpu environment -FROM nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04 +FROM nvidia/cuda:8.0-cudnn5-devel-ubuntu14.04 MAINTAINER PaddlePaddle Authors ARG UBUNTU_MIRROR diff --git a/cmake/cudnn.cmake b/cmake/cudnn.cmake index e5b59be19369d3ba3e852624426b95ae365e7357..5754407d66c18872bf0cf314ee6e0a32e0d4329d 100644 --- a/cmake/cudnn.cmake +++ b/cmake/cudnn.cmake @@ -11,6 +11,7 @@ list(APPEND CUDNN_CHECK_LIBRARY_DIRS ${CUDNN_ROOT} ${CUDNN_ROOT}/lib64 ${CUDNN_ROOT}/lib + ${CUDNN_ROOT}/lib/x86_64-linux-gnu $ENV{CUDNN_ROOT} $ENV{CUDNN_ROOT}/lib64 $ENV{CUDNN_ROOT}/lib diff --git a/doc/getstarted/build_and_install/docker_install_cn.rst b/doc/getstarted/build_and_install/docker_install_cn.rst index eb6e40082804fa97ed307131a68a39592ba88050..22db1ef658ca35f0ab18895c1da1003bd3cd93fa 100644 --- a/doc/getstarted/build_and_install/docker_install_cn.rst +++ b/doc/getstarted/build_and_install/docker_install_cn.rst @@ -57,7 +57,14 @@ PaddlePaddle发布的docker镜像使用说明 如果输出是No,就需要选择使用no-AVX的镜像 - 注意:在运行GPU版本的镜像时 安装CUDA驱动,以及告诉Docker: + 以上方法在GPU镜像里也能用,只是请不要忘记提前在物理机上安装GPU最新驱动。 + 为了保证GPU驱动能够在镜像里面正常运行,我们推荐使用[nvidia-docker](https://github.com/NVIDIA/nvidia-docker)来运行镜像。 + + .. code-block:: bash + + nvidia-docker run -it --rm paddledev/paddle:0.10.0rc1-gpu /bin/bash + + 注意: 如果使用nvidia-docker存在问题,你也许可以尝试更老的方法,具体如下,但是我们并不推荐这种方法。: .. code-block:: bash diff --git a/doc/getstarted/build_and_install/docker_install_en.rst b/doc/getstarted/build_and_install/docker_install_en.rst index 0df8508ace6ac8e148351dcd87b499a38a36b7a7..f43e83d1297637a84f8a8bd581d1ab94089efc28 100644 --- a/doc/getstarted/build_and_install/docker_install_en.rst +++ b/doc/getstarted/build_and_install/docker_install_en.rst @@ -79,8 +79,15 @@ latest versions under "tags" tab at dockerhub.com. If it doesn't, we will use the non-AVX images. - Notice please don't forget - to install CUDA driver and let Docker knows about it: + Above methods work with the GPU image too -- just please don't forget + to install GPU driver. To support GPU driver, we recommend to use + [nvidia-docker](https://github.com/NVIDIA/nvidia-docker). Run using + + .. code-block:: bash + + nvidia-docker run -it --rm paddledev/paddle:0.10.0rc1-gpu /bin/bash + + Note: If you would have a problem running nvidia-docker, you may try the old method we have used (not recommended). .. code-block:: bash diff --git a/paddle/scripts/docker/build.sh b/paddle/scripts/docker/build.sh index a0da561dfe962b7a0a0515d4104940175ebdecad..e6ed01428a63b9c55bf6ec299ea1c8bff71f3b65 100644 --- a/paddle/scripts/docker/build.sh +++ b/paddle/scripts/docker/build.sh @@ -4,7 +4,7 @@ set -e # Set BASE_IMAGE according to env variables if [ ${WITH_GPU} == "ON" ]; then - BASE_IMAGE="nvidia/cuda:7.5-cudnn5-runtime-ubuntu14.04" + BASE_IMAGE="nvidia/cuda:8.0-cudnn5-runtime-ubuntu14.04" # additional packages to install when building gpu images GPU_DOCKER_PKG="python-pip python-dev" else @@ -12,11 +12,10 @@ else fi DOCKERFILE_GPU_ENV="" +DOCKERFILE_CUDNN_DSO="" if [[ ${WITH_GPU:-OFF} == 'ON' ]]; then DOCKERFILE_GPU_ENV="ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}" - - # for cmake to find cudnn - ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so /usr/lib/libcudnn.so + DOCKERFILE_CUDNN_DSO="RUN ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.5 /usr/lib/x86_64-linux-gnu/libcudnn.so" fi mkdir -p /paddle/build @@ -95,7 +94,10 @@ RUN ${MIRROR_UPDATE} # Use different deb file when building different type of images ADD build/*.deb /usr/local/opt/paddle/deb/ # run paddle version to install python packages first -RUN dpkg -i /usr/local/opt/paddle/deb/*.deb && rm -f /usr/local/opt/paddle/deb/*.deb && paddle version +RUN dpkg -i /usr/local/opt/paddle/deb/*.deb && \ + rm -f /usr/local/opt/paddle/deb/*.deb && \ + paddle version +${DOCKERFILE_CUDNN_DSO} ${DOCKERFILE_GPU_ENV} # default command shows the paddle version and exit CMD ["paddle", "version"]