It looks like the libEGL.so.1 in that package is a libGLdispatch (the predecessor to glvnd) based driver seelctor. It’s likely the libEGL_nvidia.so.0 file could be loaded by glvnd, but there’s no egl_vendor.d json metadata file to tell it that the driver exists.
In the other direction, a snap built with base: core will probably not be using the glvnd version of libEGL.so.1, so would not be able to use the egl_vendor.d metadata provided by a newer host system’s Nvidia drivers. But with that said it can also fail to use that host system’s libEGL.so.1 as in the Impish case that started this thread.
So if I’m reading this right, in either scenario libEGL_nvidia would/could not be used and there’s either no metadata ti look it up, or the metadata format is different?
How about vulkan? We also try to pull in the vulkan ICD files in snap-confine.
libEGL_nvidia.so.0 is a proprietary binary provided by Nvidia, and is built on whatever system Nvidia considers to be their lowest common denominator. I don’t think it is currently a problem for any of the base snaps we support.
libEGL.so.1 in current Ubuntu releases is an open source driver multiplexer (part of the libglvnd source package). It is built against whatever libraries are current in the corresponding distro release. In 21.10, this results in a dependency on the GLIBC_2.33 symbol version.
I think the right way to handle things would be to use the copy of the driver multiplexer provided by the snap (e.g. by the gnome platform snap), which should be able to load the Nvidia driver even on modern systems.
The problem is legacy pre-glvnd systems like Ubuntu 16.04, which use a different Nvidia-only dispatch library (GLdispatch) and don’t ship the json metadata needed for glvnd to function. In that case, we really do want the libEGL.so.1 from the host system.
Are you aware of any other indicators other that lack of nvidia files under egl_vendor.d that would suggest that we need libEGL from host? I can tweak s-c to avoid symlinking in such case. This would need to be time aligned with gnome platform snap shipping the right libraries too.
The other combination that could cause trouble is a snap that isn’t built to use glvnd (which probably just means some old core16 snaps). But I’m not sure whether they would function at all on an Ubuntu 21.10/Nvidia system.
I posted some test instructions to see if we can improve behaviour for Firefox here by preferencing the snap’s driver multiplexer here:
If you’ve got a system where you can reproduce, perhaps that might help determine whether the change will work.
Can confirm. And I can also confirm that @jamesh’s fix works here. This or something similar needs to get implemented soon. The UX for the average desktop user is quite terrible.
I’ve put together a branch that attempts to fix things from the snapd side here:
I don’t have any Nvidia hardware to try it myself, but it should have a similar effect to the LD_LIBRARY_PATH hack I asked people to try earlier.
The CI should produce a test build of the snapd snap that people can test out. I’ll post more details about how people can test it when it is available.
Thanks. This looks promising. I think the snapd snap produced by the CI run is only accessible if one is logged in to their github account. Would it make sense to provide grab that snap and provide it at people.canonical.com leaving a link in the topic?
@jamesh that looks like a sensible approach: I hope we get confirmation that it works in practice.
I still wonder if we need, in principle, to hack __EGL_VENDOR_LIBRARY_DIRS (but that probably only enables hybrid setups that were already broken before 21.10)
The CI job has finished, so there is a build available here as an artifact:
If you are logged in to Github, it should be possible to download the “snap-files” artifact at the bottom of that page. You can install the modified snapd with the following commands:
After you’ve finished testing, switch back to the stable release from the store by running the following:
sudo snap refresh --amend --stable snapd
If you’ve got a system with an Nvidia GPU, I’d appreciate feedback on how this build runs. Some things that would be useful to test:
If you’re running Ubuntu 21.10, does this fix any snaps you use that are broken with stable snapd? Before testing the snap, run the following command:
sudo /usr/lib/snapd/snap-discard-ns $snap_name`
This will ensure you’re not using a sandbox set up by the old snapd version.
If you’re running an older version of Ubuntu, it would also be useful to test that this doesn’t cause regressions for apps you use.
Do old base: core snaps work? @kenvandine’s post above contains a list, but it’s probably best to pick snaps that appear to be somewhat actively maintained. Some look abandoned or uploaded as tests.
If you find snaps that malfunction with this snapd build, it would also be useful to know whether they function correctly with stable snapd.
Reports of both successes and failures are appreciated.