|
8 | 8 |
|
9 | 9 | - On the local host [Install Docker](https://hub.docker.com/search/?type=edition&offering=community) |
10 | 10 |
|
11 | | -- To enable GPU support on Linux, please [Install nvidia-docker](https://github.com/NVIDIA/nvidia-docker) |
| 11 | +- To enable GPU support on Linux, please [Install nvidia-container-toolkit](https://github.com/NVIDIA/nvidia-docker) and [GPU driver](https://docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html) |
| 12 | + |
| 13 | + * Please check the Docker version with docker -v. For versions prior to 19.03, You need to use the nvidia-docker and nvidia-docker commands; For versions 19.03 and later, you will need to use the nvidia-container-toolkit package and the --gpus all command. Both of these options are documented on the page linked above. |
| 14 | + |
| 15 | +Note nvidia-container-toolkit installation method: |
| 16 | + * Ubuntu |
| 17 | + * Adding Repositories and Keys |
| 18 | + ```bash |
| 19 | + distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \ |
| 20 | + && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \ |
| 21 | + && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list |
| 22 | + ``` |
| 23 | + * install nvidia-container-toolkit |
| 24 | + ```bash |
| 25 | + sudo apt update |
| 26 | + sudo apt install nvidia-container-toolkit |
| 27 | + ``` |
| 28 | + * restart docker |
| 29 | + ```bash |
| 30 | + sudo systemctl restart docker |
| 31 | + ``` |
| 32 | + * Centos |
| 33 | + * Adding Repositories and Keys |
| 34 | + ```bash |
| 35 | + distribution=$(. /etc/os-release;echo $ID$VERSION_ID) |
| 36 | + curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | sudo tee /etc/yum.repos.d/nvidia-docker.repo |
| 37 | + ``` |
| 38 | + * install nvidia-container-toolkit |
| 39 | + ```bash |
| 40 | + sudo yun update |
| 41 | + sudo yum install -y nvidia-container-toolkit |
| 42 | + ``` |
| 43 | + * restart docker |
| 44 | + ```bash |
| 45 | + sudo systemctl restart docker |
| 46 | + ``` |
12 | 47 |
|
13 | 48 | ## Installation steps |
14 | 49 |
|
|
78 | 113 |
|
79 | 114 |
|
80 | 115 | ``` |
81 | | - nvidia-docker run --name [Name of container] -it -v $PWD:/paddle <imagename> /bin/bash |
| 116 | + docker run --gpus all --name [Name of container] -it -v $PWD:/paddle <imagename> /bin/bash |
82 | 117 | ``` |
83 | 118 |
|
| 119 | + > --gpus Specify the gpu device ('"device=0,2"':Represents the use of GPUs 0 and 2; all: Represents the use of all GPUs), please see [Docker docs](https://docs.docker.com/engine/reference/commandline/run/#access-an-nvidia-gpu); |
| 120 | + |
84 | 121 | > --name [Name of container] set name of Docker; |
85 | 122 |
|
86 | 123 |
|
|
0 commit comments