GBM from Mesa-25.0.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. With the NVIDIA-570.133.07 driver, it's a different story. That driver still depends on the GBM library. You will not need to install Mesa-25.0.2. If you are not installing NVIDIA, skip to SPIRV-Headers-1.4.309.0 and keep going till you reach Mesa-25.0.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.0.x mesa version.

GBM Dependencies

Required

Xorg Libraries, libdrm-2.4.124, and mako-1.3.8

Recommended

Optional

libgcrypt, libunwind-1.8.1, Nettle-3.10.1, valgrind, mesa-demos (provides more than 300 demos to test drivers), Bellagio OpenMAX Integration Layer (for mobile platforms), and libtizonia

Installation of GBM

Install the GBM by running the following commands:

mkdir build &&
cd    build &&

meson setup --prefix=/usr            \
            --buildtype=release      \
            -D platforms=x11,wayland \
            -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

First clean the build directory:

rm -rf *

Install lib32-GBM by running the following commands:

CC="gcc -m32" CXX="g++ -m32"         \
PKG_CONFIG_PATH=/usr/lib32/pkgconfig \
meson setup --prefix=/usr            \
            --libdir=/usr/lib32      \
            --buildtype=release      \
            -D platforms=x11,wayland \
            -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 platforms=...: This parameter controls which windowing systems will be supported. Available linux platforms are x11 and wayland.

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

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

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

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

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

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

-D valgrind=disabled: This parameter disables the usage of Valgrind during the build process. Remove this parameter if you have Valgrind installed, and wish to check for memory leaks.

-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.so
Installed Directories: /usr/share/drirc.d (contains workarounds for various applications, particularly browsers and games)

Short Descriptions

libgbm.so

is the Graphics Buffer Manager library



[6] Graphics Buffer Management.