Okay, I managed to reproduce.
The short story is that if the container is ubuntu:16.04
,
then glxinfo
(with the above setup) gives you this trouble.
If you can afford to use ubuntu:18.04
instead, then it happens to work fine without further tinkering.
You could potentially remove this package and still find elsewhere the glxinfo
utility. But still, there is no libGL.so.1
library. That is, you can remove the mesa libGL.so.1
with rm
but it would still require to find from somewhere.
The long story is that on 18.04, the NVidia library is made available from the libgl1
deb package. Yep, the deb package. Not the NVidia container. Let’s see in practice.
ubuntu@mycontainer1804:~$ ldd `which glxinfo`
linux-vdso.so.1 (0x00007ffc3d4ca000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007ff8d320f000)
..
ubuntu@mycontainer1804:~$ dpkg -S libGL.so.1
libgl1:amd64: /usr/lib/x86_64-linux-gnu/libGL.so.1
libgl1:amd64: /usr/lib/x86_64-linux-gnu/libGL.so.1.0.0
What’s going on with 16.04 though?
ubuntu@mycontainer1604:~$ ldd `which glxinfo`
linux-vdso.so.1 => (0x00007fff42da2000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007f96d75a2000)
...
But what should really be happening? LXD provides the NVidia container to our container, and the library file is
/dev/sda5 on /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.430.50 type ext4 (ro,nosuid,nodev,relatime,errors=remount-ro,data=ordered)
There should be a link from libGL.so.1
to that library!
ubuntu@mycontainer1604:~$ ldd `which glxinfo`
linux-vdso.so.1 => (0x00007fff80bb2000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007fb502762000)
...
ubuntu@mycontainer1604:~$ sudo ln -s /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.430.50 /usr/lib/x86_64-linux-gnu/libGL.so.1
ubuntu@mycontainer1604:~$ sudo ldconfig
ubuntu@mycontainer1604:~$ ldd `which glxinfo`
linux-vdso.so.1 => (0x00007fff80bb2000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007fb502762000)
...
ubuntu@mycontainer1604:~$ sudo rm /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf
ubuntu@mycontainer1604:~$ sudo ldconfig
ubuntu@mycontainer1604:~$ ldd `which glxinfo`
linux-vdso.so.1 => (0x00007ffedfd57000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f785b4ca000)
...
ubuntu@mycontainer1604:~$ glxinfo -B
name of display: :0
display: :0 screen: 0
direct rendering: Yes
OpenGL vendor string: NVIDIA Corporation
...