Last edited 3 weeks ago

How to launch glmark2 benchmark


glmark2 benchmark screen capture (test scene named "build")

1. Introduction[edit | edit source]

glmark2 is an OpenGL 2.0 and ES 2.0 benchmark, developed by Alexandros Frantzis and Jesse Barker. It is based on the original glmark benchmark by Ben Smith[1].

2. Using glmark2[edit | edit source]

Building glmark2 generates 2 binaries:

  • glmark2-es2-wayland, to launch glmark2 benchmark as a wayland client.
  • glmark2-es2-drm, to launch glmark2 benchmark as a native DRM/GBM openGLES application.

2.1. glmark2-es2-wayland[edit | edit source]

  • Start Weston (if not already started)[2]
systemctl start weston-graphical-session
  • Launch glmark2
glmark2-es2-wayland


2.2. glmark2-es2-drm[edit | edit source]

systemctl stop weston-graphical-session
  • Launch glmark2
glmark2-es2-drm

3. Output examples[edit | edit source]

Find below console logs and images output examples:

root@stm32mp25:~# glmark2-es2-wayland --off-screen
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Vivante Corporation
    GL_RENDERER:    Vivante GCNANOULTRA31_VIP2
    GL_VERSION:     OpenGL ES 3.1 V6.4.21.1.1058597
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 1040 FrameTime: 0.962 ms
[build] use-vbo=true: FPS: 1761 FrameTime: 0.568 ms
[texture] texture-filter=nearest: FPS: 1361 FrameTime: 0.735 ms
[texture] texture-filter=linear: FPS: 1291 FrameTime: 0.775 ms
[texture] texture-filter=mipmap: FPS: 1108 FrameTime: 0.903 ms
[shading] shading=gouraud: FPS: 951 FrameTime: 1.052 ms
[shading] shading=blinn-phong-inf: FPS: 859 FrameTime: 1.165 ms
[shading] shading=phong: FPS: 560 FrameTime: 1.789 ms
[shading] shading=cel: FPS: 426 FrameTime: 2.349 ms
[bump] bump-render=high-poly: FPS: 522 FrameTime: 1.916 ms
[bump] bump-render=normals: FPS: 1349 FrameTime: 0.742 ms
[bump] bump-render=height: FPS: 698 FrameTime: 1.434 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 263 FrameTime: 3.807 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 98 FrameTime: 10.306 ms
[pulsar] light=false:quads=5:texture=false: FPS: 833 FrameTime: 1.201 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 105 FrameTime: 9.539 ms
[desktop] effect=shadow:windows=4: FPS: 256 FrameTime: 3.909 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 157 FrameTime: 6.389 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 156 FrameTime: 6.420 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 236 FrameTime: 4.251 ms
[ideas] speed=duration: FPS: 172 FrameTime: 5.829 ms
[jellyfish] <default>: FPS: 202 FrameTime: 4.969 ms
[terrain] <default>: FPS: 5 FrameTime: 200.062 ms
[shadow] <default>: FPS: 452 FrameTime: 2.215 ms
[refract] <default>: FPS: 40 FrameTime: 25.353 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 952 FrameTime: 1.051 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 185 FrameTime: 5.411 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 931 FrameTime: 1.075 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 397 FrameTime: 2.519 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 200 FrameTime: 5.016 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 386 FrameTime: 2.594 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 386 FrameTime: 2.594 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 211 FrameTime: 4.756 ms
=======================================================
                                  glmark2 Score: 561 
=======================================================

Find below some screen captures[3] of several glmark2 scenes:

4. System considerations before starting glmark2[edit | edit source]

glmark2 is a GPU benchmark and its results must be analyzed taking into account:

  • the display chain used: resolution, window vs. full screen mode, on screen vs. off screen, pixel formats...
  • the benchmark configuration: swap mode, frame end method, visual configuration...
  • the system characteristics: available cpu load and performance, DDR memory load and performance...
  • the glmark2 scenes: GPU computation vs. texture vs. geometry vs. rendering capabilities, or a mix of some/all of these capabilities...

4.1. Initial conditions[edit | edit source]

Before starting the benchmark, it is recommended to have very few applications running in parallel, to set the CPU scheduler to performance mode, and to stop services that could interfere with the measurement.

Below, some command lines that can be useful before running this benchmark (note: these commands may not be applicable to all systems so please adjust them accordingly):

echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 
systemctl stop netdata
systemctl stop st-m33firmware-load # (stm32mp2 only)
echo 1 > /sys/devices/system/cpu/cpu1/cpuidle/state1/disable # cpu idle cpu-power-down (stm32mp2 only)
echo 1 > /sys/devices/system/cpu/cpu0/cpuidle/state1/disable # cpu idle cpu-power-down (stm32mp2 only)
modprobe -r adc_typec # remove usb power delivery (stm32mp21 only)

4.2. Backend and Scenes vs. system resources[edit | edit source]

Some glmark2 scenes are more sensitive to a given system parameter.

Here below selected scenes that may help while testing the overall system with a particular focus on a given parameter:

Results depend on (see below) High Low
CPU usage 1."ideas:speed=duration", 2."buffer", 3."desktop:effect=shadow:windows=4"
Note: this is identical to the GPU low usage.
glmark2-es2-wayland has the highest average CPU usage.
1."terrain", 2."effect2d:kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;", 3."conditionals:fragment-steps=5:vertex-steps=0"
Note: this is identical to the GPU high usage.
glmark2-es2-drm has the lowest average CPU usage.
GPU usage 1."terrain", 2."effect2d:kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;", 3."conditionals:fragment-steps=5:vertex-steps=0"
Note: this is identical to the CPU low usage.
glmark2-es2-wayland --fullscreen has the highest average GPU usage.
1."ideas:speed=duration", 2."buffer", 3."desktop:effect=shadow:windows=4"
Note: this is identical to the CPU high usage.
glmark2-es2-wayland --off-screen has the lowest average GPU usage.
DDR read usage 1."terrain", 2."refract", 3."jellyfish"
Note: this is identical to the DDR read+write high usage.
glmark2-es2-wayland has the highest average DDR read usage.
1."ideas:speed=duration", 2."conditionals:fragment-steps=5:vertex-steps=0", 3."loop:fragment-steps=5:fragment-uniform=true:vertex-steps=5"
glmark2-es2-gbm has the lowest average DDR read usage.
DDR write usage 1."conditionals:fragment-steps=0:vertex-steps=0", 2. "conditionals:fragment-steps=0:vertex-steps=5", 3."build:use-vbo=false"
glmark2-es2-wayland --fullscreen has the highest average DDR write usage.
1."ideas:speed=duration", 2."terrain", 3."effect2d:kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;"
glmark2-es2-wayland --off-screen has the lowest average DDR write usage.
DDR read+write usage 1."terrain", 2."refract", 3."jellyfish"
Note: this is identical to the DDR read high usage.
glmark2-es2-wayland --fullscreen has the highest average DDR read+write usage.
1."ideas:speed=duration", 2."effect2d:kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;", 3."conditionals:fragment-steps=5:vertex-steps=0"
glmark2-es2-gbm has the lowest average DDR read+write usage.
Frames per second 1."build:use-vbo=true", 2."bump:bump-render=normals", 3."texture:texture-filter=nearest", 4."conditionals:fragment-steps=0:vertex-steps=0"
glmark2-es2-wayland --off-screen has the highest average fps.
1."terrain", 2."refract:", 3."ideas:speed=duration"
glmark2-es2-drm has the lowest average fps.

5. Advanced glmark2 usage[edit | edit source]

5.1. Get help syntax[edit | edit source]

glmark2-es2-wayland --help
A benchmark for Open GL (ES) 2.0

Options:
  -b, --benchmark BENCH  A benchmark or options to run: '(scene)?(:opt1=val1)*'
                         (the option can be used multiple times)
  -f, --benchmark-file F Load benchmarks to run from a file containing a
                         list of benchmark descriptions (one per line)
                         (the option can be used multiple times)
      --validate         Run a quick output validation test instead of 
                         running the benchmarks
      --data-path PATH   Path to glmark2 models, shaders and textures
                         Default: /usr/share/glmark2
      --frame-end METHOD How to end a frame [default,none,swap,finish,readpixels]
      --swap-mode MODE   How to swap a frame, all modes supported only in the DRM
                         flavor, 'fifo' available in all flavors to force vsync
                         [default,immediate,mailbox,fifo]
      --off-screen       Render to an off-screen surface
      --visual-config C  The visual configuration to use for the rendering
                         target: 'id=ID:red=R:green=G:blue=B:alpha=A:buffer=BUF:
                         stencil=STENCIL:samples=SAMPLES'. The parameters may be
                         defined in any order, and any omitted parameters assume a
                         default value of '0' (id, samples), '-1' (stencil) or
                         '1' (red, green, blue, alpha, buffer). If 'id' is set to
                         a non-zero value, all other parameters are ignored
      --reuse-context    Use a single context for all scenes
                         (by default, each scene gets its own context)
  -s, --size WxH         Size of the output window (default: 800x600)
      --fullscreen       Run in fullscreen mode (equivalent to --size -1x-1)
      --results RESULTS  The types of results to report for each benchmark,
                         as a ':' separated list [fps,cpu,shader]
      --results-file F   The file to save the results to, in the format determined
                         by the file extension [csv,xml]
      --winsys-options O A list of 'opt=value' pairs for window system specific
                         options, separated by ':'
  -l, --list-scenes      Display information about the available scenes
                         and their options
      --show-all-options Show all scene option values used for benchmarks
                         (only explicitly set options are shown by default)
      --run-forever      Run indefinitely, looping from the last benchmark
                         back to the first
      --annotate         Annotate the benchmarks with on-screen information
                         (same as -b :show-fps=true:title=#info#)
  -d, --debug            Display debug messages
      --version          Display program version
  -h, --help             Display help


5.2. Run in full screen[edit | edit source]

glmark2-es2-wayland --fullscreen

5.3. Get all scenes list and related options[edit | edit source]

glmark2-es2-wayland --list-scenes
[Scene] buffer
  [Option] buffer-usage
    Description  : How the buffer will be used
    Default Value: static
    Acceptable Values: static,stream,dynamic
  [Option] columns
    Description  : The number of mesh subdivisions length-wise
    Default Value: 100
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] interleave
    Description  : Whether to interleave vertex attribute data
    Default Value: false
    Acceptable Values: false,true
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] rows
    Description  : The number of mesh subdisivisions width-wise
    Default Value: 20
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] update-dispersion
    Description  : How dispersed the updates are [0.0 - 1.0]
    Default Value: 0.0
  [Option] update-fraction
    Description  : The fraction of the mesh length that is updated at every iteration (0.0-1.0)
    Default Value: 1.0
  [Option] update-method
    Description  : Which method to use to update vertex data
    Default Value: map
    Acceptable Values: map,subdata
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
[Scene] build
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] interleave
    Description  : Whether to interleave vertex attribute data
    Default Value: false
    Acceptable Values: false,true
  [Option] model
    Description  : Which model to use
    Default Value: horse
    Acceptable Values: asteroid-high,asteroid-low,bunny,cat,cube,horse
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] use-vbo
    Description  : Whether to use VBOs for rendering
    Default Value: true
    Acceptable Values: false,true
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
[Scene] bump
  [Option] bump-render
    Description  : How to render bumps
    Default Value: off
    Acceptable Values: off,normals,normals-tangent,height,high-poly
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
[Scene] clear
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
[Scene] conditionals
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-conditionals
    Description  : Whether each computational step includes an if-else clause
    Default Value: true
    Acceptable Values: false,true
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] fragment-steps
    Description  : The number of computational steps in the fragment shader
    Default Value: 1
  [Option] grid-length
    Description  : The length of each side of the grid (normalized) (controls the area drawn to)
    Default Value: 5.0
  [Option] grid-size
    Description  : The number of squares per side of the grid (controls the number of vertices)
    Default Value: 32
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] vertex-conditionals
    Description  : Whether each computational step includes an if-else clause
    Default Value: true
    Acceptable Values: false,true
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] vertex-steps
    Description  : The number of computational steps in the vertex shader
    Default Value: 1
[Scene] desktop
  [Option] blur-radius
    Description  : the blur effect radius (in pixels)
    Default Value: 5
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] effect
    Description  : The effect to use
    Default Value: blur
    Acceptable Values: blur,shadow
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] passes
    Description  : the number of effect passes (effect dependent)
    Default Value: 1
  [Option] separable
    Description  : use separable convolution for the blur effect
    Default Value: true
    Acceptable Values: false,true
  [Option] shadow-size
    Description  : the size of the shadow (in pixels)
    Default Value: 20
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] window-size
    Description  : the window size as a percentage of the minimum screen dimension [0.0 - 0.5]
    Default Value: 0.35
  [Option] windows
    Description  : the number of windows
    Default Value: 4
[Scene] effect2d
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] kernel
    Description  : The convolution kernel matrix to use [format: "a,b,c...;d,e,f..."
    Default Value: 0,0,0;0,1,0;0,0,0
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] normalize
    Description  : Whether to normalize the supplied convolution kernel matrix
    Default Value: true
    Acceptable Values: false,true
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
[Scene] function
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-complexity
    Description  : The complexity of each computational step in the fragment shader
    Default Value: low
    Acceptable Values: low,medium
  [Option] fragment-function
    Description  : Whether each computational step includes a function call
    Default Value: true
    Acceptable Values: false,true
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] fragment-steps
    Description  : The number of computational steps in the fragment shader
    Default Value: 1
  [Option] grid-length
    Description  : The length of each side of the grid (normalized) (controls the area drawn to)
    Default Value: 5.0
  [Option] grid-size
    Description  : The number of squares per side of the grid (controls the number of vertices)
    Default Value: 32
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] vertex-complexity
    Description  : The complexity of each computational step in the vertex shader
    Default Value: low
    Acceptable Values: low,medium
  [Option] vertex-function
    Description  : Whether each computational step includes an if-else clause
    Default Value: true
    Acceptable Values: false,true
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] vertex-steps
    Description  : The number of computational steps in the vertex shader
    Default Value: 1
[Scene] ideas
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] speed
    Description  : Time coefficient (1.0 is "wall clock" speed, <1.0 is slower, >1.0 is faster).  A special value of "duration" computes this as a function of the "duration" option
    Default Value: duration
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
[Scene] jellyfish
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
[Scene] loop
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-function
    Description  : Whether to execute the steps in the vertex shader using a for loop
    Default Value: true
    Acceptable Values: false,true
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] fragment-steps
    Description  : The number of computational steps in the fragment shader
    Default Value: 1
  [Option] fragment-uniform
    Description  : Whether to use a uniform in the fragment shader for the number of loop iterations to perform (i.e. fragment-steps)
    Default Value: true
    Acceptable Values: false,true
  [Option] grid-length
    Description  : The length of each side of the grid (normalized) (controls the area drawn to)
    Default Value: 5.0
  [Option] grid-size
    Description  : The number of squares per side of the grid (controls the number of vertices)
    Default Value: 32
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] vertex-function
    Description  : Whether to execute the steps in the vertex shader using a for loop
    Default Value: true
    Acceptable Values: false,true
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] vertex-steps
    Description  : The number of computational steps in the vertex shader
    Default Value: 1
  [Option] vertex-uniform
    Description  : Whether to use a uniform in the vertex shader for the number of loop iterations to perform (i.e. vertex-steps)
    Default Value: true
    Acceptable Values: false,true
[Scene] pulsar
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] light
    Description  : Enable lighting
    Default Value: false
    Acceptable Values: false,true
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] quads
    Description  : Number of quads to render
    Default Value: 5
  [Option] random
    Description  : Enable random rotation speeds
    Default Value: false
    Acceptable Values: false,true
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] texture
    Description  : Enable texturing
    Default Value: false
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
[Scene] refract
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] index
    Description  : Index of refraction of the medium to simulate
    Default Value: 1.2
  [Option] interleave
    Description  : Whether to interleave vertex attribute data
    Default Value: false
    Acceptable Values: false,true
  [Option] model
    Description  : Which model to use
    Default Value: bunny
    Acceptable Values: asteroid-high,asteroid-low,bunny,cat,cube,horse
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] texture
    Description  : Which texture to use
    Default Value: nasa1
    Acceptable Values: asteroid-height-map,asteroid-normal-map,asteroid-normal-map-tangent,crate-base,desktop-shadow,desktop-shadow-corner,desktop-window,effect-2d,glyph-atlas,jellyfis
h-caustics-01,jellyfish-caustics-02,jellyfish-caustics-03,jellyfish-caustics-04,jellyfish-caustics-05,jellyfish-caustics-06,jellyfish-caustics-07,jellyfish-caustics-08,jellyfish-causti
cs-09,jellyfish-caustics-10,jellyfish-caustics-11,jellyfish-caustics-12,jellyfish-caustics-13,jellyfish-caustics-14,jellyfish-caustics-15,jellyfish-caustics-16,jellyfish-caustics-17,je
llyfish-caustics-18,jellyfish-caustics-19,jellyfish-caustics-20,jellyfish-caustics-21,jellyfish-caustics-22,jellyfish-caustics-23,jellyfish-caustics-24,jellyfish-caustics-25,jellyfish-
caustics-26,jellyfish-caustics-27,jellyfish-caustics-28,jellyfish-caustics-29,jellyfish-caustics-30,jellyfish-caustics-31,jellyfish-caustics-32,jellyfish256,nasa1,nasa2,nasa3,terrain-b
ackgrounddetailed6,terrain-grasslight-512,terrain-grasslight-512-nm
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] use-vbo
    Description  : Whether to use VBOs for rendering
    Default Value: true
    Acceptable Values: false,true
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
[Scene] shading
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] model
    Description  : Which model to use
    Default Value: cat
    Acceptable Values: asteroid-high,asteroid-low,bunny,cat,cube,horse
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] num-lights
    Description  : The number of lights applied to the scene (phong only)
    Default Value: 1
  [Option] shading
    Description  : Which shading method to use
    Default Value: gouraud
    Acceptable Values: gouraud,blinn-phong-inf,phong,cel
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
[Scene] shadow
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] interleave
    Description  : Whether to interleave vertex attribute data
    Default Value: false
    Acceptable Values: false,true
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] use-vbo
    Description  : Whether to use VBOs for rendering
    Default Value: true
    Acceptable Values: false,true
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
[Scene] terrain
  [Option] bloom
    Description  : Use bloom post-processing effect
    Default Value: true
    Acceptable Values: false,true
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] repeat-overlay
    Description  : How many times to repeat the terrain texture on the terrain plane (per side)
    Default Value: 6.0
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] tilt-shift
    Description  : Use tilt-shift post-processing effect
    Default Value: true
    Acceptable Values: false,true
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
[Scene] texture
  [Option] duration
    Description  : The duration of each benchmark in seconds
    Default Value: 10.0
  [Option] fps-pos
    Description  : The position on screen where to show FPS
    Default Value: -1.0,-1.0
  [Option] fps-size
    Description  : The width of each glyph for the FPS
    Default Value: 0.03
  [Option] fragment-precision
    Description  : The precision values for the fragment shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default
  [Option] model
    Description  : Which model to use
    Default Value: cube
    Acceptable Values: asteroid-high,asteroid-low,bunny,cat,cube,horse
  [Option] nframes
    Description  : The number of frames to render
    Default Value: 
  [Option] show-fps
    Description  : Show live FPS counter
    Default Value: false
    Acceptable Values: false,true
  [Option] texgen
    Description  : Whether to generate texcoords in the shader
    Default Value: false
    Acceptable Values: false,true
  [Option] texture
    Description  : Which texture to use
    Default Value: crate-base
    Acceptable Values: asteroid-height-map,asteroid-normal-map,asteroid-normal-map-tangent,crate-base,desktop-shadow,desktop-shadow-corner,desktop-window,effect-2d,glyph-atlas,jellyfis
h-caustics-01,jellyfish-caustics-02,jellyfish-caustics-03,jellyfish-caustics-04,jellyfish-caustics-05,jellyfish-caustics-06,jellyfish-caustics-07,jellyfish-caustics-08,jellyfish-causti
cs-09,jellyfish-caustics-10,jellyfish-caustics-11,jellyfish-caustics-12,jellyfish-caustics-13,jellyfish-caustics-14,jellyfish-caustics-15,jellyfish-caustics-16,jellyfish-caustics-17,je
llyfish-caustics-18,jellyfish-caustics-19,jellyfish-caustics-20,jellyfish-caustics-21,jellyfish-caustics-22,jellyfish-caustics-23,jellyfish-caustics-24,jellyfish-caustics-25,jellyfish-
caustics-26,jellyfish-caustics-27,jellyfish-caustics-28,jellyfish-caustics-29,jellyfish-caustics-30,jellyfish-caustics-31,jellyfish-caustics-32,jellyfish256,nasa1,nasa2,nasa3,terrain-b
ackgrounddetailed6,terrain-grasslight-512,terrain-grasslight-512-nm
  [Option] texture-filter
    Description  : The texture filter to use
    Default Value: nearest
    Acceptable Values: nearest,linear,linear-shader,mipmap
  [Option] title
    Description  : The scene title to show
    Default Value: 
  [Option] title-pos
    Description  : The position on screen where to show the title
    Default Value: -0.7,-1.0
  [Option] title-size
    Description  : The width of each glyph in the title
    Default Value: 0.03
  [Option] vertex-precision
    Description  : The precision values for the vertex shader ("int,float,sampler2d,samplercube")
    Default Value: default,default,default,default

5.4. Run a single scene during a given duration[edit | edit source]

glmark2-es2-wayland -b texture:texture-filter=nearest               # by default the scene duration is 10 seconds
glmark2-es2-wayland -b texture:texture-filter=nearest:duration=5.0  # set duration to 5 seconds
glmark2-es2-wayland -b texture:texture-filter=nearest --run-forever # repeat forever the 10-seconds scene

Find below the scene list to ease copy-paste with default scene parameters (note: refer to #Get all scenes list and related options chapter for more details):

build:use-vbo=false
build:use-vbo=true
texture:texture-filter=nearest
texture:texture-filter=linear
texture:texture-filter=mipmap
shading:shading=gouraud
shading:shading=blinn-phong-inf
shading:shading=phong
shading:shading=cel
bump:bump-render=high-poly
bump:bump-render=normals
bump:bump-render=height
effect2d:kernel=0,1,0;1,-4,1;0,1,0;
effect2d:kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;
pulsar:light=false:quads=5:texture=false
desktop:blur-radius=5:effect=blur:passes=1:separable=true:windows=4
desktop:effect=shadow:windows=4
buffer:columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map
buffer:columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata
buffer:columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map
ideas:speed=duration
jellyfish:
terrain:
shadow:
refract:
conditionals:fragment-steps=0:vertex-steps=0
conditionals:fragment-steps=5:vertex-steps=0
conditionals:fragment-steps=0:vertex-steps=5
function:fragment-complexity=low:fragment-steps=5
function:fragment-complexity=medium:fragment-steps=5
loop:fragment-loop=false:fragment-steps=5:vertex-steps=5
loop:fragment-steps=5:fragment-uniform=false:vertex-steps=5
loop:fragment-steps=5:fragment-uniform=true:vertex-steps=5

5.5. Use the GBM backend[edit | edit source]

The Mesa 3D[4] Generic Buffer Manager (GBM) is a memory allocator for display and gpu device buffers.

The glmark2 GBM backend is purely offscreen and requires no display or window system setup. The advantage is being able to run on systems with no display-related requirements, and providing GPU benchmark results completely independent of displays. It is of course not possible to visually see the results, as is already the case with other offscreen runs.

This backend can be helpful in, for instance: development systems, automated test runs, CI environments, or runs on headless remote systems[5].

glmark2-es2-gbm --winsys-options drm-device=/dev/dri/card0 # window size is by default 800x600

5.6. Run in debug mode[edit | edit source]

glmark2-es2-wayland --debug
Debug: Using eglGetPlatformDisplayEXT()
Debug: Got 20 suitable EGLConfigs:
Debug: 
Debug:     cfg buf  rgb  colorbuffer dp st config native support surface sample
Debug:      id  sz  lum  r  g  b  a  th cl caveat render  visid    type  buf ns
Debug: ------------------------------------------------------------------------
Debug:     0x1  16  rgb  4  4  4  4   0  0   None  false       0   0x505   0  0
Debug:     0x2  16  rgb  5  6  5  0   0  0   None   true       0   0x507   0  0
Debug:     0x3  16  rgb  4  4  4  4   0  8   None  false       0   0x505   0  0
Debug:     0x4  16  rgb  5  6  5  0   0  8   None   true       0   0x507   0  0
Debug:     0x5  16  rgb  4  4  4  4  16  0   None  false       0   0x505   0  0
Debug:     0x6  16  rgb  5  6  5  0  16  0   None   true       0   0x567   0  0
Debug:     0x7  16  rgb  4  4  4  4  24  0   None  false       0   0x505   0  0
Debug:     0x8  16  rgb  5  6  5  0  24  0   None   true       0   0x507   0  0
Debug:     0x9  16  rgb  4  4  4  4  24  8   None  false       0   0x505   0  0
Debug:     0xa  16  rgb  5  6  5  0  24  8   None   true       0   0x507   0  0
Debug:     0xb  24  rgb  8  8  8  0   0  0   None   true       0   0x507   0  0
Debug:     0xc  24  rgb  8  8  8  0   0  8   None   true       0   0x507   0  0
Debug:     0xd  24  rgb  8  8  8  0  16  0   None   true       0   0x567   0  0
Debug:     0xe  24  rgb  8  8  8  0  24  0   None   true       0   0x507   0  0
Debug:     0xf  24  rgb  8  8  8  0  24  8   None   true       0   0x507   0  0
Debug:    0x10  32  rgb  8  8  8  8   0  0   None   true       0   0x507   0  0
Debug:    0x11  32  rgb  8  8  8  8   0  8   None   true       0   0x507   0  0
Debug:    0x12  32  rgb  8  8  8  8  16  0   None   true       0   0x507   0  0
Debug:    0x13  32  rgb  8  8  8  8  24  0   None   true       0   0x507   0  0
Debug:    0x14  32  rgb  8  8  8  8  24  8   None   true       0   0x507   0  0
Debug: 
Debug: Best EGLConfig ID: 0x13
Info: =======================================================
Info:     glmark2 2023.01
Info: =======================================================
Info:     OpenGL Information
Info:     GL_VENDOR:      Vivante Corporation
Info:     GL_RENDERER:    Vivante GCNano
Info:     GL_VERSION:     OpenGL ES 2.0 V6.4.19.4.952875
Info:     Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0 samples=0
Info:     Surface Size:   800x600 windowed
Info: =======================================================
Debug: Loading vertex shader from file None:
Debug: #if defined(GL_ES)
Debug: #define HIGHP_OR_DEFAULT highp
Debug: #else
Debug: #define HIGHP_OR_DEFAULT
Debug: #endif
Debug: #if defined(GL_ES)
Debug: #define MEDIUMP_OR_DEFAULT mediump
Debug: #else
Debug: #define MEDIUMP_OR_DEFAULT
Debug: #endif
Debug: const vec4 MaterialDiffuse = vec4(1.000000, 1.000000, 1.000000, 1.000000);
Debug: const vec4 LightSourcePosition = vec4(20.000000, 20.000000, 10.000000, 1.000000);
Debug: attribute vec3 position;
Debug: attribute vec3 normal;
Debug: attribute vec2 texcoord;
Debug: 
Debug: uniform mat4 ModelViewProjectionMatrix;
Debug: uniform mat4 NormalMatrix;
Debug: 
Debug: varying vec4 Color;
Debug: varying vec2 TextureCoord;
Debug: 
Debug: void main(void)
Debug: {
Debug:     // Transform the normal to eye coordinates
Debug:     vec3 N = normalize(vec3(NormalMatrix * vec4(normal, 1.0)));
Debug: 
Debug:     // The LightSourcePosition is actually its direction for directional light
Debug:     vec3 L = normalize(LightSourcePosition.xyz);
Debug: 
Debug:     // Multiply the diffuse value by the vertex color (which is fixed in this case)
Debug:     // to get the actual color that we will use to draw this vertex with
Debug:     float diffuse = max(dot(N, L), 0.0);
Debug:     Color = vec4(diffuse * MaterialDiffuse.rgb, MaterialDiffuse.a);
Debug: 
Debug:     // Set the texture coordinates as a varying
Debug:     TextureCoord = texcoord;
Debug: 
Debug:     // Transform the position to clip coordinates
Debug:     gl_Position = ModelViewProjectionMatrix * vec4(position, 1.0);
Debug: }
Debug: Loading fragment shader from file None:
Debug: #if defined(GL_ES) && defined(GL_FRAGMENT_PRECISION_HIGH)
Debug: #define HIGHP_OR_DEFAULT highp
Debug: #else
Debug: #define HIGHP_OR_DEFAULT
Debug: #endif
Debug: #if defined(GL_ES)
Debug: #define MEDIUMP_OR_DEFAULT mediump
Debug: #else
Debug: #define MEDIUMP_OR_DEFAULT
Debug: #endif
Debug: #ifdef GL_ES
Debug: precision mediump float;
Debug: #endif
Debug: varying vec4 Color;
Debug: varying vec2 TextureCoord;
Debug: 
Debug: void main(void)
Debug: {
Debug:     gl_FragColor = Color;
Debug: }
Debug: Loading model from 3ds file '/usr/share/glmark2/models/horse.3ds'
Debug:     Object name: HORSE_L_Mate Vertex count: 3582 Face count: 7172
Info: [build] use-vbo=false: FPS: 88 FrameTime: 11.385 ms
Debug: Loading vertex shader from file None:
...

5.7. Use a different window resolution[edit | edit source]

glmark2-es2-wayland --size=640x480

5.8. Use a different DRM/KMS output resolution[edit | edit source]

In DRM/KMS mode (without Wayland), it may be useful to test different DRM/KMS output resolutions, especially when using HDMI modes.

systemctl stop weston-graphical-session
  • The DRM/KMS display mode needs to be set and the DRM master token released so that glmark2 can use the DRM interfaces. The command modetest with parameters can be used for that, for instance (note: The connector 34 and the mode #2 in the command below are given as example. It is possible to use modetest without options to get all available connectors and modes):
modetest -s 34:\#2 -d &
  • Launch glmark2:
glmark2-es2-drm

6. Source code location[edit | edit source]

7. To go further[edit | edit source]

You can find the full documentation of glmark2 in the related man page[6].

The glmark2 benchmark is part of the OpenBenchmarking[7] test suite: https://openbenchmarking.org/test/pts/glmark2

8. References[edit | edit source]