how to solve the cpufreqset errors
Asked Answered
H

2

6

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?

Hernia answered 7/5, 2014 at 19:30 Comment(1)
This question appears to be off-topic because it is about configuring CPU governors under Linux. should be moved to unix.seBelsen
D
7

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

Deadeye answered 23/3, 2016 at 6:56 Comment(3)
To install cpupower, this worked for me.Audreaaudres
Followed all the steps on my Dell Precision with Ubuntu 18.04. It seemed to all be going fine and the second last step said Setting cpu: 0, Setting cpu: 1, etc. Then when I did the final step, I got output: current CPU frequency: Unable to call hardware and below that current CPU frequency: 581 MHz (asserted by call to kernel).Audreaaudres
$ cpupower frequency-info consider running this with sudo else the frequency readings might be wrongKei
S
0

Try sudo cpufreq-set -g performance

Simulated answered 22/7, 2014 at 17:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.