linux设置CPU固定频率

设置linux系统cpu固定频率,报如下错误:

bash 复制代码
$ sudo cpufreq-set -c 0 -f 1000MHz
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?

从Ubuntu使用intel某些cpu的pc上默认使用intel_pstate cpufreq driver。后果就是只有performance和powersave两个governor可用。可通过下面命令确认:

bash 复制代码
$ 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: 4294.55 ms.
hardware limits: 800 MHz - 3.90 GHZ
available cpufreq governors: performance, powersave
current policy: frequency should be within 800 MHz and 3.90 GHz.
The governor "powersave" may decide which speed to use
within this range.
current CPU frequency is 800 MHz.
analyzing CPU 1:
driver: intel_pstate
CPUs which run at the same hardware frequency: 1
CPUs which need to have their frequency coordinated by software: 1
maximum transition latency: 4294.55 ms.
hardware limits: 800 MHz - 3.90 GHZ
available cpufreq governors: performance, powersave
current policy: frequency should be within 800 MHz and 3.90 GHz.
The governor "powersave" may decide which speed to use
within this range.
current CPU frequency is 802 MHz.

可以看到

driver: intel_pstate

available cpufreq governors: performance, powersave

禁用intel_pstate:

修改 /etc/default/grub中GRUB_CMDLINE_LINUX_DEFAULT内容

原始内容: GRUB_CMDLINE_LINUX_DEFAULT="quietsplash"

更改后的内容:GRUB_CMDLINE_LINUX_DEFAULT="quietsplash intel_pstate=disable"

更新grub :sudo update-grub

重启机器

设置cpu固定频率

sudo cpufreq-set -g userspace

sudo cpupower cpufreq-set -f 2G

查看cpu频率

cat /proc/cpuinfo | grep MH

相关推荐
鹏大师运维14 分钟前
为什么信创电脑装软件总提示“软件包架构不匹配”?
linux·运维·架构·国产化·麒麟·deb·统信uos
007张三丰31 分钟前
软件测试专栏(11/20):测试框架开发:pytest深度解析与插件体系
运维·服务器·自动化测试·pytest·测试框架
weixin_604236672 小时前
华三 路由器 极简核心配置
运维·服务器·网络·h3c·h3c路由器
鹤落晴春2 小时前
【Linux复习】管理SELinux安全性
linux·运维·服务器
yz_aiks2 小时前
Linux Jar包配置Systemd自启动实战:从排查到配置全流程
linux·python·jar·自启动·systemd
AI智图坊2 小时前
多件装组合SKU图的批量生产效率分析:从PS手工到AI自动化的工作流改造
大数据·运维·人工智能·gpt·ai作画·自动化·aigc
bjzhang754 小时前
CentOS下安装MySQL详解
linux·mysql·centos
Jason_chen5 小时前
Linux 6.2 音频机制深度解析:AI驱动的低延迟音频与零信任音频安全架构
linux
下午写HelloWorld5 小时前
Linux系统及Ubuntu常用指令
linux·ubuntu·操作系统
lizhihai_996 小时前
股市学习心得-AI 产业链核心标的梳理清单
大数据·服务器·人工智能·科技·学习