raspberrypi / firmware

This repository contains pre-compiled binaries of the current Raspberry Pi kernel and modules, userspace libraries, and bootloader/GPU firmware.
5.19k stars 1.68k forks source link

[Raspberry Pi 4] Overclocking core_freq alone decreases performance #1818

Open MichaIng opened 1 year ago

MichaIng commented 1 year ago

Is this the right place for my bug report? This repository contains the GPU firmware used on the Raspberry Pi. This software is the closed source part of the Raspberry Pi system, it includes booting (including network booting and USB booting), low-level power and clock control, FKMS and legacy HDMI control (not full KMS that is in the linux kernel), hardware legacy codecs (MPEG2, H264 and VC1), encode hardware including the ISP (image sensor pipeline) and camera control, audio output (analogue and HDMI audio).

If you believe that the issue you are seeing is within this area, this is the right place. If not, we have other repositories for the linux kernel at github.com/raspberrypi/linux and Raspberry Pi userland applications at github.com/raspberrypi/userland. If you have problems with the Raspbian distribution packages, report them in the github.com/RPi-Distro/repo. If you simply have a question, then the Raspberry Pi forums are the best place to ask it.

Describe the bug When overclocking the core_freq alone on Raspberry Pi 4, e.g. to 600 or 700 MHz, while leaving gpu_freq untouched, the actual GPU performance, according to glmark2 is roughly halved.

To reproduce

  1. Remove all overclocking settings
  2. Run glmark2
  3. Set only core_freq=600
  4. Run glmark2
  5. Set only gpu_freq=600 or gpu_freq=600 + core_freq=600

Expected behaviour As the default is 500 MHz, with 4k enabled 550 MHz, one would expect overall GPU performance to be increased instead of dramatically reduced.

Actual behaviour Here are some benchmarks: https://dietpi.com/forum/t/core-freq-700-halves-graphics-performance-on-the-pi4/17221/4?u=michaing

An idea I have is that a misalignment between core and video block frequencies may cause the issue. On RPi 4, by default, the max/load clocks of all GPU blocks are the same, hence changing core_freq implies a misalignment. I am not technically versed to know whether those can affect each other this significantly, but it is the only idea I have. The official docs explicitly suggest to raise individual block frequencies rather than gpu_freq, so if the behaviour is expected, the docs should be changed or extended to explain the possible negative effect.

System Copy and paste the results of the raspinfo command in to this section. Alternatively, copy and paste a pastebin link, or add answers to the following questions:

Logs https://dietpi.com/forum/t/core-freq-700-halves-graphics-performance-on-the-pi4/17221/4?u=michaing

Additional context This was tested on Debian Bookworm userland, but kernel/firmware from Bullseye suite of archive.raspberrypi.org. It should not have an effect, but I am awaiting a test on RPi OS 64-bit Bullseye.

vanfanel commented 1 year ago

I can confirm this happens on RPi OS 64-bit Bullseye, too.