Chapter 40. GBM and GBM-based Wayland Compositors

Overview

GBM is a memory allocation API developed as a component of the Mesa project. Most Wayland compositors use the GBM API to initialize an EGLDisplay object directly on a GPU, and to allocate the EGLSurface representing the desktop. The NVIDIA driver includes a GBM backend enabling the use of such software on NVIDIA GPUs. A GBM EGL external platform library is also included to enable the use of GBM objects in EGL.

Requirements

The following are necessary to enable use of the NVIDIA driver's GBM backend and its EGL and related Wayland client support:

Xwayland and GBM

Xwayland uses the GLAMOR backend to accelerate X application rendering using EGL. While not required for basic functionality, GLAMOR acceleration is required for good performance when running accelerated Vulkan or OpenGL X11 applications. The GLAMOR integration code in Xwayland has paths to use either EGLStreams or GBM to allocate surfaces for use with accelerated rendering. To use the GBM path with the NVIDIA driver's GBM backend and GBM EGL external platform library, the installed copy of Xwayland should be a build from the master branch of https://gitlab.freedesktop.org/xorg/xserver at least as recent as commit 5daf42b4. Xwayland versions 21.1.3 and above satisfy this requirement.

See Chapter 39, OpenGL and Vulkan on Xwayland for more details on Xwayland support in the NVIDIA driver.