GBM from Mesa-25.1.2

Introduction to GBM

The GBM [6] 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. On the other hand, NVIDIA-575.57.08 does not need the full Mesa stack, but it still needs the GBM library. As such, you can install just what you need. You will not need to install the full Mesa-25.1.2 stack if you want to install NVIDIA-575.57.08, but you can if you so choose. It can be a good idea to do so as to have a fallback (Zink Gallium3D + Nouveau Vulkan). If you are not installing NVIDIA, skip to SPIRV-Headers-1.4.313.0 and keep going till you reach Mesa-25.1.2 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.125, 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
if test -d /usr/include/EGL; then
  cp -v ../include/EGL/eglmesaext.h /usr/include/EGL
fi

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 or meson.options 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.57.08.

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

-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.57.08.

-D llvm=disabled: This parameter disables unneeded LLVM-20.1.6 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.17 since it is not copied over automatically in this build.

cp -v ../include/EGL/eglmesaext.h ...: This command copies over a header file that is needed by Mutter and possibly other packages.

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



[6] Graphics Buffer Manager.