[Nouveau] [TESTING CALL] Fan management

Martin Peres martin.peres at free.fr
Mon Aug 29 07:07:15 PDT 2011

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: 
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 

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 
a patch to support that: 
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 > 
- 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.


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!


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.


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.


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/nouveau/attachments/20110829/d57e97bb/attachment.htm>

More information about the Nouveau mailing list