Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set specific cpu frequency when using intel_pstate

Tags:

linux

x86

cpu

intel

When I am using intel_pstate, I found that I can not change the cpu frequency with command:

sudo cpupower frequency-set -f SomeValue

I know the reason is that intel_pstate's governors (powersave and performance) don't support changing frequency manually. Also I tried to write frequency value directly to the file /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq. But it says I'm changing a readonly file.

So is there a way to change a core's frequency when using intel_pstate driver?

like image 964
zzy Avatar asked May 12 '26 20:05

zzy


1 Answers

The intel_pstate driver running in one of the active modes doesn't allow you to set a particular frequency directly (cpupower frequency-set -f), but you can change the maximum and minimum frequencies the driver is allowed to set as follows:

With cpupower you can use:

cpupower frequency-set -u 3000mhz

… to set the maximum frequency for all cores. To set minimum frequency you can use

cpupower frequency-set -d 3000mhz

These commands require root privileges (executed with sudo).

In this example, the desired frequency 3000 MHz is applied to all cores. The actual frequency would be the closest supported frequency that is larger than (if possible) to the desired frequency. The actual active range of frequencies and current core frequency can determined from cpupower frequency-info.

Some processors support per-core frequency domains. You can specify a particular core or a set of cores with the -c option for which you want to change the frequency range.

like image 76
AlexM28 Avatar answered May 14 '26 16:05

AlexM28