Skip to content

Commit

Permalink
Merge pull request #2929 from JdeRobot/dph/windows_gpu_dev_docs
Browse files Browse the repository at this point in the history
Update GPU acceleration docs for devs
  • Loading branch information
javizqh authored Jan 8, 2025
2 parents 81a0821 + c49f8d6 commit 9d427a6
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions docs/gpu_acceleration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,30 @@ ROS and Gazebo can be accelerated within RoboticsAcademy thanks to VirtualGL if
## Linux

### Auto
If the PC has several GPUs, it will select them in order: NVIDIA, Intel, Only CPU.
If the PC has several GPUs, it will select them in order: NVIDIA, Intel, Only CPU.
```
docker run --rm -it $(nvidia-smi >/dev/null 2>&1 && echo "--gpus all" || echo "") --device /dev/dri -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-backend
docker run --rm -it $(nvidia-smi >/dev/null 2>&1 && echo "--gpus all" || echo "") --device /dev/dri -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 --link academy_db jderobot/robotics-academy:latest
```


### Intel
For Linux machines and Intel GPUs, acceleration can be achieved by simply setting the ```--device``` argument when running the Docker container:
```
docker run --rm -it --device /dev/dri -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-backend
docker run --rm -it --device /dev/dri -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 --link academy_db jderobot/robotics-academy:latest
```

### NVIDIA
For NVIDIA GPUs, acceleration can be achieved by [installing the nvidia-container-runtime package](https://docs.docker.com/config/containers/resource_constraints/#gpu), and then running the command above, but adding the ```--gpus all``` flag:
```
docker run --rm -it --gpus all --device /dev/dri -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-backend
docker run --rm -it --gpus all --device /dev/dri -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 --link academy_db jderobot/robotics-academy:latest
```

## Windows
Pending validation.
For Windows machines, acceleration can be achieved for NVIDIA GPUs if a valid CUDA installation is available. Useful docs for proper installation of WSL2 + CUDA + Docker Desktop:
- [WSL2 + CUDA](https://learn.microsoft.com/en-us/windows/ai/directml/gpu-cuda-in-wsl)
- [WSL2 + Docker Desktop](https://docs.docker.com/desktop/features/wsl/)

Once these requirements are ready, you should be able to run Robotics Academy with GPU acceleration as follows:
```
docker run --rm -it --gpus all -v /usr/lib/wsl:/usr/lib/wsl -e LD_LIBRARY_PATH=/usr/lib/wsl/lib --device /dev/dri -p 6080:6080 -p 1108:1108 -p 7163:7163 -p 7164:7164 --link academy_db jderobot/robotics-academy:latest
```

0 comments on commit 9d427a6

Please sign in to comment.