5

On Ubuntu 14.04 I got used to run during the boot process a python script for conky to read my GPU temperature and then change my FAN speed according to the temperature. This is the script:

# 
# 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 < minTemp:
        if fanSpeed > minSpeed:
            fanSpeed = fanSpeed - 1

    os.system('aticonfig --pplib-cmd "set fanspeed 0 ' + str(fanSpeed) + '"')

    print fanSpeed
    print currentTemp
    time.sleep(updateInterval)

What now that Ubuntu dropped the official drivers for my card, an old and fancy HD5770?

Thanks.

edit. On 16.04 sensors detects it. Thanks Luca.

2 Answers2

6

Please use sensors-detect.

sudo sensors-detect

then launch it with:

sensors
  • OMG, it has been detected;

    ibart@quad:~$ sensors radeon-pci-0100 Adapter: PCI adapter temp1: +49.0°C (crit = +120.0°C, hyst = +90.0°C) Is it possible to change its speed setting without aticonfig?

    – Mich. Gio. Apr 20 '16 at 10:31
  • I will but i need to change its speed setting without aticonfig. How? :p – Mich. Gio. Apr 20 '16 at 10:36
  • 1
    Please refer to this question for configuring fan speed: http://askubuntu.com/questions/22108/how-to-control-fan-speed - start from step 3. – Luca D'Amico Apr 20 '16 at 10:39
  • Ok. Thanks but sensors doesn't get the fan so I don't think I can manage to change the speed at all. I'll give a try reading. Bye! – Mich. Gio. Apr 20 '16 at 11:14
  • You should also check if you can change the fan speed from UEFI/BIOS – Luca D'Amico Apr 20 '16 at 11:16
  • No I cannot change speed from BIOS; anyway, I need to change it dynamically based on my GPU temp so... ;) – Mich. Gio. Apr 20 '16 at 12:43
2

I assume you are trying to change the speed of the system fan in response to the GPU temperature. I think the speed of the GPU fan can only be controlled by the GPU driver (if at all).

Install 'lm-sensors' and 'fancontrol'. There is an excellent set of instructions for doing so here

From the fragment of the output from sensors you have posted it seems you have installed but not configured lm-sensors. You do so by finding or writing a configuration file for your motherboard and placing it in /etc/sensors.d

As sensors is apparently reporting the GPU temperature correctly you don’t need to bother to do this if you don’t mind spurious readings from non-existent sensors and spurious warnings.

Then configure 'fancontrol' to have the fan speed controlled by the GPU temperature.

Steve Roome
  • 1,419
  • Yes, the speed is controlled by the GPU drivers but the fan is noisy. When the python script was working, it was perfect.

    I cannot use fanspeed because /usr/sbin/pwmconfig: There are no pwm-capable sensor modules installed.

    – Mich. Gio. Apr 20 '16 at 18:45
  • Please run sudo sensors-detect accepting all the defaults and paste the entire dialog in your question. We will then try and get it to detect the fans. You can use paste.ubuntu.com – Steve Roome Apr 20 '16 at 19:08