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

相关推荐
ccice0122 分钟前
硬核实战:调用Gemini多模态管道,直击办公中的图表解析、发票识别与自动化脚本生成(国内镜像免费方案)
运维·自动化
爱喝水的鱼丶23 分钟前
SAP-ABAP:数据类型与数据对象(8篇) 第七篇:进阶优化篇——基于类型与对象特征的性能优化技巧
运维·数据库·学习·性能优化·sap·abap·开发交流
程序员榴莲27 分钟前
网络编程入门 Python Socket 实现一个简单的用户认证系统
服务器·网络·python
ZStack开发者社区33 分钟前
全球化2.0 | ZStack亮相印尼云计算与数据中心大会 以新一代云底座助力数字印尼建设
服务器·云计算·gpu算力
DFT计算杂谈39 分钟前
VASP新手入门: IVDW 色散修正参数
linux·运维·服务器·python·算法
楼兰公子1 小时前
《深入理解Linux网络技术内幕》配套学习大纲 + 源码Demo + 进阶实战实例
linux·arm开发·学习
programhelp_1 小时前
Google 2026 New Grad SDE VO 三轮面试详解 | 含Behavioral、Coding、Design
java·服务器·数据库
qq_366032781 小时前
Claude API中转怎么选?简易api下的国内接入与兼容 OpenAI 接口实践
大数据·运维·人工智能
Donk_671 小时前
HAProxy实验搭建
运维·负载均衡
樱桃花下的小猫1 小时前
腐蚀Rust-服务器插件模组教程
服务器·新手友好·云鸢互联·零门槛一键开服·腐蚀rust