Ask Your Question

Segmentation fault when running rviz on docker

asked 2022-01-22 06:00:36 -0500

petal gravatar image

updated 2022-01-22 16:13:43 -0500


I am trying to run rviz on docker for ros-kinetic but as soon as it connects to ros master (i.e. after running roscore), the window shuts down and gives segmentation fault

Precisely this error:

[ INFO] [1642852163.241325570]: rviz version 1.12.17
[ INFO] [1642852163.241360320]: compiled against Qt version 5.5.1
[ INFO] [1642852163.241370195]: compiled against OGRE version 1.9.0 (Ghadamon)
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
Segmentation fault (core dumped)

I tried various solutions but could not get it working ( particularly from here )

My docker file is here:

and I use this script to run it :

Update 1: Even though my docker image is cuda based when I run nvidia-smi it gives

bash: nvidia-smi: command not found

If I put --gpus all in docker run command I get the error

docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].

P.S. In case it is relevant earlier I was having display problem too for which I had opened one similar issue here ( )

edit retag flag offensive close merge delete


Not sure if this will work for you in docker, but take a look at this thread and how they solve it:

If it works let’s document as an answer for future users

osilva gravatar image osilva  ( 2022-01-23 05:55:32 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2022-01-23 22:43:51 -0500

cst0 gravatar image

Unfortunately, if you plan to use CUDA in a docker container, it's not as simple as running a docker container. NVIDIA maintains their own docker fork which has some resources on this. Not using nvidia-docker is the most common cause for the error you're seeing: you're attempting to select a GPU but your version of docker doesn't know how to handle what you're asking it to do.

With regards to the other error you linked, I wouldn't expect this to be related: it looks like that one is a problem of graphics being accessible, while this one is about being able to call CUDA functionality.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2022-01-22 06:00:36 -0500

Seen: 146 times

Last updated: Jan 23