Skip to content

Commit 83bf96a

Browse files
authored
docker GPU Api Update (#5340)
* rm unnecessary pronouns * Update basic_usage_cn.md * rm Macos GPU docker * Update macos-docker_en.md * Update macos-docker.md * rm unnecessary pronouns * Update grammar_list_cn.md * fix format * Update case_analysis_cn.md * add GPU architecture comparison table link * Update windows-pip.md * Update windows-pip_en.md * Update linux-pip.md * Update linux-pip_en.md * fix format docs * fix url lose * [docs] fix paddle.CUDAPlace Parameter error * Update CUDAPlace_cn.rst * [docs] fix Synchronous English documentation * Update take_along_axis_cn.rst * [dosc] Supplementary index description: * ipu_shard_guard_cn.rst * set_ipu_shard_cn.rst Modify note Format: * mlu_places_cn.rst * [docs] fix note、returns format * fix put_along_axis_cn.rst returns format * fix ipu_shard_guard_cn.rst note format * fix mlu_places_cn.rst note format * fix set_ipu_shard_cn.rst note format * [docs] update docker-gpu api * [docs] add Parameter interpretation
1 parent d24af7e commit 83bf96a

File tree

1 file changed

+38
-7
lines changed

1 file changed

+38
-7
lines changed

docs/install/docker/linux-docker.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,41 @@
88

99
- 在本地主机上[安装 Docker](https://hub.docker.com/search/?type=edition&offering=community)
1010

11-
- 如需在 Linux 开启 GPU 支持,请[安装 nvidia-docker](https://github.com/NVIDIA/nvidia-docker)
11+
- 如需在 Linux 开启 GPU 支持, 需提前[安装 nvidia-container-toolkit](https://github.com/NVIDIA/nvidia-docker)
12+
* 请通过 docker -v 检查 Docker 版本。对于 19.03 之前的版本,您需要使用 nvidia-docker 和 nvidia-docker 命令;对于 19.03 及之后的版本,您将需要使用 nvidia-container-toolkit 软件包和 --gpus all 命令。这两个选项都记录在上面链接的网页上。
13+
14+
注 nvidia-container-toolkit 安装方法:
15+
* Ubuntu 系统可以参考以下命令
16+
* 添加存储库和密钥
17+
```bash
18+
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
19+
&& curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \
20+
&& curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
21+
```
22+
* 安装 nvidia-container-toolkit
23+
```bash
24+
sudo apt update
25+
sudo apt install nvidia-container-toolkit
26+
```
27+
* 重启 docker
28+
```bash
29+
sudo systemctl restart docker
30+
```
31+
* centos 系统可以参考以下命令
32+
* 添加存储库和密钥
33+
```bash
34+
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
35+
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | sudo tee /etc/yum.repos.d/nvidia-docker.repo
36+
```
37+
* 安装 nvidia-container-toolkit
38+
```bash
39+
sudo yun update
40+
sudo yum install -y nvidia-container-toolkit
41+
```
42+
* 重启 docker
43+
```bash
44+
sudo systemctl restart docker
45+
```
1246

1347
## 安装步骤
1448

@@ -56,8 +90,6 @@
5690

5791
* 使用 CPU 版本的 PaddlePaddle:
5892

59-
60-
6193
```
6294
docker run --name [Name of container] -it -v $PWD:/paddle <imagename> /bin/bash
6395
```
@@ -101,17 +133,16 @@
101133
* 使用 GPU 版本的 PaddlePaddle:
102134

103135

104-
105136
```
106-
nvidia-docker run --name [Name of container] -it -v $PWD:/paddle <imagename> /bin/bash
137+
docker run --gpus all --name [Name of container] -it -v $PWD:/paddle <imagename> /bin/bash
107138
```
108139

109-
> --name [Name of container] 设定 Docker 的名称;
140+
> --gpus 指定 gpu 设备 ('"device=0,2"':代表使用 0 和 2 号 GPU; all: 代表使用所有 GPU), 可以参考[Docker 官方文档](https://docs.docker.com/engine/reference/commandline/run/#access-an-nvidia-gpu);
110141

142+
> --name [Name of container] 设定 Docker 的名称;
111143

112144
> -it 参数说明容器已和本机交互式运行;
113145

114-
115146
> -v $PWD:/paddle 指定将当前路径(PWD 变量会展开为当前路径的绝对路径)挂载到容器内部的 /paddle 目录;
116147

117148
> `<imagename>` 指定需要使用的 image 名称,您可以通过`docker images`命令查看;/bin/bash 是在 Docker 中要执行的命令

0 commit comments

Comments
 (0)