Debian Codegraph @

docs/drivers/panfrost/benchmarking.rst

raw
1 Benchmarking Panfrost
2 =====================
3
4 Obtaining reproducible benchmark timings can sometimes be tricky on Mali
5 based SoCs. There are a number of things that can be done to make the timings
6 more predictable.
7
8 Make sure the device is actively cooled (to eliminate thermal throttling)
9 -------------------------------------------------------------------------
10
11 This isn't strictly speaking necessary, if you use low enough frequencies
12 in the steps below, but it is recommended.
13
14 Fix the GPU frequency
15 ---------------------
16
17 If power management is allowed to vary the GPU frequency, this will lead to
18 uncertainty in benchmark figures, particularly for shorter benchmark runs.
19
20 On most systems, the GPU frequency can be set to a fixed value via a command
21 like the following (run it as root, sudo alone won't allow the redirection):
22
23 .. code-block:: sh
24
25 cat /sys/devices/platform/fb000000.gpu/devfreq/fb000000.gpu/min_freq > /sys/devices/platform/fb000000.gpu/devfreq/fb000000.gpu/max_freq
26
27 This forces the GPU to always use its minimum frequency. You could reverse
28 `min_freq` and `max_freq` to fix it to its maximum frequency, if your system
29 is adequately cooled.
30
31 Fix the CPU frequency
32 ---------------------
33
34 It is easy to overlook the role the CPU plays in driver performance. To set
35 its frequency to a fixed value, install the `linux-cpupower` package and
36 run something like:
37
38 .. code-block:: sh
39
40 sudo cpupower frequency-info
41 sudo cpupower frequency-set -d 1.20
42 sudo cpupower frequency-set -u 1.20
43 sudo cpupower frequency-info
44
45 Adjust the numbers based on what the board actually supports (seen in
46 the first `frequency-info`. It is best to choose fairly low settings
47 unless you're confident of the board's cooling.
48
49 Pin the benchmark program to a particular core
50 ----------------------------------------------
51
52 This is especially important on devices with a big.LITTLE architecture, where
53 having the benchmark be scheduled on a different kind of core can drastically
54 change the performance. But even without this, variations in cache residency
55 and scheduling of kernel tasks can lead to changes in benchmark timing.
56
57 Experience shows that using a little core for the benchmark program
58 tends to give more reproducible results (probably because they have smaller
59 caches, and also are less likely to be scheduled to by the kernel).
60 However, forcing the benchmark to run on a little core could change the
61 bottleneck from GPU to CPU, so watch out for that.
62
63 Pinning a task to a particular core is done with the `taskset` command. An
64 example for the Rock5b (rk3588) board is:
65
66 .. code-block:: sh
67
68 taskset 0x04 glmark2-es2-wayland
69
70 Replace `0x04` with an appropriate mask for your board, and
71 `glmark2-es2-wayland` with the benchmark program to be used.