From what I understand, you can divide the OpenGL libraries into distro-specific and hardware-specific libraries. The opengl
interface gives you access to the hardware-specific libraries, while you still need to include the distro-specific libraries.
libglu1-mesa
, for example, is a client library which sits on top of OpenGL, so it doesn’t talk to the hardware directly, it already uses the OpenGL API. It provides a bunch of high-level utility functions which are not hardware-specific. Technically, you can use OpenGL without this library, but most applications use it. By shipping it with the snap, application developers can choose which version of this library they use.
For a deep-dive; here is the security profile associated with the opengl
interface. As you can see, this profile enables the snap to access a bunch of hardware-specific GPU libraries and the kernel interfaces for GPU support.: https://github.com/snapcore/snapd/blob/master/interfaces/builtin/opengl.go
Here is some more general information about the steps required to enable GPU support in a snap: Adding OpenGL/GPU support to a snap