Skip to content

Commit a3a7e76

Browse files
committed
Respond to Helin's comments
1 parent 74bcf34 commit a3a7e76

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

doc/build/docker_install.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,42 @@ For each version of PaddlePaddle, we release 4 variants of Docker images:
2020
| gpu-noavx | no | yes |
2121
+-----------------+-------------+-------+
2222

23-
The following command line detects if your CPU supports :code:`AVX`.
23+
We run the following command on Linux to check if the CPU supports :code:`AVX`.
2424

25-
.. code-block:: bash
25+
.. code-block:: bash
26+
27+
if cat /proc/cpuinfo | grep -i avx; then echo Yes; else echo No; fi
28+
29+
On Mac OS X, we need to run
30+
31+
.. code-block:: bash
2632
27-
if cat /proc/cpuinfo | grep -q avx ; then echo "Support AVX"; else echo "Not support AVX"; fi
33+
sysctl -a | grep machdep.cpu.leaf7_features
2834
2935
3036
Once we determine the proper variant, we can cope with the Docker image tag name by appending the version number. For example, the following command runs the AVX-enabled image of the most recent version:
3137

32-
.. code-block:: bash
38+
.. code-block:: bash
3339
3440
docker run -it --rm paddledev/paddle:cpu-latest /bin/bash
3541
3642
To run a GPU-enabled image, you need to install CUDA and let Docker knows about it:
3743

38-
.. code-block:: bash
44+
.. code-block:: bash
3945
4046
export CUDA_SO="$(\ls /usr/lib64/libcuda* | xargs -I{} echo '-v {}:{}') $(\ls /usr/lib64/libnvidia* | xargs -I{} echo '-v {}:{}')"
4147
export DEVICES=$(\ls /dev/nvidia* | xargs -I{} echo '--device {}:{}')
4248
docker run ${CUDA_SO} ${DEVICES} -it paddledev/paddle:gpu-latest
4349
4450
The default entry point of all our Docker images starts the OpenSSH server. To run PaddlePaddle and to expose OpenSSH port to 2202 on the host computer:
4551

46-
.. code-block:: bash
52+
.. code-block:: bash
4753
4854
docker run -d -p 2202:22 paddledev/paddle:cpu-latest
4955
5056
Then we can login to the container using username :code:`root` and password :code:`root`:
5157

52-
.. code-block:: bash
58+
.. code-block:: bash
5359
5460
ssh -p 2202 root@localhost
5561

paddle/scripts/docker/Dockerfile.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ MAINTAINER PaddlePaddle Dev Team <paddle-dev@baidu.com>
44
# It is good to run apt-get install with Dockerfile RUN directive,
55
# because if the following invocation to /root/build.sh fails, `docker
66
# build` wouldn't have to re-install packages after we fix
7-
# /root/build.sh.
7+
# /root/build.sh. For more about Docker build cache, please refer to
8+
# https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#/build-cache.
89
RUN apt-get update && \
910
apt-get install -y cmake libprotobuf-dev protobuf-compiler git \
1011
libgoogle-glog-dev libgflags-dev libatlas-dev libatlas3-base g++ m4 python-pip \

0 commit comments

Comments
 (0)