No OpenGL on Debian 9 + nvidia

I stumbled upon a strange issue when running OpenGL snaps on Debian 9 with the proprietary nvidia driver from stretch-backports:

Apps fail to start or can’t create a GL context, with the error output being something like:

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

Examples: solvespace, graphics-debug-tools-bboozzoo.glxinfo

The nvidia driver is exposed just fine in /var/lib/snapd/lib[...] and the launcher scripts set up glvnd dirs and LD_LIBRARY_PATH correctly.

Does anyone have an idea or better even, run Debian 9 + nvidia without those problems?

That seems to refer to the microversion problem of newer nvidia drivers. The drivers in stretch backports do not have that microversion:

cat /sys/module/nvidia/version

Refreshing core and snapd to edge doesn’t help either.

A strace of solvespace:

From the strace, we see that it cannot open

user@debian:~$ stat /var/lib/snapd/lib/gl/ 
  File: /var/lib/snapd/lib/gl/ -> /var/lib/snapd/hostfs/etc/alternatives/
  Size: 71        	Blocks: 0          IO Block: 4096   symbolic link
Device: 2eh/46d	Inode: 117859      Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: ( 1000/    user)
Access: 2020-03-06 15:03:26.328390265 +0000
Modify: 2020-03-06 15:03:26.328390265 +0000
Change: 2020-03-06 15:03:26.328390265 +0000
 Birth: -

user@debian:~$ stat /var/lib/snapd/hostfs/etc/alternatives/
  File: /var/lib/snapd/hostfs/etc/alternatives/ -> /usr/lib/mesa-diverted/x86_64-linux-gnu/
  Size: 50        	Blocks: 0          IO Block: 4096   symbolic link
Device: 15h/21d	Inode: 72985       Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-03-06 14:55:14.971436046 +0000
Modify: 2020-03-06 14:55:14.971436046 +0000
Change: 2020-03-06 14:55:14.975436047 +0000
 Birth: -

user@debian:~$ stat /usr/lib/mesa-diverted/x86_64-linux-gnu/
stat: cannot stat '/usr/lib/mesa-diverted/x86_64-linux-gnu/': No such file or directory

On Ubuntu 19.10, it works

mfederle@maxi:/var/lib/snapd/lib/gl$ readlink -f /var/lib/snapd/lib/gl/ 

It looks like Debian is now using the alternatives system to allow multiple libGL implementations to exist with the option to switch between them. I think this will need some snapd changes in the opengl interface to allow the symlink to be followed. cc/ @jdstrand

1 Like

Hi daniel!

I have the problem, that is discussed in this thread. Help me, please! :slight_smile:

What I can do to use solvespace with snap using proprietary nvidia drivers from Debian repository?
Any workaround?
Or I just have to wait updates of snap?

I just installed nvidia driver 440.64 from the official installer.
Solvespace runs but with text “Unable to create a GL context” in every window.

Let’s start with a bug report, I guess:

Did anyone figure out how to fix this error? I’m getting exactly the same one, certain snaps will not run.

It needs substantial work, as outlined in the bug report (quote: “This is a large chunk of work that we cannot commit to at this time”). @zyga was assigned to this bug, but he has left Canonical and does not work on the snap ecosystem any more.

In any case, this feature/bugfix does not seem to be a priority in the near future (again, see bug report).