This repository provides a step-by-step guide to set up ROS 2 Iron Irwini with Gazebo Garden inside Docker on WSL2, with full NVIDIA GPU acceleration.
wsl --install -d Ubuntu-22.04
wsl
docker --version
Expected output:
Docker version X.XX.XX, build XXXXXXX
Run the following inside WSL:
sudo apt update && sudo apt upgrade -y
bash scripts/install_nvidia_wsl.sh
cd docker
docker build -t ros2-iron-gazebo-gpu .
docker-compose up -d
docker attach ros2-gpu-container
Inside the container, run:
nvidia-smi
glxinfo -B
Expected output:
nvidia-smi
should detect the GPU.glxinfo -B
should show OpenGL renderer string: NVIDIA
.Start Gazebo inside the container:
source /opt/ros/iron/setup.bash
gz sim -s /usr/share/gz/gz-sim7/worlds/empty.sdf -r -v 4 & gz sim -g &
While Gazebo is open, run:
nvidia-smi
Expected output:
Check TROUBLESHOOTING.md for common issues.
MIT License - see LICENSE for details.