GBM from Mesa-25.1.0

Introduction to GBM

The GBM [7] library provides API functions for graphical rendering and is supplied by Mesa. Most drivers on Linux distributions come from Mesa, so GBM will get installed along those drivers. With the NVIDIA-575.51.02 driver, it's a different story. That driver still depends on the GBM library. You will not need to install Mesa-25.1.0. If you are not installing NVIDIA, skip to SPIRV-Headers-1.4.313.0 and keep going till you reach Mesa-25.1.0 to get a complete installation of drivers and other libraries.

[Note]

Note

Mesa is updated relatively often. You may want to use the latest available 25.1.x mesa version.

GBM Dependencies

Required

libdrm-2.4.124, mako-1.3.10, PyYAML-6.0.2, and Xorg Libraries

Optional

mesa-demos (provides more than 300 demos to test drivers)

Installation of GBM

Install the GBM by running the following commands:

mkdir build &&
cd    build &&

meson setup --prefix=/usr            \
            --buildtype=release      \
            -D gallium-drivers=      \
            -D vulkan-drivers=       \
            -D video-codecs=         \
            -D gbm=enabled           \
            -D glx=disabled          \
            -D llvm=disabled         \
            -D valgrind=disabled     \
            -D libunwind=disabled    \
            .. &&

ninja

Now, as the root user:

ninja install &&
mkdir -pv /usr/include/GL/internal &&
cp -v ../include/GL/internal/dri_interface.h /usr/include/GL/internal

lib32 Installation of GBM

Install lib32-GBM by running the following commands:

rm -rf * &&
CC="gcc -m32" CXX="g++ -m32"         \
PKG_CONFIG_PATH=/usr/lib32/pkgconfig \
meson setup --prefix=/usr            \
            --libdir=/usr/lib32      \
            --buildtype=release      \
            -D gallium-drivers=      \
            -D vulkan-drivers=       \
            -D video-codecs=         \
            -D gbm=enabled           \
            -D glx=disabled          \
            -D llvm=disabled         \
            -D valgrind=disabled     \
            -D libunwind=disabled    \
            .. &&

ninja

Now, as the root user:

DESTDIR=$PWD/DESTDIR ninja install    &&
cp -vr DESTDIR/usr/lib32/* /usr/lib32 &&
rm -rf DESTDIR                        &&
ldconfig

Command Explanations

[Note]

Note

Inspect meson_options.txt for a full list of options.

--buildtype=release: This switch ensures a fully-optimized build, and disables debug assertions which will severely slow down the libraries in certain use-cases. Without this switch, build sizes can span into the 2GB range.

-D gallium-drivers=: This parameter forces Gallium3D (OpenGL) drivers to not be built as drivers are provided by NVIDIA-575.51.02.

-D vulkan-drivers=: This parameter forces Vulkan drivers to not be built as drivers are provided by NVIDIA-575.51.02.

-D video-codecs=: This parameter forces video codecs to not be built.

-D gbm=enabled: This parameter forces libgbm to be built.

-D glx=disabled: This parameter disables building any OpenGL libraries or drivers which are provided by NVIDIA-575.51.02.

-D llvm=disabled: This parameter disables unneeded LLVM-20.1.4 support.

-D valgrind=disabled: This parameter disables the usage of Valgrind during the build process.

-D libunwind=disabled: This parameter disables the usage of libunwind.

cp -v ../include/GL/internal/dri_interface.h ...: This command copies over a header file that is needed by Xorg-Server-21.1.16 since it is not copied over automatically in this build.

Contents

Installed Programs: None
Installed Libraries: libgbm
Installed Directories: /usr/share/drirc.d (contains workarounds for various applications, particularly browsers and games)

Short Descriptions

libgbm

is the Graphics Buffer Manager library



[7] Graphics Buffer Management.