Nvidia driver problem in Ubuntu 18.04 host with a ros-kinetic-desktop-full docker
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