The proposed fix for 18.04 does not cause a regression on 16.04.
Chill.
Hello, using ubuntu 18.04, snap version 16-2.32+git622.ab40e67 and nvidia 390 driver.
I have issues with spotify and some other snaps, issue looks like this:
snap run spotify
failed to create prefix path: /tmp/snap.rootfs_zTBDGl/var/lib/snapd/lib/vulkan/icd.d: Permission denied
snap run flare-rpg
failed to create prefix path: /tmp/snap.rootfs_smuH38/var/lib/snapd/lib/vulkan/icd.d: Permission denied
But skype and atom works.
If i switch to intel card all snaps works.
2.32.2 with the fixes is in beta now, can you try snap refresh --beta core
and check if opengl works for you?
Works for me with my ubuntu-18.04 with nvidia-340 driver. Thanks for the fix!
Iām afraid vulkan support is a subject to further research. Iāve played a bit with it and got to a state where vulkaninfo
properly reports Nvidia ICD. The problem was that ICD discovery is somewhat awkward and while you can pass a path to specific icd in VK_ICD_FILENAMES
, I have not found a way to override the ICD search paths. I hope that we will be able to sort it out with proper layout adjustments.
Hi @mborzecki . Sorry to dig up an old thread.
Iāve had a bug report about a snap Iāve made which fails to run under 18.04, after an update from 17.10. I canāt reproduce the issue but the snap is complaining about gl libraries. I was wondering if it is significant that the reporter is running a laptop nvidia card? Would hybrid graphics/optimus be supported with your fix? Do you have any suggestions about what I could do to debug this?
@mcphail left a comment asking for more logs
IIRC @chipaca ran some snaps on a system with integrated nvidia card, albeit this might have been a 16.04 system at the time. As far as the snaps are concerned, the current setup will first probe if the NVIDIA driver is loaded and then verify if matching NVIDIA libraries are available in /usr/lib/<arch-tuple>/
. Thatās all there is to it.
If I correctly understand what PRIME does, you should be able to select your nvidia card as the sink and then set DRI_PRIME=<idx>
to use the card. Given how messy (and useless) it has been for Linux users, Iād recommend to first get it working outside of snaps.
One thing to note is that you currently need to use snap-discard-ns
on a snap if you run an app from the snap with the intel card and then switch to the nvidia card.
Ah - thanks @mborzecki and @chipaca. I think this will be the answer, and Iāve learned something new. Much appreciated.
@mborzecki Thanks for all the work so far!
I fear I found another missing thing: GLVND adds /usr/share/glvnd/egl_vendor.d/
which the Nvidia and Mesa drivers fill with .json files which contain details how to load the driver. See https://github.com/NVIDIA/libglvnd/blob/e202ebf27f5783400fa12b33ed18bb3599ec98ed/src/EGL/libeglvendor.c#L35 for details. This is how the nvidia one looks on my Ubuntu 18.04 system:
$ cat /usr/share/glvnd/egl_vendor.d/10_nvidia.json
{
"file_format_version" : "1.0.0",
"ICD" : {
"library_path" : "libEGL_nvidia.so.0"
}
}
This doesnāt seem to be an issue when the application is linked against libGL like your glxinfo
is (I donāt know yet how exactly GLVND is figuring out which driver to use in this case but maybe its talking to X11) but causes problems for those which load the GL driver via dlopen
/dlsym
at runtime. For those we need to have the egl_vendor.d
dir available. Happily GLVND has a environment variable for this __EGL_VENDOR_LIBRARY_DIRS
which can be used to provide access to a copy of possible vendor configurations within a snap.
However we should support this the right way by maybe mapping /usr/share/glvnd/egl_vendor.d
onto something in /var/lib/snapd/
within the snap mount namespace and then set the __EGL_VENDOR_LIBRARY_DIRS
environment variable automatically for this or let the desktop launchers do that. What do you think?
Thanks for finding this. Fortunately this looks much saner than Vulkan and should be an easy fix. Do you have a snap I could use to testing by any chance?
And here comes the snapcraft-desktop-helpers part:
https://github.com/ubuntu/snapcraft-desktop-helpers/pull/120
Iāve pushed a change adding eglinfo
tool to graphics-debug-tools-bboozzoo
snap. Itās available in rev 4.
The snapd changes are in in edge already.