Core_freq=700 halves graphics performance on the Pi4

Required Information

DietPi version:

G_DIETPI_VERSION_CORE=8
G_DIETPI_VERSION_SUB=18
G_DIETPI_VERSION_RC=2
G_GITBRANCH='master'
G_GITOWNER='MichaIng'
G_LIVE_PATCH_STATUS[0]='not applicable'
Distro version: bookworm 0
Kernel version: 6.1.21-v8+
Architecture: arm64
SBC model: RPi 4 Model B (aarch64)
Power supply used: Official Rpi4

Problem description

The config.txt parameter core_freq=700 set by dietpi-config dramatically reduces graphics performance.

Let’s take these basic overclocking settings:

over_voltage=4                                                                                                 
arm_freq=1800                                                                                                  
gpu_freq=600

Without core_freq=700:

=======================================================
                                  glmark2 Score: 957 
=======================================================

With core_freq=700:

=======================================================
                                  glmark2 Score: 514
=======================================================

So, please, prevent that setting from being put in config.txt by dietpi-config, at least for Pi4.

something for the developer @MichaIng to decide.

This seems like a firmware bug. The default core_freq is 500 MHz, with gpu_freq=600 you increase it to 600 MHz, along with the individual decoder video blocks. core_freq=700 should override only the GPU core frequency to 700 MHz, leaving the other video blocks at 600 MHz. But probably it unintentionally resets the other blocks as well.

Following benchmarks could help clarifying things:

  1. Without any overclocking setting, all defaults and gpu_freq removed
  2. Only core_freq=600, verifying that this increases score
  3. Only gpu_freq=600, verifying that this further increases score, as glmark2 seems to test decoder performance as well?
  4. gpu_freq=600 + core_freq=600 should give the same result as before, as gpu_freq implies core_freq and the latter is expected to be an override only for the GPU core
  5. gpu_freq=600 + core_freq=700 should give best results, as everything is the same as in 3. and 4. but the GPU core clocks higher

Does the benchmark give some more details about scores in different tasks/tests?

And did you rule out that it was throttled down due to too high CPU temperature?

For reference: Raspberry Pi Documentation - The config.txt file

@MichaIng

  1. Without any overclocking setting, all defaults and gpu_freq removed
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Broadcom
    GL_RENDERER:    V3D 4.2
    GL_VERSION:     OpenGL ES 3.1 Mesa 23.1.3
    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: 1022 FrameTime: 0.978 ms
[build] use-vbo=true: FPS: 1599 FrameTime: 0.626 ms
[texture] texture-filter=nearest: FPS: 1335 FrameTime: 0.749 ms
[texture] texture-filter=linear: FPS: 1307 FrameTime: 0.765 ms
[texture] texture-filter=mipmap: FPS: 1289 FrameTime: 0.776 ms
[shading] shading=gouraud: FPS: 1261 FrameTime: 0.793 ms
[shading] shading=blinn-phong-inf: FPS: 1007 FrameTime: 0.993 ms
[shading] shading=phong: FPS: 771 FrameTime: 1.298 ms
[shading] shading=cel: FPS: 733 FrameTime: 1.364 ms
[bump] bump-render=high-poly: FPS: 627 FrameTime: 1.596 ms
[bump] bump-render=normals: FPS: 1316 FrameTime: 0.760 ms
[bump] bump-render=height: FPS: 1204 FrameTime: 0.831 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 480 FrameTime: 2.084 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 237 FrameTime: 4.235 ms
[pulsar] light=false:quads=5:texture=false: FPS: 1396 FrameTime: 0.716 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 125 FrameTime: 8.035 ms
[desktop] effect=shadow:windows=4: FPS: 467 FrameTime: 2.146 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 180 FrameTime: 5.579 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 180 FrameTime: 5.561 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 219 FrameTime: 4.579 ms
[ideas] speed=duration: FPS: 836 FrameTime: 1.197 ms
[jellyfish] <default>: FPS: 445 FrameTime: 2.252 ms
[terrain] <default>: FPS: 30 FrameTime: 34.307 ms
[shadow] <default>: FPS: 111 FrameTime: 9.086 ms
[refract] <default>: FPS: 41 FrameTime: 24.797 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 1510 FrameTime: 0.662 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 771 FrameTime: 1.297 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 1438 FrameTime: 0.695 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 1108 FrameTime: 0.903 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 671 FrameTime: 1.492 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 1051 FrameTime: 0.952 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 1052 FrameTime: 0.951 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 642 FrameTime: 1.558 ms
=======================================================
                                  glmark2 Score: 800 
=======================================================
  1. Only core_freq=600, verifying that this increases score (SPOILER: NO, it halves it):
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Broadcom
    GL_RENDERER:    V3D 4.2
    GL_VERSION:     OpenGL ES 3.1 Mesa 23.1.3
    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: 890 FrameTime: 1.125 ms
[build] use-vbo=true: FPS: 973 FrameTime: 1.029 ms
[texture] texture-filter=nearest: FPS: 864 FrameTime: 1.159 ms
[texture] texture-filter=linear: FPS: 852 FrameTime: 1.174 ms
[texture] texture-filter=mipmap: FPS: 842 FrameTime: 1.188 ms
[shading] shading=gouraud: FPS: 762 FrameTime: 1.314 ms
[shading] shading=blinn-phong-inf: FPS: 599 FrameTime: 1.670 ms
[shading] shading=phong: FPS: 452 FrameTime: 2.215 ms
[shading] shading=cel: FPS: 429 FrameTime: 2.331 ms
[bump] bump-render=high-poly: FPS: 363 FrameTime: 2.757 ms
[bump] bump-render=normals: FPS: 814 FrameTime: 1.230 ms
[bump] bump-render=height: FPS: 752 FrameTime: 1.331 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 287 FrameTime: 3.491 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 139 FrameTime: 7.230 ms
[pulsar] light=false:quads=5:texture=false: FPS: 847 FrameTime: 1.181 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 78 FrameTime: 12.849 ms
[desktop] effect=shadow:windows=4: FPS: 301 FrameTime: 3.325 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 156 FrameTime: 6.419 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 159 FrameTime: 6.294 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 180 FrameTime: 5.556 ms
[ideas] speed=duration: FPS: 607 FrameTime: 1.650 ms
[jellyfish] <default>: FPS: 261 FrameTime: 3.844 ms
[terrain] <default>: FPS: 19 FrameTime: 53.474 ms
[shadow] <default>: FPS: 91 FrameTime: 11.003 ms
[refract] <default>: FPS: 29 FrameTime: 34.910 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 906 FrameTime: 1.105 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 453 FrameTime: 2.209 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 859 FrameTime: 1.165 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 655 FrameTime: 1.528 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 393 FrameTime: 2.545 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 622 FrameTime: 1.610 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 621 FrameTime: 1.612 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 377 FrameTime: 2.657 ms
=======================================================
                                  glmark2 Score: 503 
=======================================================
  1. Only gpu_freq=600, verifying that this further increases score, as glmark2 seems to test decoder performance as well?
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Broadcom
    GL_RENDERER:    V3D 4.2
    GL_VERSION:     OpenGL ES 3.1 Mesa 23.1.3
    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: 1144 FrameTime: 0.874 ms
[build] use-vbo=true: FPS: 1915 FrameTime: 0.522 ms
[texture] texture-filter=nearest: FPS: 1580 FrameTime: 0.633 ms
[texture] texture-filter=linear: FPS: 1539 FrameTime: 0.650 ms
[texture] texture-filter=mipmap: FPS: 1516 FrameTime: 0.660 ms
[shading] shading=gouraud: FPS: 1512 FrameTime: 0.662 ms
[shading] shading=blinn-phong-inf: FPS: 1212 FrameTime: 0.826 ms
[shading] shading=phong: FPS: 932 FrameTime: 1.074 ms
[shading] shading=cel: FPS: 885 FrameTime: 1.131 ms
[bump] bump-render=high-poly: FPS: 765 FrameTime: 1.308 ms
[bump] bump-render=normals: FPS: 1579 FrameTime: 0.633 ms
[bump] bump-render=height: FPS: 1447 FrameTime: 0.691 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 577 FrameTime: 1.734 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 284 FrameTime: 3.524 ms
[pulsar] light=false:quads=5:texture=false: FPS: 1670 FrameTime: 0.599 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 150 FrameTime: 6.690 ms
[desktop] effect=shadow:windows=4: FPS: 553 FrameTime: 1.810 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 190 FrameTime: 5.287 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 195 FrameTime: 5.139 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 238 FrameTime: 4.218 ms
[ideas] speed=duration: FPS: 858 FrameTime: 1.166 ms
[jellyfish] <default>: FPS: 541 FrameTime: 1.849 ms
[terrain] <default>: FPS: 35 FrameTime: 29.370 ms
[shadow] <default>: FPS: 118 FrameTime: 8.499 ms
[refract] <default>: FPS: 46 FrameTime: 22.195 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 1814 FrameTime: 0.551 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 933 FrameTime: 1.073 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 1728 FrameTime: 0.579 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 1342 FrameTime: 0.745 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 812 FrameTime: 1.232 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 1277 FrameTime: 0.783 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 1277 FrameTime: 0.784 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 779 FrameTime: 1.285 ms
=======================================================
                                  glmark2 Score: 951 
=======================================================
  1. gpu_freq=600 + core_freq=600 should give the same result as before, as gpu_freq implies core_freq and the latter is expected to be an override only for the GPU core

=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Broadcom
    GL_RENDERER:    V3D 4.2
    GL_VERSION:     OpenGL ES 3.1 Mesa 23.1.3
    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: 1093 FrameTime: 0.916 ms
[build] use-vbo=true: FPS: 1906 FrameTime: 0.525 ms
[texture] texture-filter=nearest: FPS: 1575 FrameTime: 0.635 ms
[texture] texture-filter=linear: FPS: 1540 FrameTime: 0.649 ms
[texture] texture-filter=mipmap: FPS: 1522 FrameTime: 0.657 ms
[shading] shading=gouraud: FPS: 1514 FrameTime: 0.661 ms
[shading] shading=blinn-phong-inf: FPS: 1216 FrameTime: 0.823 ms
[shading] shading=phong: FPS: 931 FrameTime: 1.074 ms
[shading] shading=cel: FPS: 888 FrameTime: 1.127 ms
[bump] bump-render=high-poly: FPS: 765 FrameTime: 1.307 ms
[bump] bump-render=normals: FPS: 1581 FrameTime: 0.633 ms
[bump] bump-render=height: FPS: 1445 FrameTime: 0.692 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 578 FrameTime: 1.731 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 284 FrameTime: 3.525 ms
[pulsar] light=false:quads=5:texture=false: FPS: 1677 FrameTime: 0.596 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 150 FrameTime: 6.695 ms
[desktop] effect=shadow:windows=4: FPS: 553 FrameTime: 1.809 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 189 FrameTime: 5.318 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 193 FrameTime: 5.188 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 233 FrameTime: 4.302 ms
[ideas] speed=duration: FPS: 848 FrameTime: 1.180 ms
[jellyfish] <default>: FPS: 542 FrameTime: 1.847 ms
[terrain] <default>: FPS: 35 FrameTime: 29.378 ms
[shadow] <default>: FPS: 118 FrameTime: 8.506 ms
[refract] <default>: FPS: 46 FrameTime: 22.212 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 1810 FrameTime: 0.552 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 933 FrameTime: 1.072 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 1733 FrameTime: 0.577 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 1343 FrameTime: 0.745 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 813 FrameTime: 1.231 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 1273 FrameTime: 0.786 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 1275 FrameTime: 0.784 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 778 FrameTime: 1.286 ms
=======================================================
                                  glmark2 Score: 949 
=======================================================
  1. gpu_freq=600 + core_freq=700 should give best results, as everything is the same as in 3. and 4. but the GPU core clocks higher (SPOILER: NO)
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Broadcom
    GL_RENDERER:    V3D 4.2
    GL_VERSION:     OpenGL ES 3.1 Mesa 23.1.3
    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: 1014 FrameTime: 0.986 ms
[build] use-vbo=true: FPS: 1158 FrameTime: 0.864 ms
[texture] texture-filter=nearest: FPS: 1015 FrameTime: 0.985 ms
[texture] texture-filter=linear: FPS: 998 FrameTime: 1.002 ms
[texture] texture-filter=mipmap: FPS: 989 FrameTime: 1.012 ms
[shading] shading=gouraud: FPS: 899 FrameTime: 1.113 ms
[shading] shading=blinn-phong-inf: FPS: 710 FrameTime: 1.409 ms
[shading] shading=phong: FPS: 536 FrameTime: 1.866 ms
[shading] shading=cel: FPS: 509 FrameTime: 1.965 ms
[bump] bump-render=high-poly: FPS: 431 FrameTime: 2.321 ms
[bump] bump-render=normals: FPS: 961 FrameTime: 1.041 ms
[bump] bump-render=height: FPS: 888 FrameTime: 1.127 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 341 FrameTime: 2.940 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 165 FrameTime: 6.085 ms
[pulsar] light=false:quads=5:texture=false: FPS: 1004 FrameTime: 0.996 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 92 FrameTime: 10.882 ms
[desktop] effect=shadow:windows=4: FPS: 353 FrameTime: 2.833 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 167 FrameTime: 5.995 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 171 FrameTime: 5.863 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 200 FrameTime: 5.023 ms
[ideas] speed=duration: FPS: 697 FrameTime: 1.435 ms
[jellyfish] <default>: FPS: 308 FrameTime: 3.249 ms
[terrain] <default>: FPS: 22 FrameTime: 46.139 ms
[shadow] <default>: FPS: 99 FrameTime: 10.126 ms
[refract] <default>: FPS: 33 FrameTime: 31.009 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 1074 FrameTime: 0.931 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 539 FrameTime: 1.858 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 1019 FrameTime: 0.981 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 777 FrameTime: 1.287 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 468 FrameTime: 2.138 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 738 FrameTime: 1.356 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 738 FrameTime: 1.357 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 447 FrameTime: 2.239 ms
=======================================================
                                  glmark2 Score: 591 
=======================================================

Does the benchmark give some more details about scores in different tasks/tests?

Yes, you can see them in this post.

And did you rule out that it was throttled down due to too high CPU temperature?

Yep. No throttling at all.

1 Like

Okay, very interesting, so whenever core_freq is set to anything different than gpu_freq, if decreases performance. On RPi 4, GPU core and decoder blocks share the same (maximum/load) frequency. Probably those frequencies somehow can negatively affect each other when not aligned? However, video deciding/encoding does not seem to be tested by glmark2 (by default). I am not sure if any of the tests involves the V3D driver? drm/v3d Broadcom V3D Graphics Driver — The Linux Kernel documentation

The performance penalty is quite similar across all tests, including those which are definitely 2D. So I do not think that any of the video blocks frequency is somehow reduced, but that the GPU core performance is somehow negatively effected by the non-aligned clocks.

On other RPi models, the defaults are already different, so this is an issue with the RPi 4 only. We could address it by simply setting gpu_freq instead of core_freq, but we might not be able to overclock it by the same amount with same stability. The docs even state:

  • It is recommended when overclocking to use the individual frequency settings (isp_freq, v3d_freq etc) rather than gpu_freq because the maximum stable frequency will be different for ISP, V3D, HEVC etc.

hence suggest to cause the misalignment. Needs to be reported to RPi engineers.

Just to be sure, you have the latest kernel and firmware installed, right?

vcgencmd version
uname -a

And it should not have an effect, but could someone test this on Bullseye, at best an RPi OS 64-bit Bullseye image?

@MichaIng

Apr 25 2023 18:26:03 
Copyright (c) 2012 Broadcom
version d7f9c2b4ef7e4a8c0b04374a879ce89d7a948453 (clean) (release) (start)
Linux debian 6.1.34-v8+ #1657 SMP PREEMPT Fri Jun 16 12:36:29 BST 2023 aarch64 GNU/Linux

And yes, the exact same thing happens on Bullseye.

In fact, thinking on it, this isn’t even a DietPi problem, but a Kernel/firmware problem apparently, so I am taking this to the raspberrypi github issue section.
But for now, I wouldn’t use core_freq in Dietpi., whatever the docs say.

1 Like

Reported: [Raspberry Pi 4] Overclocking core_freq alone decreases performance · Issue #1818 · raspberrypi/firmware · GitHub

Where did you get this kernel version from? The latest APT package ships v6.1.21.

dpkg-query -s raspberrypi-kernel

It comes from rpi-update.

1 Like

Good, with RPi OS 64-bit test we then know that current release as well as latest master both suffer from this.

Yes, it’s an rpi foundation thing :slight_smile: