Skip to content

Commit

Permalink
[Fix]: add '--gpu all' args to enable gpu in container (PaddlePaddle#…
Browse files Browse the repository at this point in the history
…6499)

* fix docker relative doc when build from source

* [fix]: add '--gpu all' args to enable gpu in container
  • Loading branch information
cocoshe authored Feb 6, 2024
1 parent ea27c61 commit bbb22c5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
6 changes: 4 additions & 2 deletions docs/install/compile/linux-compile-by-make.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ cd Paddle
用从百度拉取的镜像创建容器
```
docker run --name paddle-test -v $PWD:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
docker run --gpus all --name paddle-test -v $PWD:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
```
- `--gpus all`: 在 Docker 容器中允许使用 gpu;
- `--name paddle-test`:为您创建的 Docker 容器命名为 paddle-test;
- `-v $PWD:/paddle`: 将当前目录挂载到 Docker 容器中的/paddle 目录下(Linux 中 PWD 变量会展开为当前路径的[绝对路径](https://baike.baidu.com/item/绝对路径/481185));
Expand All @@ -123,7 +125,7 @@ cd Paddle
若使用的是从 DockerHub 拉取的镜像创建容器,则修改镜像名即可:
```
docker run --name paddle-test -v $PWD:/paddle --network=host -it paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
docker run --gpus all --name paddle-test -v $PWD:/paddle --network=host -it paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
```
注意:
Expand Down
6 changes: 4 additions & 2 deletions docs/install/compile/linux-compile-by-make_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,11 @@ You can see [DockerHub](https://hub.docker.com/r/paddlepaddle/paddle/tags/) to g
Using the image pulled from Baidu.
```
docker run --name paddle-test -v $PWD:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
docker run --gpus all --name paddle-test -v $PWD:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
```
- `--gpus all`: gpu resources can be used in Docker container;
- `--name paddle-test`: names the Docker container you created as paddle-test;
Expand All @@ -129,7 +131,7 @@ You can see [DockerHub](https://hub.docker.com/r/paddlepaddle/paddle/tags/) to g
If you are using the image pulled from DockerHub, just modify the image name.
```
docker run --name paddle-test -v $PWD:/paddle --network=host -it paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
docker run --gpus all --name paddle-test -v $PWD:/paddle --network=host -it paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
```
Note:
Expand Down
6 changes: 4 additions & 2 deletions docs/install/compile/linux-compile-by-ninja.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ cd Paddle
用从百度拉取的镜像创建容器
```
docker run --name paddle-test -v $PWD:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
docker run --gpus all --name paddle-test -v $PWD:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
```
- `--gpus all`: 在 Docker 容器中允许使用 gpu;
- `--name paddle-test`:为您创建的 Docker 容器命名为 paddle-test;
- `-v $PWD:/paddle`: 将当前目录挂载到 Docker 容器中的/paddle 目录下(Linux 中 PWD 变量会展开为当前路径的[绝对路径](https://baike.baidu.com/item/绝对路径/481185));
Expand All @@ -123,7 +125,7 @@ cd Paddle
若使用的是从 DockerHub 拉取的镜像创建容器,则修改镜像名即可:
```
docker run --name paddle-test -v $PWD:/paddle --network=host -it paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
docker run --gpus all --name paddle-test -v $PWD:/paddle --network=host -it paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
```
注意:
Expand Down
4 changes: 3 additions & 1 deletion docs/install/docker/linux-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@
* 使用 GPU 版本的 PaddlePaddle:
```
docker run --name paddle_docker -v $PWD:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
docker run --gpus all --name paddle_docker -v $PWD:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
```
- `--gpus all`: 在 Docker 容器中允许使用 gpu;
- `--name paddle_docker`:设定 Docker 的名称,`paddle_docker` 是自己设置的名称;
Expand Down
4 changes: 3 additions & 1 deletion docs/install/docker/linux-docker_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ You can see [DockerHub](https://hub.docker.com/r/paddlepaddle/paddle/tags/) to g
```
docker run --name paddle_docker -v $PWD:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
docker run --gpus all --name paddle_docker -v $PWD:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:latest-dev-cuda12.0-cudnn8.9-trt8.6-gcc12.2 /bin/bash
```
- `--gpus all`: gpu resources can be used in Docker container;
- `--name paddle_docker`: set name of Docker, `paddle_docker` is name of docker you set;
Expand Down

0 comments on commit bbb22c5

Please sign in to comment.