glmark2

How to run glmark2-drm to benchmark an external GPU on a Raspberry Pi

Recently I wanted to see whether I could get glmark2 (an OpenGL 2.0 and ES 2.0 benchmark tool) to run on a Raspberry Pi with an external graphics card (see this thread).

But glmark2 isn't available in any Pi repositories, so you have to build it from source:

sudo apt install -y meson libjpeg-dev libdrm-dev libgbm-dev libudev-dev
git clone https://github.com/glmark2/glmark2.git
cd glmark2
meson setup build -Dflavors=drm-gl,drm-glesv2
ninja -C build
sudo ninja -C build install

I built this for drm only, so it can run fullscreen without any X/Wayland environment. To run the full suite:

glmark2-drm

Or you can run a specific benchmark like glmark2-drm -b jellyfish.