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

相关推荐
0vvv014 分钟前
删除wsl环境下的Ubuntu系统
linux·运维·ubuntu
@土豆18 分钟前
Ubuntu 22.04 运行 Filebeat 7.11.2 崩溃问题分析及解决文档
linux·数据库·ubuntu
C++ 老炮儿的技术栈32 分钟前
GCC编译时无法向/tmp 目录写入临时汇编文件,因为设备空间不足,解决
linux·运维·开发语言·汇编·c++·git·qt
Agent产品评测局44 分钟前
企业数据处理自动化落地,抓取分析全流程实现方案 —— 2026企业级智能体选型与技术路径深度解析
运维·人工智能·ai·自动化
autumn20051 小时前
Flutter 框架跨平台鸿蒙开发 - 历史人物对话
服务器·flutter·华为·harmonyos
爱莉希雅&&&1 小时前
linux中MySQL数据库备份恢复的四种方法(更新中)
linux·数据库·mysql·数据库备份·mysqldumper
我科绝伦(Huanhuan Zhou)1 小时前
分享一个网络智能运维系统
运维·网络
鬼先生_sir1 小时前
Spring Cloud 微服务监控实战:SkyWalking + Prometheus+Grafana 全栈解决方案
运维·spring cloud·grafana·prometheus·skywalking
信创DevOps先锋1 小时前
DevOps工具链选型新趋势:本土化适配与安全可控成企业核心诉求
运维·安全·devops
coppher1 小时前
Ubuntu 22.04 amd64 离线安装 Docker 完整教程
linux·docker