Fan management
Hi Nouveau users,
Just saw the bitching on Phoronix about lack of fan management in nouveau (no offence Michael, it was justified ;) ). Since it has been working flawlessly for more than a week on my desktop, I decided to let you guys know about it and ask for testing.
Here is the code: http://gitorious.org/linux-nouveau-pm/linux-nouveau-pm/commits/thermal
Please read the following paragraphs before pulling this branch and fry your GPU.
The hardware and current limitations
---------------------------------------------------
This branch introduces code to drive the most common fan type (and the most problematic one, I guess/hope). We call them PWM fan. The other types are TOGGLE (can only be ON or OFF) and I2C (driven using an I2C chip).
The TOGGLE fans aren't supported because I think I lack the hw (to be confirmed).
The PWM fans are the most common ones. It supports a full range of speed (from 0% to 100%).
The I2C-accessible fans are usually limited to high-end cards. At the moment, the only thing we can do for them is to launch their hwmon driver. This is due to a limitation in hwmon that doesn't let kernel drivers accessing the i2c chips' methods. We are working with the hwmon team and provided a patch to support that: http://www.spinics.net/lists/lm-sensors/msg32906.html
If you have such a fan, you can manage it from the userspace.
The implemented fan management support
-----------------------------------------------------------
Current fan management should only work on what we call PWM fans.
This work should be usable up to (not including) nva3 chipset generation. This is because nva3+ cards all have hw to drive the speed of the fan (pwm or i2c).
Reading the fan speed (power): cat /sys/class/drm/cardX/device/pwm0
Reading the fan speed (RPM): cat /sys/class/drm/cardX/device/fan0_input
Setting the fan management method: echo X > /sys/class/drm/cardX/device/pwm0_enable
- X = 0: Fan management disabled, fan power set to 100%
- X = 1: Manual fan management (you can set the speed by writing [0->100] to /sys/class/drm/cardX/device/pwm0)
- X = 2: The default automatic fan management (equivalent to X = 3 for the moment)
- X = 3: Linear fan management. The fan speed is linearly correlated to the temperature.
- X = 4: Target temperature management. The fan is driven to keep the GPU to a certain temperature
The thermal zone implementation
------------------------------------------------
Since I believe thermal zones are great but massively under-used. I used thermal zones to define some trip points.
Here are some noteworthy trip points:
- Default mode: Listen to the user commands
- Fan boost: Whenever the GPU reaches this temperature, the fan will blow at 100%
- Downclocking: Whenever the GPU reaches this temperature, your GPU will be downclocked to the lowest perflvl
- Critical: Whenever the GPU reaches this temperature, your computer will shut down to prevent damages.
BIG FAT WARNING
-----------------------------
For those willing to try this, please watch your GPU temperature closely at any time using "$ sensors" and your fingers. If you think sensors doesn't report the right temperature, please send us a mail with your vbios and show up on IRC (ask mupuf).
Check this before having fun with fan management, it is very important!
Installation
------------------
cd my_package_directory
git clone git://gitorious.org/linux-nouveau-pm/linux-nouveau-pm.git
git branch --track thermal origin/thermal
Then it is just a matter of compiling and testing your kernel. Please follow your distribution's guide.
Report
------------
Please report your story on our IRC channel. Please also send your kernel logs along with your vbios to martin.peres <at> free(dot)fr.
Conclusion
------------
Hope you like it. Keep us informed of how well it works ;)
Martin (AKA mupuf)
PS: Another testing call about power management should also follow but there is something I want to implement before people try it.
_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 13 lines
The implemented fan management support
-----------------------------------------------------------Current fan management should only work on what we call PWM fans.
This work should be usable up to (not including) nva3 chipset generation. This is because nva3+ cards all have hw to drive the speed of the fan (pwm or i2c).
Reading the fan speed (power): cat
/sys/class/drm/cardX/device/pwm0Reading the fan speed (RPM): cat
/sys/class/drm/cardX/device/fan0_input
Quoted 10 lines
Setting the fan management method: echo X >
/sys/class/drm/cardX/device/pwm0_enable
- X = 0: Fan management disabled, fan power set to 100%
- X = 1: Manual fan management (you can set the speed by writing [0->100] to/sys/class/drm/cardX/device/pwm0)
- X = 2: The default automatic fan management (equivalent to X = 3 for the moment)
- X = 3: Linear fan management. The fan speed is linearly correlated to the temperature.
- X = 4: Target temperature management. The fan is driven to keep the GPU to a certain temperature
I have 7800gs (NV49) card and tried to use the new driver yesterday after pulling the latest source, compiling and installing it. Unfortunately, pwm0_enable is not showing up, so I am unable to use the fan management at all. Previous attempts to write values to either /sys/class/drm/cardX/device/pwm0 or the port itself (using nvpoke) also failed - even though the value changes the fan speed stays the same. I was hoping that the latest additions will solve these problems and reduce the noise coming out of the fan (blasting at 100%), but that seems to be way off, at least for now.
What could be the problem? Could it be that my card is using i2c instead? Any ideas?
A message that is not in the archive (sent off-list or not yet received): 4E5E1FA7.2010705-gM/[email protected]
Quoted 23 lines · Mr Dash Four
Quoted 13 lines
The implemented fan management support
-----------------------------------------------------------Current fan management should only work on what we call PWM fans.
This work should be usable up to (not including) nva3 chipset generation. This is because nva3+ cards all have hw to drive the speed of the fan (pwm or i2c).
Reading the fan speed (power): cat
/sys/class/drm/cardX/device/pwm0Reading the fan speed (RPM): cat
/sys/class/drm/cardX/device/fan0_inputQuoted 10 lines
Setting the fan management method: echo X >
/sys/class/drm/cardX/device/pwm0_enable
- X = 0: Fan management disabled, fan power set to 100%
- X = 1: Manual fan management (you can set the speed by writing [0->100] to/sys/class/drm/cardX/device/pwm0)
- X = 2: The default automatic fan management (equivalent to X = 3
for the moment)
- X = 3: Linear fan management. The fan speed is linearly correlated to the temperature.
- X = 4: Target temperature management. The fan is driven to keep the GPU to a certain temperature
Quoted 3 lines
I have 7800gs (NV49) card and tried to use the new driver yesterday after pulling the latest source, compiling and installing it. Unfortunately,
pwm0_enableis not showing up, so I am unable to use the fan management at all. Previous attempts to write values to either/sys/class/drm/cardX/device/pwm0or the port itself (using nvpoke) also failed - even though the value changes the fan speed stays the same. I was hoping that the latest additions will solve these problems and reduce the noise coming out of the fan (blasting at 100%), but that seems to be way off, at least for now.What could be the problem? Could it be that my card is using i2c instead? Any ideas?
Could you provide your kernel logs and vbios please? I'll have a look at it.