Ubuntu 16.04,如何获得我的GPU温度和风扇速度?

在Ubuntu 14.04上,我习惯在启动过程中运行一个python脚本,让conky读取我的GPU温度,然后根据温度改变我的FAN速度。 这是脚本:

# # python /home/ibart/.scripts/ventola_ati.py # import os import time minTemp = 45.00 maxTemp = 70.00 minSpeed = 10 maxSpeed = 90 updateInterval = 3 fanSpeed = 25 while True: f = os.popen('aticonfig --od-gettemperature | grep "Sensor 0" | cut -c43-47') currentTemp = eval(str(f.readlines())[2:7]) if currentTemp > maxTemp: if fanSpeed < maxSpeed: fanSpeed = fanSpeed + 1 if currentTemp  minSpeed: fanSpeed = fanSpeed - 1 os.system('aticonfig --pplib-cmd "set fanspeed 0 ' + str(fanSpeed) + '"') print fanSpeed print currentTemp time.sleep(updateInterval) 

现在Ubuntu放弃了我的卡的官方驱动程序,旧的和花哨的HD5770?

谢谢。

编辑。 16.04 sensors检测到它。 谢谢卢卡。

请使用sensors-detect。

 sudo sensors-detect 

然后启动它:

 sensors 

我假设您正在尝试更改系统风扇的速度以响应GPU温度。 我认为GPU风扇的速度只能由GPU驱动程序控制(如果有的话)。

安装’lm-sensors’和’fancontrol’。 这里有一套很好的指示

从您发布的sensors的输出片段看来,您已经安装但没有配置lm-sensors 。 您可以通过查找或编写主板的配置文件并将其放在/etc/sensors.d中来实现

由于sensors显然正确报告GPU温度,如果您不介意不存在的传感器和虚假警告的虚假读数,则无需费心去做。

然后配置’fancontrol’以使风扇速度受GPU温度控制。