Skip to content

Commit 5e55089

Browse files
authored
Merge pull request #1699 from gangliao/cuda8.0
[Done] Upgrade CUDA 8.0 in Docker
2 parents 1bca3cf + 194a3b8 commit 5e55089

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# A image for building paddle binaries
22
# Use cuda devel base image for both cpu and gpu environment
3-
FROM nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04
3+
FROM nvidia/cuda:8.0-cudnn5-devel-ubuntu14.04
44
MAINTAINER PaddlePaddle Authors <[email protected]>
55

66
ARG UBUNTU_MIRROR

cmake/cudnn.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ list(APPEND CUDNN_CHECK_LIBRARY_DIRS
1111
${CUDNN_ROOT}
1212
${CUDNN_ROOT}/lib64
1313
${CUDNN_ROOT}/lib
14+
${CUDNN_ROOT}/lib/x86_64-linux-gnu
1415
$ENV{CUDNN_ROOT}
1516
$ENV{CUDNN_ROOT}/lib64
1617
$ENV{CUDNN_ROOT}/lib

doc/getstarted/build_and_install/docker_install_cn.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ PaddlePaddle发布的docker镜像使用说明
5757
5858
如果输出是No,就需要选择使用no-AVX的镜像
5959

60-
注意:在运行GPU版本的镜像时 安装CUDA驱动,以及告诉Docker:
60+
以上方法在GPU镜像里也能用,只是请不要忘记提前在物理机上安装GPU最新驱动。
61+
为了保证GPU驱动能够在镜像里面正常运行,我们推荐使用[nvidia-docker](https://github.com/NVIDIA/nvidia-docker)来运行镜像。
62+
63+
.. code-block:: bash
64+
65+
nvidia-docker run -it --rm paddledev/paddle:0.10.0rc1-gpu /bin/bash
66+
67+
注意: 如果使用nvidia-docker存在问题,你也许可以尝试更老的方法,具体如下,但是我们并不推荐这种方法。:
6168

6269
.. code-block:: bash
6370

doc/getstarted/build_and_install/docker_install_en.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,15 @@ latest versions under "tags" tab at dockerhub.com.
7979
8080
If it doesn't, we will use the non-AVX images.
8181
82-
Notice please don't forget
83-
to install CUDA driver and let Docker knows about it:
82+
Above methods work with the GPU image too -- just please don't forget
83+
to install GPU driver. To support GPU driver, we recommend to use
84+
[nvidia-docker](https://github.com/NVIDIA/nvidia-docker). Run using
85+
86+
.. code-block:: bash
87+
88+
nvidia-docker run -it --rm paddledev/paddle:0.10.0rc1-gpu /bin/bash
89+
90+
Note: If you would have a problem running nvidia-docker, you may try the old method we have used (not recommended).
8491

8592
.. code-block:: bash
8693

paddle/scripts/docker/build.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@ set -e
44

55
# Set BASE_IMAGE according to env variables
66
if [ ${WITH_GPU} == "ON" ]; then
7-
BASE_IMAGE="nvidia/cuda:7.5-cudnn5-runtime-ubuntu14.04"
7+
BASE_IMAGE="nvidia/cuda:8.0-cudnn5-runtime-ubuntu14.04"
88
# additional packages to install when building gpu images
99
GPU_DOCKER_PKG="python-pip python-dev"
1010
else
1111
BASE_IMAGE="python:2.7.13-slim"
1212
fi
1313

1414
DOCKERFILE_GPU_ENV=""
15+
DOCKERFILE_CUDNN_DSO=""
1516
if [[ ${WITH_GPU:-OFF} == 'ON' ]]; then
1617
DOCKERFILE_GPU_ENV="ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}"
17-
18-
# for cmake to find cudnn
19-
ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so /usr/lib/libcudnn.so
18+
DOCKERFILE_CUDNN_DSO="RUN ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.5 /usr/lib/x86_64-linux-gnu/libcudnn.so"
2019
fi
2120

2221
mkdir -p /paddle/build
@@ -95,7 +94,10 @@ RUN ${MIRROR_UPDATE}
9594
# Use different deb file when building different type of images
9695
ADD build/*.deb /usr/local/opt/paddle/deb/
9796
# run paddle version to install python packages first
98-
RUN dpkg -i /usr/local/opt/paddle/deb/*.deb && rm -f /usr/local/opt/paddle/deb/*.deb && paddle version
97+
RUN dpkg -i /usr/local/opt/paddle/deb/*.deb && \
98+
rm -f /usr/local/opt/paddle/deb/*.deb && \
99+
paddle version
100+
${DOCKERFILE_CUDNN_DSO}
99101
${DOCKERFILE_GPU_ENV}
100102
# default command shows the paddle version and exit
101103
CMD ["paddle", "version"]

0 commit comments

Comments
 (0)