How are flatpak graphics drivers handled?

Flatpak needs its own graphics drivers because it’s containerized, but do the flatpak drivers need to be the same version as the ones installed on the system or can they differ? Can you use a distribution with older drivers, i.e. Debian and be able to use the latest ones via flatpak? Does the answer apply to both AMD and NVIDIA?
I have heard conflicting information about this on the Internet.

For AMD & Intel (Mesa):
Flatpak will always install the latest version of the Mesa extension (org.freedesktop.Platform.GL.default) and it can differ from the host system. Mesa is only a/the userspace part of the graphics driver, so it’s possible that you can’t use all features with an older kernel (the other part of the driver), but in general it should work (apart from possible bugs).

Because the driver is closed source, the kernel module not part of the mainline kernel & NVIDIA probably does not provide compatibility for the modules, flatpak must install an extension matching the host. That’s why there are so many org.freedesktop.Platform.GL.nvidia-@@NVIDIA_VERSION@@ extensions.

1 Like

Thanks, that makes the most sense.