8

手动调节 thinkpad cpu 风扇,告别铁板熊掌

 1 year ago
source link: https://hsingko.github.io/post/2022/06/28/thinkpad-fan/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

手动调节 thinkpad cpu 风扇,告别铁板熊掌

烫烫烫烫烫烫烫烫烫烫烫烫

2022-06-28 · 2 分钟 · hsingko

夏天到了,笔记本开始发热,我用的是 thinkpadd t470 ,平时只是看看网页,左手托盘的位置就烫的要死。用 sensors 命令看 cpu 核心温度,也才 56 度,不过转念一想,这和平时洗脚水的温度差不多了,还是有点烫的那种。所以为什么风扇还不赶紧开始工作呢?我的手都要被烫出关节炎了啊?

于是查了下 arch wiki ,发现可以用 aur 中的 thinkfan 包来控制风扇,可以详细地配置温度传感器的阈值来启动不同转速的风扇。不过 wiki 上写的非常简略,来回折腾了好几次也没成功,最后还是这个 gist 帮我解决了问题。

基本套路都是按照上面写的进行配置,下面记录一些我遇到的问题。

首先是温度传感器的路径,使用 find /sys/devices -type f -name "temp*_input" 命令之后,我查找出一大坨的文件:

/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp6_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp3_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp7_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp4_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp8_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp1_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp5_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp2_input
/sys/devices/platform/coretemp.0/hwmon/hwmon8/temp3_input
/sys/devices/platform/coretemp.0/hwmon/hwmon8/temp1_input
/sys/devices/platform/coretemp.0/hwmon/hwmon8/temp2_input
/sys/devices/virtual/thermal/thermal_zone2/hwmon7/temp1_input
/sys/devices/virtual/thermal/thermal_zone0/hwmon1/temp1_input
/sys/devices/virtual/thermal/thermal_zone1/hwmon4/temp1_input

最后三行的路径里有 virtual 应该不是,带有 coretemp 路径的和 gist 上作者的路径类似,但是我重启之后这个路径就变了,于是我最终用的是前面 8 行,测试之后是能用的。

其次按照作者给出的文件,运行 thinkfan service 失败,于是我加上了 tp_fan /proc/acpi/ibm/fan 之后就可以了,搞不懂为什么。

接下来是 modprobe thinkpad_acpi 的问题。一开始我使用这条命令会提示我的内核不存在 acpi 文件,但是我到内核下查找之后是有的,于是我重启,然后又能找到了,也是搞不懂。

最后我的 /etc/thinkfan.conf 文件是这样的:

tp_fan /proc/acpi/ibm/fan

hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp6_input
hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp3_input
hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp7_input
hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp4_input
hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp8_input
hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp1_input
hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp5_input
hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp2_input

(0,	0,	40)
(1,	40,	65)
(2,	65,	70)
(3,	70,	75)
(4,	75,	80)
(5,	80,	85)
(7,	85,	100)

最后几行的括号的含义是:

  • 第一个数字代表风扇的转速,从 1-7 逐级加快
  • 第二个数字代表启动相应转速的温度下限,第三个数字代表上限

最后 systemctl start thinfan 启动,如果一切顺利的话,风扇就已经开始按照我们的设定正常工作了!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK