gri*_*ako 186
此功能取决于您的硬件和软件。如果您的硬件不支持风扇速度控制,或者没有将它们显示给操作系统,则您很可能无法使用此解决方案。如果是这样,但软件(又名内核)不知道如何控制它,那么您就没有运气了。
安装lm-sensors和fancontrol包。
配置lm-sensors如下:
在终端类型中sudo sensors-detect
,对所有 YES/NO 问题回答 YES。
(潜在地,这可能会损坏您的系统或导致系统崩溃。对于很多系统来说,这是安全的。不能保证此过程不会永久损坏您的系统,我只是认为这种严重故障的可能性真的很低. 在处理系统配置之前保存所有工作以备最终崩溃/冻结/重启始终是个好主意。如果您不确定,请阅读评论并尝试搜索网络并获得一些高级概述,然后再确定一切,也许正在选择你的 YES-es 仍然足够)
在sensors-detect 结束时,将显示需要加载的模块列表。输入“yes”让传感器检测将这些模块插入/etc/modules,或者自己编辑/etc/modules。
运行sudo service kmod start
这将读取您/etc/modules
在第 3 步中所做的更改,并将新模块插入内核。
sudo service module-init-tools restart
配置风扇控制
sudo pwmconfig
. 此脚本将停止每个风扇 5 秒钟,以找出哪些风扇可以由哪个 PWM 句柄控制。脚本循环完所有风扇后,可以配置哪个风扇对应哪个温度。/etc/fancontrol
并用于sudo service fancontrol restart
应用您的更改。(在我的情况下,我将间隔设置为 2 秒。)设置风扇控制服务
sudo service fancontrol start
。这也将使 fancontrol 服务在系统启动时自动运行。在我/etc/fancontrol
的 CPU案例中,我使用了:
hwmon0/device/pwm2 的设置:(
取决于 hwmon0/device/temp2_input)(控制 hwmon0/device/fan2_input)
INTERVAL=2
MINTEMP=40
MAXTEMP=60
MINSTART=150
MINSTOP=0
MINPWM=0
MAXPWM=255
Run Code Online (Sandbox Code Playgroud)
在不同的系统上它是:
INTERVAL=10
DEVPATH=hwmon1=devices/platform/coretemp.0 hwmon2=devices/platform/nct6775.2608
DEVNAME=hwmon1=coretemp hwmon2=nct6779
FCTEMPS=hwmon2/pwm2=hwmon1/temp2_input
FCFANS=hwmon2/pwm2=hwmon2/fan2_input
MINTEMP=hwmon2/pwm2=49
MAXTEMP=hwmon2/pwm2=83
MINSTART=hwmon2/pwm2=150
MINSTOP=hwmon2/pwm2=15
MINPWM=hwmon2/pwm2=14
MAXPWM=hwmon2/pwm2=255
Run Code Online (Sandbox Code Playgroud)
这是有关设置及其实际用途的一些有用信息
Kri*_*ris 52
如果您拥有ThinkPad,则有一款名为的软件thinkfan
可以做到这一点。顾名思义,它是专为 ThinkPad ( thinkpad_acpi
) 设计的。
该thinkfan
软件在标准 ubuntu 软件存储库中可用,但它确实需要几个步骤来配置。
这是一个简单的分步指南:
http://www.lxle.net/forums/discussion/821/how-to-set-up-thinkfan-on-a-lenovo-thinkpad-t430/p1
(这基本上是本德语指南的翻译版本:http : //thinkwiki.de/Thinkfan)
步骤 1.安装 thinkfan 软件和传感器:
sudo apt-get install thinkfan lm-sensors
Run Code Online (Sandbox Code Playgroud)
步骤 2.通过编辑 thinkpad.conf 文件确保守护进程控制风扇:
sudo nano /etc/modprobe.d/thinkfan.conf
Run Code Online (Sandbox Code Playgroud)
通过添加以下行:
options thinkpad_acpi fan_control=1
Run Code Online (Sandbox Code Playgroud)
步骤 3.通过编辑文件使守护程序在启动时自动加载:
sudo nano /etc/default/thinkfan
Run Code Online (Sandbox Code Playgroud)
确保 START 键设置为 yes,即应该有一行显示:
START=yes
Run Code Online (Sandbox Code Playgroud)
步骤 4.检测笔记本电脑的传感器:
sudo sensors-detect
Run Code Online (Sandbox Code Playgroud)
并在出现提示时按 Enter 选择默认答案。
步骤 5.加载新模块。从 ubuntu 13.10 开始,这是通过以下方式完成的:
sudo service kmod start
Run Code Online (Sandbox Code Playgroud)
而对于 13.04 等以前的版本,您需要执行以下操作:
sudo service module-init-tools start
Run Code Online (Sandbox Code Playgroud)
步骤 6.找出正在使用的传感器:
sensors
Run Code Online (Sandbox Code Playgroud)
(表示 0 度的那些没有使用,我不知道为什么那些也被“检测到”)。记住哪些正在使用。
步骤 7.找出这些传感器的完整路径:
find /sys/devices -type f -name "temp*_input"
Run Code Online (Sandbox Code Playgroud)
输出应该是路径列表,如 /sys/devices/...
步骤 8.将传感器的路径复制粘贴到配置文件 /etc/thinkpad.conf 中。为此,首先打开文件:
sudo nano /etc/thinkfan.conf
Run Code Online (Sandbox Code Playgroud)
应该已经有一行像
#sensor /proc/acpi/ibm/thermal (0, 10, 15, 2, 10, 5, 0, 3, 0, 3)
Run Code Online (Sandbox Code Playgroud)
(#-符号表示该行已被注释掉)。添加以传感器开头的行(不带#-符号)并复制粘贴您的第一个传感器。如果您有多个传感器,请重复此操作。例如,在我的机器上,步骤 7 中的输出产生
/sys/devices/virtual/hwmon/hwmon0/temp1_input
/sys/devices/platform/thinkpad_hwmon/temp3_input
/sys/devices/platform/thinkpad_hwmon/temp4_input
/sys/devices/platform/thinkpad_hwmon/temp5_input
/sys/devices/platform/thinkpad_hwmon/temp6_input
/sys/devices/platform/thinkpad_hwmon/temp7_input
/sys/devices/platform/thinkpad_hwmon/temp1_input
/sys/devices/platform/thinkpad_hwmon/temp8_input
/sys/devices/platform/thinkpad_hwmon/temp2_input
/sys/devices/platform/coretemp.0/temp4_input
/sys/devices/platform/coretemp.0/temp2_input
Run Code Online (Sandbox Code Playgroud)
在我的机器中使用的是第一行和最后两行中的那些,所以我添加了三行:
sensor /sys/devices/virtual/hwmon/hwmon0/temp1_input
sensor /sys/devices/platform/coretemp.0/temp4_input
sensor /sys/devices/platform/coretemp.0/temp2_input
Run Code Online (Sandbox Code Playgroud)
步骤 9.最后,我们可以在配置文件中设置风扇速度级别。如果 /etc/thinkpad.conf 文件尚未打开,请打开它。
sudo nano /etc/thinkfan.conf
Run Code Online (Sandbox Code Playgroud)
我在 ThinkPad x201 上使用的风扇级别是:
(0, 0, 51)
(1, 50, 52)
(2, 51, 55)
(3, 54, 58)
(4, 56, 63)
(5, 60, 70)
(6, 66, 79)
(7, 74, 92)
(127, 85, 32767)
Run Code Online (Sandbox Code Playgroud)
最后一行确保风扇全速运行(127 =“脱离”,即不受调节)。您可以摆弄这些级别以满足您的需求/愿望,但请小心!
步骤 10.重新启动。现在一切都应该工作了。为了检查thinkpad是否正确运行,使用
sudo thinkfan -n
Run Code Online (Sandbox Code Playgroud)
它以详细模式启动 thinkfan。您可能想先停止 thinkfan 守护进程:
sudo /etc/init.d/thinkfan stop
Run Code Online (Sandbox Code Playgroud)
如果要再次启动 thinkfan 守护程序,请键入:
sudo /etc/init.d/thinkfan start
Run Code Online (Sandbox Code Playgroud)
为了完整起见,我的 /etc/thinkfan.conf 配置文件是:
# IMPORTANT:
#
# To keep your HD from overheating, you have to specify a correction value for
# the sensor that has the HD's temperature. You need to do this because
# thinkfan uses only the highest temperature it can find in the system, and
# that'll most likely never be your HD, as most HDs are already out of spec
# when they reach 55 °C.
# Correction values are applied from left to right in the same order as the
# temperatures are read from the file.
#
# For example:
# sensor /proc/acpi/ibm/thermal (0, 0, 10)
# will add a fixed value of 10 °C the 3rd value read from that file. Check out
# http://www.thinkwiki.org/wiki/Thermal_Sensors to find out how much you may
# want to add to certain temperatures.
# Syntax:
# (LEVEL, LOW, HIGH)
# LEVEL is the fan level to use (0-7 with thinkpad_acpi)
# LOW is the temperature at which to step down to the previous level
# HIGH is the temperature at which to step up to the next level
# All numbers are integers.
#
# I use this on my T61p:
#sensor /proc/acpi/ibm/thermal (0, 10, 15, 2, 10, 5, 0, 3, 0, 3)
#(0, 0, 55)
#(1, 48, 60)
#(2, 50, 61)
#(3, 52, 63)
#(4, 56, 65)
#(5, 59, 66)
#(7, 63, 32767)
# My settings for my ThinkPad X201: (kris)
sensor /sys/devices/virtual/hwmon/hwmon0/temp1_input
sensor /sys/devices/platform/coretemp.0/temp4_input
sensor /sys/devices/platform/coretemp.0/temp2_input
(0, 0, 51)
(1, 50, 52)
(2, 51, 55)
(3, 54, 58)
(4, 56, 63)
(5, 60, 70)
(6, 66, 79)
(7, 74, 92)
(127, 85, 32767)
Run Code Online (Sandbox Code Playgroud)
mor*_*ook 21
对于多台戴尔计算机,您可以安装 i8kutils 包:
sudo apt install i8kutils
Run Code Online (Sandbox Code Playgroud)
如果您有未经测试的戴尔(例如我的戴尔 XPS 14z 和戴尔 XPS 15 9550),您可能需要强制加载内核模块:
sudo modprobe i8k force=1
Run Code Online (Sandbox Code Playgroud)
如果您想控制风扇,您可能需要遵循更详尽的指南:Dell G5 上的风扇在全速和关闭之间切换
psu*_*usi 10
安装和配置lm-sensors和fancontrol包:
sudo apt-get install lm-sensors fancontrol
Run Code Online (Sandbox Code Playgroud)
配置它们的文档可以在他们的手册页上找到。
这是一个应该由符合 ACPI 的 BIOS 提供的功能,但似乎大多数主板供应商都不愿意遵循该标准。
这是一个更新的答案,基于推荐 thinkfan但使用 Ubuntu 19.04的答案,以及其他计算机,而不仅仅是 ThinkPads。
下面的说明适用于具有任何的ThinkPad/proc/acpi/ibm/fan
和/proc/acpi/ibm/thermal
“传统”设备。这避免了必须安装lm-sensors
包。
但是,您仍然可以选择安装lm-sensors
. 它将为您提供更多的温度传感器和更精细的风扇控制,即 256 个 PWM 步长,而不是传统设备的固定步长“0-7 和 127”。此外,由于thinkfan
现在可以使用lm-sensors
传感器,它不再特定于 IBM / Lenovo ThinkPad 计算机。请参阅man thinkfan
使用这些“扩展”传感器设备。此外,德语 Thinkwiki 中有最新信息。
安装所需的包:
sudo apt install thinkfan
Run Code Online (Sandbox Code Playgroud)将以下行添加到/etc/modprobe.d/thinkfan.conf
:
options thinkpad_acpi fan_control=1
Run Code Online (Sandbox Code Playgroud)配置thinkfan
服务在系统启动时自动启动:
添加一行START=yes
到/etc/default/thinkfan
执行以下命令(源):
sudo systemctl enable thinkfan.service
Run Code Online (Sandbox Code Playgroud)/etc/thinkfan.conf
使用正确的指针来适应您想要的设备和风扇级别。那里的评论提供了文档。在任何带有旧版fan
和thermal
设备的Thinkpad 上,以下应该提供一个很好的起点(也应该对硬盘安全,请参阅文件中的注释以获取更多信息)。请注意,这使用了新关键字——另一个答案中的关键字现已弃用。
tp_fan /proc/acpi/ibm/fan
tp_thermal /proc/acpi/ibm/thermal
(0, 0, 47)
(1, 43, 52)
(2, 48, 55)
(3, 51, 58)
(4, 54, 63)
(5, 59, 70)
(6, 66, 79)
(7, 74, 92)
(127, 85, 32767)
Run Code Online (Sandbox Code Playgroud)要测试您的设置(重新启动后),您可以执行以下操作:
在一个终端窗口中,thinkfan
以非守护程序模式运行,以便您可以看到其消息:
sudo service thinkfan stop && sudo thinkfan -n
Run Code Online (Sandbox Code Playgroud)在另一个终端窗口中,注意当前的温度值,如果不同,请提供您的温度探测器设备:
while true; do sleep 1; cat /proc/acpi/ibm/thermal; done
Run Code Online (Sandbox Code Playgroud)在另一个终端窗口中,在 CPU 中产生一些热量(如果热量管理中的某些内容没有按预期运行,请使用Ctrl+中断它C):
sudo apt install stress-ng
stress-ng --cpu-1
Run Code Online (Sandbox Code Playgroud)尝试查看 PC 的 UEFI 设置(或 BIOS 设置)。有可能是风扇控制的设置,你可以把你的粉丝为Silent Mode
,Performance Mode
,Full Speed
,Customize
,等。
如何访问 UEFI 设置:重新启动您的 PC,输入它们的密钥可能会出现在其中一个角落(例如Press F2 to enter UEFI setup
)