Gazebo | Ignition | Community
Ask Your Question

Gazebo doesn't use GPU when run inside a container

asked 2020-08-24 02:22:01 -0500

shantia gravatar image

Hi Everyone, I have set up a singularity container (Ubuntu 16.04, Ros Kinetic, Gazebo 7.16), and I am running it on an HPC(high performance computing cluster). Everything is set up, I have access to Nvidia libraries, I can run OpenGL apps, and I also have CUDA. However, the gzserver and gzclient process refuse to use the GPU. This means that my robot's laser and camera render is stuck to 2 and 7 Hz. Does anyone know how can I force it? It is notable that the gazebo uses the GPU when I run the container on my own PC with Ubuntu 20.04 as a host. Any suggestions are welcome.

edit retag flag offensive close merge delete


Di you solve your issue? I am sort of struggling with the same.

Basti gravatar imageBasti ( 2021-03-16 04:57:15 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2022-08-24 05:21:42 -0500

Tomas gravatar image

I have a similar problem when running Ignition Gazebo on a remote machine over ssh. GPU is utilized only if a user is logged in and the docker is passed the existing display (although I run Gazebo headless). Any ideas?

edit flag offensive delete link more

answered 2021-03-29 14:39:16 -0500

HuguesTHOMAS gravatar image

updated 2022-03-25 15:06:30 -0500

I have the same issue. I run ROS/gazebo in a docker container that runs on a remote computer (Ubuntu 18.04). The docker image is based on "", and has ROS Melodic, Gazebo 9.16 installed. Except for Gazebo, I can run other OpenGL/CUDA apps, I can even train neural networks on the GPU. But Gazebo won't use the GPU.

Another detail that could help the resolution: I have physical access to the remote machine, so I can run my code on it without ssh. When I do that, gazebo uses the GPU correctly.

Anyone have found a solution to fix this?


It seems that gazebo server will not run on GPU if the $DISPLAY environment variable is not set to ":0".

Before running gazebo, execute:

export DISPLAY=:0

If you need to run other X applications through ssh (like RVIZ for example), reexport the right DISPLAY after gazebo has been launched

edit flag offensive delete link more

answered 2021-06-22 20:16:38 -0500

Have you installed the nvidia docker container toolkit?

edit flag offensive delete link more

Question Tools



Asked: 2020-08-24 02:22:01 -0500

Seen: 4,514 times

Last updated: Aug 24 '22