6

I am trying to set to a specific frequency in cpu governor. However, I am not being able to do so. My processor is 12*Intel(R) Xeon (R) CPU E5-2620 v3 @2.40 GHz

With intel_pstate driver it gives freq range of 1.20 GHz -3.20 GHz. The current freq scaling, I can not set to a specific freq. I set the governor to performance. But it does not help. cpufreq-set -r -f 3.2GHz –does not work;

I tried to set the lower freq; cpufreq-set -r -d 3.2GHz; does not show any error, but even then the freq keeps on varying with time.

I disabled intel_pstate (on boot) and activated acpi driver. But with acpi, the max I can get is 2.4 GHz at 12 cores. This 2.4 GHz, I can make stable all the time with cpufreq-set -r -f. But I can not set it to 3.2 GHz.

Could anyone please tell me how to set use the cpugovernor, so I can set frequency to 3.2 GHz? My OS is ubuntu 14.4.3 LTS and kernel version is 3.19.0-25-generic.

The cpufreq-info shows the following result.

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: 0.97 ms.
  hardware limits: 1.20 GHz - 3.20 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 3.20 GHz and 3.20 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 2.85 GHz.

For other cores also, the results are like this and current freq varies with time.

screenshot_i7z

pstate freq screenshot

4
  • 1
    use i7z to get a more accurate reading
    – mchid
    Nov 15, 2015 at 17:09
  • I checked with i7z. The result is the same. The cpu current freq is varying with time. Is there any way to make freq stable? I attached a screenshot. Please have a look. Nov 16, 2015 at 17:16
  • You can disable pstate and use cpufreq-indicator but you really only have the option to throttle I think. Again you have options like performance and such but also have individual frequency options as well.
    – mchid
    Nov 16, 2015 at 19:15
  • askubuntu.com/questions/1187564/… may help
    – rogerdpack
    Jan 25, 2020 at 7:41

3 Answers 3

4

It is not possible for your processor to always be at your max turbo rate of 3200MHz all the time. If you have many cores active at once, then the max frequency will be only 2.6Ghz, and that limit is fundamental within the processor itself (see also your i7z screenshot - Max Turbo Multiplier line). However you can easily pretty much have all CPUs always at 2.6 GHz by setting the min and max percent numbers accordingly. However, note that you will still observe sometimes less frequency, as the processor can back off by itself under very low load conditions. Even easier would be to set turbo to off and performance mode, effectively makes all CPU run at 2.4 GHz all the time (but again, the processor itself can back off under extremely low load).

Example for setting 2.6Ghz (if I did my math properly):

echo "81" | sudo tee /sys/devices/system/cpu/intel_pstate/max_perf_pct
echo "81" | sudo tee /sys/devices/system/cpu/intel_pstate/min_perf_pct

Example for the non-turbo method:

echo "1" | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo
$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
powersave
powersave
powersave
powersave
powersave
powersave
powersave
powersave
$ sudo su
# for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo "performance" > $file; done
# exit
exit
$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
performance
performance
performance
performance
performance
performance
performance
performance
4
  • Thanks, I got the point. Actually my application require more processing speed. Yes, I can set freq to 2.4 GHz all the cores even with acpi. But as the application requires more so I was trying to check the possibility if somehow I can set to constant 3 or 3.2 GHz. However, thanks a lot Doug, Flatron and mchid. Nov 26, 2015 at 17:04
  • Then just basic performance mode, with either the intel_pstate or the acpi-cpufreq frequency scaling drivers, it doesn't matter which one, will give you the best processing speed overall for your system. Nov 26, 2015 at 17:13
  • Keep in mind that your initial statement isn't always true. With features in the BIOS of certain server manufacturers (Dell, for example), it's possible to peg your CPUs to a fixed Turbo above the stock speed. Dell calls this option "Dell Controlled Turbo". Otherwise a great answer. :)
    – Boscoe
    Dec 20, 2018 at 16:48
  • Doug I think the newest answer below is worth a look Mar 18, 2021 at 21:38
2

There is a command line tool for that called pstate-frequency.

To install it, simply follow the instructions in the repository.

What the script does is that it allows you to tell your CPU your preferred settings regarding clock speed, governor and turbo boost.

But keep in mind, since newer Intel CPU's are highly optimized and do power management on their own you cannot force your CPU, rather suggest what you want.

See this from the description of pstate-frequency:

For contemporary Intel processors, the frequency is controlled by the processor itself and the P-states exposed to software are related to performance levels. The idea that frequency can be set to a single frequency is fiction for Intel Core processors. Even if the scaling driver selects a single P state the actual frequency the processor will run at is selected by the processor itself.

To get the highest possible clock speed (permanently 3.2 GHz (ideally)) and the performance governor execute this after installing the script:

sudo pstate-frequency --color -S -p 3

You can use pstate-frequency -G --color to get your currently set power plan.

For me using a intel i7-4790K I get permanently 4400 MHz with all cores.

To check your current CPU clock you can use:

watch -n 0,3 'cat /proc/cpuinfo | grep "MHz"'

This will list the clock speed of all your CPU threads.

In my case after setting power plan '3' ([...] -p 3) (performance) I get:

cpu MHz     : 4399.843
cpu MHz     : 4400.156
cpu MHz     : 4391.093
cpu MHz     : 4400.000
cpu MHz     : 4400.000
cpu MHz     : 4400.468
cpu MHz     : 4400.156
cpu MHz     : 4361.718
3
  • 2
    Hi..thanks for the suggestions.i tried with pstate, but the result is the same. when i put the cpu governor to max performance it shows min freq 3200 MHz, but when i watch the current cpu freq, i see it changes all the time between 1.5 to 3.2 GHz. Is there any other way to solve this problem? For example, changing any setting in bios or using any other cpu governor? Nov 26, 2015 at 16:27
  • 1
    Underrated answer. You need to insert intel_pstate=enable into the /etc/grub/default though (after quiet splash) Aug 1, 2017 at 11:29
  • Only works though if the CPU supports p_states. Not all Intel CPUs do.. Had to find this out the hard way ;)
    – Flatron
    Aug 17, 2017 at 4:57
1

With an Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz and an active intel_pstate/status I was only able to set the max frequency - it would still fluctuate between the hardware min freq. (1,2 GHz) and my set max-freq.. I was able to solve that by setting the passive mode beforehand.

echo passive > /sys/devices/system/cpu/intel_pstate/status
cpupower frequency-set --min 2400MHz --max 2400MHz

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.