ros2 / rviz

ROS 3D Robot Visualizer
BSD 3-Clause Clear License
296 stars 212 forks source link

RVIZ2 not using GPU #1221

Open ryan-roche opened 3 months ago

ryan-roche commented 3 months ago

I'm running RVIZ2 inside a docker container with GPU enabled. The container is running on the docker engine installed inside WSL2 (I manually installed the docker engine inside the WSL2 VM as I was not able to get my GPU working with Docker Desktop on Windows).

nvidia-smi and glxgears work inside the container, so the GPU driver is properly "exposing" itself to the container. However, RVIZ runs slowly and nvidia-smi does not show it in the process list. The only process reported by nvidia-smi as using the GPU (even when RVIZ is running) is XWayland. SOS!!!

pgrwe commented 2 months ago

Running Linux docker containers on Windows without WSL2 is not supported, but you appear to have solved that issue. 👍🏾

You can force an application to run using the nvidia gpu by using Nvidia's PRIME on linux. Is there a specific reason you want to run rviz in a container? If you need reproducibility it may be simpler to write a setup script.

Takayuki9999 commented 3 weeks ago

This question on StackExchange is helpful. I had the same problem, but I solved it. I followed the answer in that question and added additional options to docker and then Rviz2 started using the GPU.