我编写了一个脚本来在 bash 中设置最低 CPU 频率,如下所示:
#!/bin/bash
echo -n "Processor min-freq"
echo -n Zadej minimální frekvenci procesoru
read val
echo $val > /sys/devices/system/cpu/cpu0/cpufreq/scalling_min_freq
echo $val > /sys/devices/system/cpu/cpu1/cpufreq/scalling_min_freq
echo $val > /sys/devices/system/cpu/cpu2/cpufreq/scalling_min_freq
echo $val > /sys/devices/system/cpu/cpu3/cpufreq/scalling_min_freq
echo $val > /sys/devices/system/cpu/cpu4/cpufreq/scalling_min_freq
echo $val > /sys/devices/system/cpu/cpu5/cpufreq/scalling_min_freq
echo "all done"
但它不起作用,这是终端的输出:
gandalf@gandalf-MS-7693 ~ $ sudo -s
gandalf-MS-7693 ~ # '/home/gandalf/Plocha/procesor-min-freq.sh'
Processor min-freqZadej minimální frekvenci procesoru1500000
/home/gandalf/Plocha/procesor-min-freq.sh: řádek 5: /sys/devices/system/cpu/cpu0/cpufreq/scalling_min_freq: Operation not permitted
/home/gandalf/Plocha/procesor-min-freq.sh: řádek 6: /sys/devices/system/cpu/cpu1/cpufreq/scalling_min_freq: Operation not permitted
/home/gandalf/Plocha/procesor-min-freq.sh: řádek 7: /sys/devices/system/cpu/cpu2/cpufreq/scalling_min_freq: Operation not permitted
/home/gandalf/Plocha/procesor-min-freq.sh: řádek 8: /sys/devices/system/cpu/cpu3/cpufreq/scalling_min_freq: Operation not permitted
/home/gandalf/Plocha/procesor-min-freq.sh: řádek 9: /sys/devices/system/cpu/cpu4/cpufreq/scalling_min_freq: Operation not permitted
/home/gandalf/Plocha/procesor-min-freq.sh: řádek 10: /sys/devices/system/cpu/cpu5/cpufreq/scalling_min_freq: Operation not permitted
all done
gandalf-MS-7693 ~ #
你有什么想法吗?我会提供很好的解决方案
答案1
固定的,在文件中找到原因:/etc/cpufreqd.conf
我重写了配置文件频率:性能高,原来是:
[轮廓] 名称 = Performance High 最小频率 = 100% 最大频率 = 100% 政策 = 绩效 #Exec_post = echo 8> /proc/acpi/sony/亮度 [/ 轮廓]
替换后:
[轮廓] 名称 = Performance High 最小频率 = 0% 最大频率 = 100% 政策 = 绩效 #Exec_post = echo 8> /proc/acpi/sony/亮度 [/ 轮廓]
问题解决之后就是游行:)
答案2
假设您使用的是英特尔 p-state 控制器,请执行以下命令
sudo cpupower frequency-set -d 1500kHz
如果你不使用 intel_pstate,那么
sudo apt install cpufrequtils
将下载一组实用程序,并且
sudo cpufreq-set -d 1500kHz
将设置最小频率