5

我想改变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?

你能告诉我如何解决这个问题吗?

4

2 回答 2

4

直接HOWTO回答

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

    $ sudo vi /etc/default/grub
    

    将“intel_pstate=disable”附加到 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。”

详细回答

不能设置CPU频率的原因是因为你使用的驱动是“intel_pstate”,它是现在的默认驱动,只提供“性能”和“省电”策略。它们都不支持从用户空间直接操纵 CPU 频率。最近的英特尔 CPU 还实现了硬件 P-States,这是一个硬件模块,可以直接在 CPU 芯片中卸载监控 CPU 使用情况和调节 P 状态。

因此,为了根据需要控制频率,选项是禁用“intel_pstate”驱动程序并使用较旧的“ acpi-cpufreq ”驱动程序,该驱动程序具有“用户空间”策略,允许从用户空间控制 CPU 频率。

由于最近的 Linux 内核将“intel_pstate”直接构建到内核中而不是作为一个模块,因此没有简单的方法来“rmmod”它。所以你必须提供内核命令行参数“intel_pstate=disable”来做到这一点。

更多信息

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

于 2016-03-23T06:56:30.623 回答
-1

尝试 sudo cpufreq-set -g 性能

于 2014-07-22T17:16:11.633 回答