Chapter 39. 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, a version of Xwayland containing the following patch or equivalent code must be used:

https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/751

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