No this is a different issue.
With snaps the problem is complex. Snaps do not have full access to the host system userspace libraries (that includes the userspace nvidia drivers). Snaps have multiple totally different ways of accessing the drivers… because of course there can’t just be one method! On method is the “core” snaps that you were already pointed to by ubuntu GitHub - snapcore/nvidia-core22 .
Another is a builtin interface in snapd. For OpenGL/Vulkan, snaps implement an “opengl” interface Adding OpenGL/GPU support to a snap | Snapcraft documentation where certain host libraries are allowed into the snap confine snapd/interfaces/builtin/opengl.go at master · snapcore/snapd · GitHub . Immediately I see multiple bugs.
snapd does not have access to the file /usr/lib/aarch64-linux-gnu/nvidia/nvidia_icd.json
directly. Your vulkan icd file is a symlink in /etc/vulkan/icd.d/nvidia_icd.json
to /usr/lib/aarch64-linux-gnu/nvidia/nvidia_icd.json
. While snap appears to mount most of /etc/
it does not mount most of /usr
directly and so the symlink breaks inside the snap (which is why chromium cannot read it). You would be able to see this in this post but the text here is red because the symlink is broken
root@gman-orin:/# ls -l /var/lib/snapd/hostfs/etc/vulkan/icd.d/nvidia_icd.json
lrwxrwxrwx 1 root root 49 Nov 30 13:57 /var/lib/snapd/hostfs/etc/vulkan/icd.d/nvidia_icd.json -> /usr/lib/aarch64-linux-gnu/nvidia/nvidia_icd.json
If you manually break the symlink on the host so that is a normal independent file, chromium in the snap can now read the json but there are further bugs
Warning: libGLX_nvidia.so.0: cannot open shared object file: No such file or directory
Warning: loader_icd_scan: Failed loading library associated with ICD JSON libGLX_nvidia.so.0. Ignoring this JSON
Warning: vkCreateInstance: Found no drivers!
Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:101)
at CreateVkInstance (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:493)
at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:379)
at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:301)
at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:556)
Now you might ask why this is, because /var/lib/snapd/hostfs/lib/aarch64-linux-gnu/nvidia
is available in the snap. Well that path is restricted by AppArmor that we already talked about earlier snapd/interfaces/builtin/opengl.go at master · snapcore/snapd · GitHub and the /var/lib/snapd/hostfs/lib/aarch64-linux-gnu/nvidia
needs to be allowed through.
Firstly, snapd/interfaces/builtin/opengl.go at 4f59ae0fa2ea0f3b51b49ff39dec8b8ae3771096 · snapcore/snapd · GitHub is missing GLX in the list, that needs to be added (desktop GPU drivers likely need it too). And then ofc the entire /nvidia/ and /tegra/ and /tegra-egl/ folders all need to be passed in. And then finally when all that is done, the snap needs to know to look for the dynamic libraries inside the nvidia/tegra/tegra-egl folders and not just in the typical /usr/lib/aarch64-linux-gnu folder
Basically the whole thing is a disaster, none of the vulkan/gl/egl json files are made available as is, and none of the nvidia userspace gpu libraries are made available as it.
For your developers here is an easy to use way to “enter” a snap and run simple ls
and cd
commands so you can see what files are available in a snap Documentation of /var/lib/snapd/hostfs - #2 by Lin-Buo-Ren - doc - snapcraft.io