您当前的位置:首页 > 计算机 > 系统应用 > Linux

优麒麟中让CPU和GPU的风扇静音

时间:11-21来源:作者:点击数:

操作系统:Ubuntu Kylin 优麒麟 20.04 LTS for ARM64,也适用于AMD64。

在优麒麟中,默认设置的CPU和GPU风扇的转速偏快,造成电脑工作时噪声偏大。请安装fancontrol,通过温度的变化自动调节风扇的转速。

一、安装 fancontrol

sudo apt install fancontrol

二、配置 fancontrol

sudo /sbin/pwmconfig

该命令执行后,会出现一个配置向导。

# pwmconfig version 3.6.0
This program will search your sensors for pulse width modulation (pwm) controls, and test each one to see if it controls a fan on your motherboard. Note that many motherboards do not have pwm circuitry installed, even if your sensor chip supports pwm.

We will attempt to briefly stop each fan using the pwm controls. The program will attempt to restore each fan to full speed after testing. However, it is ** very important ** that you physically verify that the fans have been to full speed after the program has completed.

Found the following devices:
   hwmon0 is amdgpu

Found the following PWM controls:
   hwmon0/pwm1           current value: 112
hwmon0/pwm1 is currently setup for automatic speed control. In general, automatic mode is preferred over manual mode, as it is more efficient and it reacts faster. Are you sure that you want to setup this output for manual control? (n) y

上边这一步是在询问是否对风扇转速进行手工设置。输入“y”。不同的主板会有多个不同的温控设备。比如CPU、GPU、机箱……

Giving the fans some time to reach full speed...
Found the following fan sensors:
   hwmon0/fan1_input     current speed: 3402 RPM

Warning!!! This program will stop your fans, one at a time, for approximately 5 seconds each!!! This may cause your processor temperature to rise!!! If you do not want to do this hit control-C now!!! Hit return to continue: 

这一步在提示:风扇会停转5秒钟。请输入回车。

Testing pwm control hwmon0/pwm1 ...
  hwmon0/fan1_input ... speed was 3402 now 928
    It appears that fan hwmon0/fan1_input
    is controlled by pwm hwmon0/pwm1
Would you like to generate a detailed correlation (y)? 

将自动进行风扇转速与PWM值之间的对应关联。默认为“是”,输入回车即可。

Note: If you had gnuplot installed, I could generate a graphical plot.
    PWM 255 FAN 3337
    PWM 240 FAN 3338
    PWM 225 FAN 3159
    PWM 210 FAN 2992
    PWM 195 FAN 2840
    PWM 180 FAN 2669
    PWM 165 FAN 2478
    PWM 150 FAN 2244
    PWM 135 FAN 2082
    PWM 120 FAN 1779
    PWM 105 FAN 1541
    PWM 90 FAN 1142
    PWM 75 FAN 962
    PWM 60 FAN 949
    PWM 45 FAN 948
    PWM 30 FAN 951
    PWM 28 FAN 948
    PWM 26 FAN 947
    PWM 24 FAN 951
    PWM 22 FAN 953
    PWM 20 FAN 954
    PWM 18 FAN 953
    PWM 16 FAN 954
    PWM 14 FAN 962
    PWM 12 FAN 962
    PWM 10 FAN 962
    PWM 8 FAN 959
    PWM 6 FAN 961
    PWM 4 FAN 962
    PWM 2 FAN 962
    PWM 0 FAN 961

 

Testing is complete.

Please verify that all fans have returned to their normal speed.

 

The fancontrol script can automatically respond to temperature changes of your system by changing fanspeeds.

Do you want to set up its configuration file now (y)? 

是否开始生成配置文件。输入回车。

What should be the path to your fancontrol config file (/etc/fancontrol)? 

Select fan output to configure, or other action:

  • 1) hwmon0/pwm1
  • 2) Change INTERVAL
  • 3) Just quit
  • 4) Save and quit
  • 5) Show configuration
  • select (1-n): 1

选择“1”,由于不同的主板会有多个不同的温控设备。比如CPU、GPU、机箱……

请根据自己主板的实际情况进行选择。

Devices:

hwmon0 is amdgpu

Current temperature readings are as follows:

hwmon0/temp1_input    29

Select a temperature sensor as source for hwmon0/pwm1:

  • 1) hwmon0/temp1_input
  • 2) None (Do not affect this PWM output)

select (1-n): 1

输入选择的温控对象。

Enter the low temperature (degree C)

below which the fan should spin at minimum speed (20): 40

风扇最小转速时,对应的设备温度。比如:显卡低于40摄氏度时,风扇执行最小转速。

Enter the high temperature (degree C)

over which the fan should spin at maximum speed (60): 90

风扇最大转速时,对应的设备温度。比如:显卡高于90摄氏度时,风扇执行最大转速。

Enter the PWM value (0-255) to use when the temperature

is over the high temperature limit (255): 

最大PWM值,默认为“255”,对应风扇的最大转速。如果不想风扇出现全速旋转的情况,可以将这个数值适当的设置低一些。好处是降低噪声。坏处是,在显卡火力全开工作时,发热量很大,风扇也不会全速旋转,可能会影响散热。

Select fan output to configure, or other action:

  • 1) hwmon0/pwm1                    
  • 2) Change INTERVAL
  • 3) Just quit 
  • 4) Save and quit
  • 5) Show configuration
  • select (1-n): 4

选择“4”,保存并退出。

Saving configuration to /etc/fancontrol...

Configuration saved

三、重启 fancontrol 服务

sudo systemctl restart fancontrol

四、设置 fancontrol 开机启动

sudo systemctl enable fancontrol

五、范例

鲲鹏 920 x8 主板和 RX550 显卡,配置文件的范例:(/etc/fancontrol)

MINTEMP是指硬件温度为多少时,风扇使用最低转速。比如CPU在40℃及以下时,风扇转速为1000RPM。

MAXTEMP是指硬件温度为多少时,风扇使用最高转速。比如CPU在90℃及以上时,风扇转速为2000RPM。

# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=10
DEVPATH=hwmon0=devices/pci0000:00/0000:00:02.0/0000:01:00.0 hwmon1= hwmon5=
DEVNAME=hwmon0=amdgpu hwmon1=cpu-hwmon hwmon5=sbx00-fan
FCTEMPS=hwmon5/pwm1=hwmon1/temp1_input  hwmon0/pwm1=hwmon0/temp1_input
FCFANS=hwmon5/pwm1=hwmon5/fan1_input  hwmon0/pwm1=hwmon0/fan1_input
MINTEMP=hwmon5/pwm1=30  hwmon0/pwm1=30
MAXTEMP=hwmon5/pwm1=90  hwmon0/pwm1=90
MINSTART=hwmon5/pwm1=150  hwmon0/pwm1=150
MINSTOP=hwmon5/pwm1=0  hwmon0/pwm1=0

 

方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门