CPU not using boosted clock frequencies

,

Hello!

I recently found out my CPU (Ryzen 5 5600x) was not operating as boosted clock frequencies during heavy load (Observed when monitoring cpu freq. using mangohud when playing a game). Instead, the clock frequency was capped to the default base frequency. I made sure to check if everything was running in performance mode. I checked the following things:

  • CPU frequency governor was set to performance using corectrl
  • I’ve tried gamemoderun in steam arguments
  • /sys/devices/system/cpu/cpufreq/boost prints 1 to indicate that boost is enabled.

However, despite this, the following commands printed “3701000”, which is max base frequency:
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

I did end up finding a work around, which is to have a systemd script pipe echo 0 and then echo 1 into the cpufreq/boost file, which effectively turns that parameter on and off again upon boot. After this, the two commands above print the correct “4654288”, which is the correct boosted clock frequency for my CPU. As a result, my framerate almost doubled in games such as Read dead 2 and I had no more inconsistent frames in other game. It felt like my gpu was also able to have higher utilization at times.

Since I have sort of already solved this issue, my questions are:

  • Is this a known issue, and is there a known permanent solution
  • Does it sound like there is some larger bug with my system that might have caused this?
  • Is this something I should report in a bug forum?

I would gladly hear what people think. This is my first post here, so if I need to change anything up about it I’ll happily do so. Thank you for your help!

A CPU will only “Turbo” if the temperature of the core is low enough to precent hard to the chip.

The specs for your chip from AMD Ryzen™ 5 5600X Desktop Processors states:

Max. Boost Clock
    Up to 4.6 GHz 
Base Clock
    3.7 GHz 

Can you get to a terminal to run commands, maybe ssh into your system from another system?

What speed are you seeing? I would use sudo powertop for this.
What is the temperature of the CPU cores? I would user sensors for this.

I’m not sure where to look for speeds in powertop, which section should I be in and what should I read?

The average temperature of my cpu cores is around +53.8°C degrees idle. I think I’ve seen it go up to around 70-75 degrees when I was able to allow it to reach max clock frequencies.

I don’t think thermal throttling is the issue because even under normal load the frequency didn’t go up to the boost clock. Only after my fix was it able to do so, with no changes in temperature.

You can switch tabs in powertop by pressing TAB.
You want the “Frequencey stats” tab.

I think that the kernel needs to work out that turbo would be useful, but I’m not up to date on the details.

Given you do not seem to have thermal issues. You may have found a bug.
Your workaround strongly suggests its a problem.

Try raising in the Fedora bug tracker. The kernel maintain does read all the kernel bug reports, but as he is overloaded rarely replies, but fixes do get made.
See Making sure you're not a bot!

Seems like powertop isn’t showing me anything useful in that tab. Every core says 100% and idle. Found out that this might have something to do with the cpu frequency control driver I’m using, which isn’t compatible with how powertop fetches frequency data?

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
> amd-pstate-epp

So I’ll report the bug, and mention this driver as it might have something to do with how my system is not properly controlling the cpu’s maximum frequency.

Is amd-pstate-epp from Fedora or 3rd party?

I think 3rd party: amd-pstate CPU Performance Scaling Driver — The Linux Kernel documentation

Can you reproduce the issue after removing amd-pstate-epp?
kernel people will not even look at your bug if there is 3rd party stuff in the kernel.

I just investigated amd-pstate-epp and it seems like I have something else governing my cpu performance:

  tuned-ppd.service                            loaded active running PPD-to-TuneD API Translation Daemon
  tuned.service                                loaded active running Dynamic System Tuning Daemon

If I check the profile that it is using, it says “powersave”. Changing to balanced or performance allows CPU to reach boosted clocks again. I am confused about why it was on powersave because I have no memory of me changing it to that or even interacting with this service in the first place.

Nevermind, on restart the tuned-ppd.service goes back to powersave? Something is setting the service to powersave each time on reboot. Do you know what could be causing that problem?

Well.. it seems like the thing setting my power profile to powersave was simply a setting that I had changed in the power management settings tab. I thought it meant something else. Sorry for the trouble