Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to solve the cpufreqset errors

I want to change the cpu frequency. I have install cpufrequtils. the command "cpufreq-info" give me information

cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to [email protected], please.
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 - 2.40 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 1.20 GHz and 2.40 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.

when I try to run the command: "sudo cpufreq-set -f 1500000". I am getting error:

Error setting new values. Common errors:
- Do you have proper administration rights? (super-user?)
- Is the governor you requested available and modprobed?
- Trying to set an invalid policy?
- Trying to set a specific frequency, but userspace governor is not available,
   for example because of hardware which cannot be set to a specific frequency
   or because the userspace governor isn't loaded?

Can you give any idea how to approach this problem?

like image 875
user2805242 Avatar asked Oct 20 '22 08:10

user2805242


1 Answers

Direct HOWTO answer

  1. Disable intel_pstate in grub configure file:

    $ sudo vi /etc/default/grub
    

    Append "intel_pstate=disable" to GRUB_CMDLINE_LINUX= option

  2. Refresh grub boot configuration file:

    For Ubuntu:

    $ sudo update-grub
    

    For Fedora:

    $ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    
  3. Reboot.

    $ sudo reboot
    
  4. Set CPU power governor to userspace:

    $ sudo cpupower frequency-set --governor userspace
    
  5. Set CPU frequency:

    $ sudo cpupower --cpu all frequency-set --freq 1.5GHz
    
  6. Verify:

    $ cpupower frequency-info
    

    You should see line: "current CPU frequency is 1.50 GHz."

Verbose Answer

The reason why you can't set CPU frequency is because of the driver you are using is "intel_pstate", which is the default driver now and only provides "performance" and "power save" policy. None of them supports directly manipulation of CPU frequency from user space. Also recent Intel CPU implements Hardware P-States, which is a hardware module that offloads monitoring CPU usage and regulating P states directly in CPU die.

So in order to control frequency as you wish, the option is to disable "intel_pstate" driver and use older "acpi-cpufreq" driver, which has "userspace" policy that allows CPU frequency control from userspace.

Since recent Linux Kernel build "intel_pstate" directly into the kernel instead of as a module, there is no easy way to "rmmod" it. So you have to provide kernel cmdline parameter "intel_pstate=disable" to do that.

More Info

https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt https://www.kernel.org/doc/Documentation/cpu-freq/intel-pstate.txt

like image 178
Wei Shen Avatar answered Nov 01 '22 13:11

Wei Shen