如何解决cpufreqset错误

时间:2014-05-07 19:30:35

标签: kernel driver frequency cpu-speed

我想改变cpu频率。我已经安装了cpufrequtils。 命令" cpufreq-info"给我信息

cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, 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.

当我尝试运行命令时:" sudo cpufreq-set -f 1500000"。我收到了错误:

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?

你能说出如何处理这个问题吗?

2 个答案:

答案 0 :(得分:2)

直接回答

  1. 在grub配置文件中禁用intel_pstate:

    $ sudo vi /etc/default/grub
    

    追加" intel_pstate =禁用"到GRUB_CMDLINE_LINUX =选项

  2. 刷新grub引导配置文件:

    对于Ubuntu:

    $ sudo update-grub
    

    对于Fedora:

    $ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    
  3. 重新启动。

    $ sudo reboot
    
  4. 将CPU电源调控器设置为用户空间:

    $ sudo cpupower frequency-set --governor userspace
    
  5. 设置CPU频率:

    $ sudo cpupower --cpu all frequency-set --freq 1.5GHz
    
  6. 验证

    $ cpupower frequency-info
    

    您应该看到以下行:"当前CPU频率为1.50 GHz。"

  7. 详细答案

    您无法设置CPU频率的原因是因为您使用的驱动程序是" intel_pstate",这是现在的默认驱动程序,仅提供"性能"和#34;节电"政策。它们都不支持直接从用户空间操纵CPU频率。此外,最近的英特尔CPU实现了硬件P状态,这是一个硬件模块,可以卸载监视CPU使用情况并直接在CPU芯片中调节P状态。

    因此,为了根据需要控制频率,可以选择禁用" intel_pstate"司机和使用旧的" acpi-cpufreq "驱动程序,具有" 用户空间"允许来自用户空间的CPU频率控制的策略。

    自最近的Linux内核构建" intel_pstate"直接进入内核而不是作为一个模块,没有简单的方法去" rmmod"它。所以你必须提供内核cmdline参数" intel_pstate = disable"这样做。

    更多信息

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

答案 1 :(得分:-1)

尝试sudo cpufreq-set -g performance