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

相关推荐
守望时空3314 分钟前
使用NetworkManager替换当前网络管理器
linux·运维
MinterFusion15 分钟前
如何在开放麒麟(openKylin)下安装FTP服务器(v0.1.0)
运维·服务器·网络·vsftpd·开放麒麟·明德融创·openkylin
爱网安的monkey brother34 分钟前
Linux自用文档
linux
xlq223221 小时前
30.进程池IPC
linux·运维·服务器
nuomigege1 小时前
beagleboneblack刷入官方IOT镜像后无法运行nodered问题的处理
linux·运维·服务器
huaxiu51 小时前
ubuntu下应用打不开
linux·运维·ubuntu
m0_683124792 小时前
Ubuntu服务设置开机自启
linux·运维·ubuntu
BestOrNothing_20152 小时前
(1)双系统中Ubuntu22.04启动盘制作与启动盘恢复全过程
linux·ubuntu·双系统·启动盘制作·启动盘恢复
AI成长日志2 小时前
【实用工具教程】Linux常用命令速查与实战场景:文件操作、进程管理与网络调试高频命令解析
linux·php
落叶花开又一年2 小时前
检验检测机构资质认定远程评审工作程序
linux·运维·服务器