如何解决cpufreqset错误 [英] how to solve the cpufreqset errors

查看:0
本文介绍了如何解决cpufreqset错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改CPU频率。我已经安装了cpufurtils。 命令"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?

您能告诉我如何处理这个问题吗?

推荐答案

直接操作指南

  1. 禁用GRUB配置文件中的intel_pstate:

    $ sudo vi /etc/default/grub
    

    将"INTEL_PSTATE=DISABLE"附加到GRUB_CMDLINE_LINUX=OPTION

  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-State,这是一个硬件模块,用于卸载监控CPU使用情况并直接在CPU芯片中调节P状态。

因此,为了如您所愿地控制频率,该选项是禁用"intel_pState"驱动程序,而使用较旧的"aci-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

这篇关于如何解决cpufreqset错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆