Cpupower doesn't set governor on boot

Hi,
I followed archwiki to set governor on boot to performance, but it doesn’t work.
My /etc/default/cpupower looks like this:

# Define CPUs governor
# valid governors: ondemand, performance, powersave, conservative, userspace.
governor='performance'

# Limit frequency range
# Valid suffixes: Hz, kHz (default), MHz, GHz, THz
#min_freq="2.25GHz"
#max_freq="3GHz"

# Specific frequency to be set.
# Requires userspace governor to be available.
# Do not set governor field if you use this one.
#freq=

# Utilizes cores in one processor package/socket first before processes are 
# scheduled to other processor packages/sockets.
# See man (1) CPUPOWER-SET for additional details.
#mc_scheduler=

# Utilizes thread siblings of one processor core first before processes are
# scheduled to other cores. See man (1) CPUPOWER-SET for additional details.
#smp_scheduler=

#  Sets a register on supported Intel processore which allows software to convey
# its policy for the relative importance of performance versus energy savings to
# the  processor. See man (1) CPUPOWER-SET for additional details.
#perf_bias=

# vim:set ts=2 sw=2 ft=sh et:

I enabled systemd service with sudo systemctl enable --now cpupower.service, yet after reboot this is cpupower frequency-info output:

analyzing CPU 0:
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: Cannot determine or is not supported.
hardware limits: 800 MHz - 4.30 GHz
available cpufreq governors: performance powersave
current policy: frequency should be within 800 MHz and 4.30 GHz.
The governor “powersave” may decide which speed to use
within this range.
current CPU frequency: Unable to call hardware
current CPU frequency: 4.10 GHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: yes

For my noob’s eye it looks like service works:

systemctl status cpupower

cpupower.service - Apply cpupower configuration
Loaded: loaded (/usr/lib/systemd/system/cpupower.service; enabled; vendor preset: disabled)
Active: active (exited) since Thu 2022-06-16 17:21:23 CEST; 14min ago
Process: 500 ExecStart=/usr/lib/systemd/scripts/cpupower (code=exited, status=0/SUCCESS)
Main PID: 500 (code=exited, status=0/SUCCESS)
CPU: 4ms
Jun 16 17:21:23 asusB560 systemd[1]: Starting Apply cpupower configuration…
Jun 16 17:21:23 asusB560 systemd[1]: Finished Apply cpupower configuration.

Do you by any chance use power-profiles-daemon.service?
If so, there might be some conflict which service is going to be in charge of the cpu scaling.

1 Like

I think that you found a culprit, power-profiles-daemon.service is indeed up and running.

  1. Could I safely disable it?
  2. I’m sure I didn’t enable it manually, is it something that comes turned on automatically with DE (Gnome in this case)? If yes something doesn’t work because before running cpupower.service, I tried to change power preferences in gnome settings and it was still powersave.

You could if you choose so. However you would lose the GUI integration of it in the Settings and also in the the dropdown “control menu” on the taskbar.

Yes.

I can’t know for sure what it might have been.

If you want to try:

sudo systemctl stop power-profiles-daemon.service
sudo systemctl restart cpupower.service

check:

cpupower frequency-info

If you are happy with the outcome, you would need to mask the daemon because it is a depenency of gnome-control-center and would restart at boot:

sudo systemctl mask power-profiles-daemon.service

If I remember correctly, you might get some warnings of a sort in your journals about the daemon not found or not being able to start or some such. You could ignore those.

If you want to revert the whole thing:

sudo systemctl unmask power-profiles-daemon.service

And then stop-disable the other one.

1 Like

I ran

sudo systemctl stop power-profiles-daemon.service
sudo systemctl restart cpupower.service

and

cpupower frequency-info
which changed governor to performance, so I did as you advised and run

sudo systemctl mask power-pofiles-daemon.service

However after reboot, governor changed back to powersave so either power-pofiles-daemon.service wasn’t a problem or I did something wrong.

I just noticed that I copied your commands with typo.

There should profiles instead of pofiles

1 Like

Sorry for that!

I was staring at the commands thinking that they should have worked and yet I missed the typo!

I will edit and correct it in my post.

And now it’s working!
Thanks a lot for support.

1 Like

You are welcome!
Glad you got it working!
:enos_flag:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.