【提问】限制CPU主频
Tofloor
poster avatar
y5284037
deepin
2017-11-30 21:08
Author
请问deepin里有没有类似windows一样对处理器最大电源,最小电源设置的选项?或者有没有别的源添加获取软件的?
刚入坑linux没多久,求问各位大大。
因为我的处理器是i7的,现在不打游戏不想他超频,打算限制电源最大在99%
Reply Favorite View the author
All Replies
avatar
yanbowen
deepin
Community Developer
2017-11-30 21:51
#1
安装 linux-cpupower 用它来限制 cpu 频率
Reply View the author
avatar
y5284037
deepin
2017-11-30 22:34
#2
https://bbs.deepin.org/post/149229
安装 linux-cpupower 用它来限制 cpu 频率

请问这个软件是每次开机都要重新限制还是一次性到位?
Reply View the author
avatar
yanbowen
deepin
Community Developer
2017-11-30 22:42
#3
https://bbs.deepin.org/post/149229
请问这个软件是每次开机都要重新限制还是一次性到位?

每次开机是处理
Reply View the author
avatar
186******60
deepin
2017-11-30 23:27
#4
目前比较省事的解决办法是安装 tlp ,里边可以设置好cpu调度策略,以及限制cpu最大,最小频率,设置好后一劳永逸,不用每次都手动调整,省事
Reply View the author
avatar
y5284037
deepin
2017-11-30 23:43
#5
https://bbs.deepin.org/post/149229
目前比较省事的解决办法是安装 tlp ,里边可以设置好cpu调度策略,以及限制cpu最大,最小频率,设置好后一 ...

tlp是什么..我是小白,不是很懂
Reply View the author
avatar
186******60
deepin
2017-12-01 00:00
#6
本帖最后由 deepinlwh 于 2017-11-30 16:01 编辑
https://bbs.deepin.org/post/149229
tlp是什么..我是小白,不是很懂

sudo apt-get install tlpsudo tlp start
sudo gedit /etc/default/tlp

里边有这么这么一段:
# Set the min/max frequency available for the scaling governor.
# Possible values strongly depend on your CPU. For available frequencies see
# the output of tlp-stat -p.
#CPU_SCALING_MIN_FREQ_ON_AC=0
#CPU_SCALING_MAX_FREQ_ON_AC=0
#CPU_SCALING_MIN_FREQ_ON_BAT=0
#CPU_SCALING_MAX_FREQ_ON_BAT=0


Reply View the author
avatar
wangqizai1918
deepin
2017-12-01 00:28
#7
Reply View the author
avatar
id9502
deepin
2017-12-01 00:38
#8
本帖最后由 id9502 于 2017-11-30 17:03 编辑

超级推荐cpufreqd,可以根据电池电量、设备温度、使用的软件等,制定CPU运行模式、频率、屏幕亮度、显卡开关等等(可以执行自定义脚本)
安装方法:
  1. sudo apt-get install cpufreqd
Copy the Code
创建/修改配置文件:
  1. sudo vim /etc/cpufreqd.conf
Copy the Code
我的配置 [Debian 9@ Dell XPS15 9560](/etc/cpufreqd.conf):插入电源则火力全开;电池模式则电量多时候正常,电量少时候限频到最低并调低屏幕亮度;任何时候如果CPU过热则开启降频。
  1. [General]
  2. pidfile=/var/run/cpufreqd.pid
  3. poll_interval=2
  4. verbosity=4
  5. enable_remote=1
  6. remote_group=root
  7. [/General]

  8. [Profile]
  9. name=Default
  10. minfreq=0%
  11. maxfreq=100%
  12. policy=powersave
  13. [/Profile]

  14. [Profile]
  15. name=Extra Power Save
  16. minfreq=0%
  17. maxfreq=0%
  18. policy=powersave
  19. [/Profile]

  20. [Profile]
  21. name=Power Save
  22. minfreq=0%
  23. maxfreq=50%
  24. policy=powersave
  25. [/Profile]

  26. [Profile]
  27. name=Performance
  28. minfreq=50%
  29. maxfreq=100%
  30. policy=powersave
  31. [/Profile]

  32. [Profile]
  33. name=Extra Performance
  34. minfreq=50%
  35. maxfreq=100%
  36. policy=performance
  37. [/Profile]

  38. # when AC use performance mode
  39. [Rule]
  40. name=AC Rule
  41. ac=on                    # (on/off)
  42. profile=Default
  43. [/Rule]

  44. # stay in performance mode for the first minutes
  45. [Rule]
  46. name=AC Off - High Power
  47. ac=off                   # (on/off)
  48. battery_interval=30-100
  49. profile=Power Save
  50. [/Rule]
Copy the Code
# conservative mode when not AC
[Rule]
name=AC Off - Low Battery
ac=off                   # (on/off)
battery_interval=0-30
# Warning: Replace following path as your backlight manager path!
exec_post=echo 1 > /sys/class/backlight/intel_backlight/brightness
profile=Extra Power Save
[/Rule]
# CPU Too hot!
[Rule]
name=CPU Too Hot
acpi_temperature=65-100
cpu_interval=75-100
profile=Default
[/Rule]

配置好后,手动查看/设置CPU主频:
  1. # 查看所有的配置
  2. sudo cpufreqd-get
  3. # 查看当前CPU频率模式
  4. sudo cpufreqd-get -l
  5. # 强制设置CPU为某一个配置(数字在配置名字后面,这里假定选择方案2)
  6. sudo cpufreqd-set manual
  7. sudo cpufreqd-set 2
Copy the Code

参考配置教程:
http://go2linux.garron.me/how-to-configure-cpufreqd/
http://skyao.github.io/2015/08/08/linux-cpufreqd/

Reply View the author
avatar
y5284037
deepin
2017-12-01 01:11
#9
https://bbs.deepin.org/post/149229
超级推荐cpufreqd,可以根据电池电量、设备温度、使用的软件等,制定CPU运行模式、频率、屏幕亮度、显卡开 ...

这个需要开机重新设置嘛?
Reply View the author
avatar
id9502
deepin
2017-12-01 10:11
#10
https://bbs.deepin.org/post/149229
这个需要开机重新设置嘛?

写成配置文件的规则每次启动之后自动执行不用重设,手动模式强制修改当前配置的话重启后会还原成配置文件指定的规则
Reply View the author