Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

193.13. glmark2-2023.01

Benchmark, in wayland, drm and gbm flavours of GL and GLESv2, all on EGL

Version 2023.01, release 1
Shelf gpu — The GPU stack: Mesa, DRM, GL and Vulkan loaders and headers, shader compilers, VA-API, OpenCL
Phase 42_graphics (Graphics Stack), 110 of 189 in build order
Licence GPL-3.0-or-later
Homepage https://github.com/glmark2/glmark2
Build time 8.0 SBU
Installed size 16.2 MiB in 148 files
Recipe ports/core/gpu/glmark2/kpkgbuild

About

glmark2 is an OpenGL and OpenGL ES 2.0 benchmark: a set run of scenes (shading, texturing, buffers, effects) that ends in one score. Unless --swap-mode fifo is given it asks for a swap interval of 0, so the score is not capped at the display’s refresh rate. KDOS builds six programs, one per flavour: glmark2-wayland and glmark2-es2-wayland in a Wayland window, glmark2-drm and glmark2-es2-drm straight to the display from a text console, and glmark2-gbm and glmark2-es2-gbm rendering offscreen with no display at all. Each reaches GL through EGL. Which one answers which question is in Which tool answers which question.

Why it is in KDOS

The comment above the 3 ports from mesa-demos to vulkan-tools in script/phases/42_graphics/packages.d/gpu.txt:

THE GRAPHICS TOOLS ARE THE WAYLAND AND EGL ONES: es2gears_wayland and eglinfo from mesa-demos, glmark2-es2-wayland, and vkcube/vulkaninfo from vulkan-tools, which are also what says whether the machine has a Vulkan driver at all. mesa is built with GLX and its X11 platform for the X11 programs that run under Xwayland, but mesa-demos is built -Dx11=disabled, so glxgears and glxinfo are not among its programs.

Sources

Dependencies

Depends on: meson, ninja, pkgconf, wayland, wayland-protocols, mesa, libglvnd, libjpeg-turbo, libpng, libdrm, eudev.

Required by: no port names it.

Patches

build.sh applies these; kpkg applies nothing by itself.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install glmark2'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/gpu/glmark2.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/gpu/glmark2
echo '8fece3fc323b643644a525be163dc4931a4189971eda1de8ad4c1712c5db3d67  glmark2-2023.01.tar.gz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/glmark2
SRC=$SRC_ROOT/glmark2-2023.01
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf glmark2-2023.01.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i $PORT_SRC/wayland-generated-header.patch

meson setup build \
	--prefix=/usr --libdir=lib \
	--buildtype=release \
	-Dflavors=wayland-gl,wayland-glesv2,drm-gl,drm-glesv2,gbm-gl,gbm-glesv2
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/glmark2, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf glmark2-2023.01-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/glmark2, and runs the triggers its paths call for.

Contents

Installed programs: glmark2-drm, glmark2-es2-drm, glmark2-es2-gbm, glmark2-es2-wayland, glmark2-gbm, glmark2-wayland.

Installed directories: /usr/share/glmark2, /usr/share/licenses/glmark2.

Short descriptions

glmark2-drm OpenGL (ES) 2.0 benchmark suite
glmark2-es2-drm OpenGL (ES) 2.0 benchmark suite
glmark2-es2-gbm OpenGL (ES) 2.0 benchmark suite
glmark2-es2-wayland OpenGL (ES) 2.0 benchmark suite
glmark2-gbm OpenGL (ES) 2.0 benchmark suite
glmark2-wayland OpenGL (ES) 2.0 benchmark suite