ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Nvidia driver problem in Ubuntu 18.04 host with a ros-kinetic-desktop-full docker

asked 2019-04-27 03:32:29 -0600

Eric Dong gravatar image

updated 2019-04-27 15:08:24 -0600

jayess gravatar image

Hello,

I am currently using a host machine with Ubuntu 18.04, ROS melodic and Gazebo 9. For some legacy packages, I would like to install a Ubuntu16.04 docker with ros-kinetic-desktop-full image. Been searching around, found this post https://answers.ros.org/question/3001... is quite there. But personally prefer the Xserver approach.

I managed to build a new image FROM nvidia/cuda:9.0-devel-ubuntu16.04 with ros-kinetic-desktop-full. But unable to run Nvidia rendering apps like rviz or gazebo. However, both run fine on my host. Checked with nvidia-smi, gave me the nvidia-driver 390 on my host. However, the in the dockerfile, the latest nvidia driver can install in ubuntu 16.04 is 375, which does not match my nvidia driver on the host. When running the docker, gave me the error

libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast

A bit more of digging in the docker, found the following culprit libGL.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1. After installing the nvidia-375 in docker, gave another error:

OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"process_linux.go
:385: running prestart hook 1 caused \\\"error running hook: exit status 1, stdout: , stderr: exec command: [/usr/bin/nvidia-container-cli --load-kmods configure --ldconfig=@/sbin/ldconfig.real --device=all --com
pute --compat32 --graphics --utility --video --display --require=cuda>=8.0 --pid=32239 /var/lib/docker/overlay2/bd4f3570d4eb99d9df1117bd3751a00c8c0eb63429e65eba2a196c6c543cc52f/merged]\\\\nnvidia-container-cli: m
ount error: file creation failed: /var/lib/docker/overlay2/bd4f3570d4eb99d9df1117bd3751a00c8c0eb63429e65eba2a196c6c543cc52f/merged/usr/bin/nvidia-smi: file exists\\\\n\\\"\"": unknown

Appreciate kind advice how to deal with the nvidia driver problem.

Thank you

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2019-04-28 22:27:34 -0600

hwil292 gravatar image

updated 2019-04-28 22:31:16 -0600

Hi,

I am not sure if I had the exact same issue as you, but I did have issues having rviz operate with docker. What I had to do was also install openGL libraries when creating the docker image, i.e. using the from command below. Something about a dependency somewhere relying on openGL (see here for a discussion on the same problem https://github.com/diegoferigo/docker... )

FROM nvidia/cudagl:10.0-devel-ubuntu16.04

I have these commands in my docker run command, and I remember one or the combination of them enabled me to run rviz display through docker, presumably you already have them but just in case these link the docker display with the actual display.

docker run -e DISPLAY=$DISPLAY --env="QT_X11_NO_MITSHM=1" -e DISPLAY=$DISPLAY --env="QT_X11_NO_MITSHM=1" ... (rest of command etc here).

Hope this helps!

edit flag offensive delete link more

Comments

Obviously you can edit the relevant versions, but basically you need to install OpenGL as it does not come with Nvidia docker 2 by default, at least that is my understanding

hwil292 gravatar image hwil292  ( 2019-04-28 22:32:52 -0600 )edit

Thanks! It works! By pulling from nvidia/cudagl:9.0-devel-ubuntu16.04

Eric Dong gravatar image Eric Dong  ( 2019-04-29 10:06:09 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2019-04-27 03:32:29 -0600

Seen: 5,264 times

Last updated: Apr 28 '19