Nvidia-mount-support does not work on Jetson platform

Snapd looks for /sys/module/nvidia/version to check if the host system has nvidia proprietary driver installed and mounts the allowed drivers under /var/lib/snapd/lib/gl inside a snap’s context.

This does not work when the underlying platform is the Nvidia’s Jetson because there is no /sys/module/nvidia/version there.

It does have a /sys/module/nvhost/version, maybe that’s something we could rely on ?

root@jetson-xavier-nx-devkit:~# cat /sys/module/nvhost/version

In any case, snapd needs to be patched to support the Jetson platform for nvidia driver mounts.

This seems a reasonable thing to do the logic should probably be if either file exists then do to NVIDIA mounting. If you’re able to do this yourself, we would welcome a PR :slight_smile:

1 Like

I tried to patch snapd with the above suggested change, however it seems that still does not fix the issue for us. I tried to run snap confine with debug flag and it seems that on my Yocto based system this codepath is never true (?) https://github.com/snapcore/snapd/blob/370dbbc04c44ab19a88fa49463e1ba5835ee880b/cmd/snap-confine/snap-confine.c#L667 – hence the drivers are not mounted. Since I don’t understand the preceding call in that code as well, so I am a bit clueless here. Any help would be appreciated.

You probably want to discard the mount namespace first, try running /usr/lib/snapd/snap-discard-ns <snapname>

Is the version reported for the nvhost module part of the file names of various nvidia libraries? The logic handling the current libraries basically looks at the version reported by the driver (say x.y.z) and tries to pick up all the relevant libraries named libGL-nvidia-x.y.z.so* and so on.

There is only libEGL_nvidia.so.0 under /usr/lib, so no, it does not correlate with the version number in /sys/module/nvhost/version. I guess that “logic” is broken for the case of the Jetson platform.

Wonder what would a “fix” be here.