Friday, February 4, 2011

nVidia fan speed control for headless cards with Coolbits

As I sit here in front of my CUDA dev system, I have three video cards: Two GTX470s, and a GTX580.  All of them are running their fans at high speeds, and my current GPU temperatures (while idle) are: 34C, 33C, 25C.  The trick is that I only have a display attached to one card!

It's been known for a while that, for whatever reason, nVidia doesn't let you control the fan speed of cards without monitors attached using the Coolbits tweak.  This is really very annoying for those of us with CUDA dev boxes or production boxes that have a ton of video cards we would like to keep cool.

Fortunately, there IS a way around it - at least for boxes running X11.  I've not found a way to make this work on a purely headless production box yet, but if you have X11 up, you can control all your fans!




The trick is that while nvidia-settings will not let you control the fan speed of headless cards, you can force x11 into thinking the cards have heads on them!

I've got two methods proposed: The "easy" method, and the "geek" method.  Both should end up at the same point, just via different paths.  The end goal is to have xorg.conf set up such that a monitor is "attached" to each card.

The Easy(ish) Method

The easy method is to attach a monitor to each of your headless cards in turn, use nvidia-settings to detect each display as a separate X display, and then force a monitor to be attached to each one.  For me, after adding each monitor, it looks like this:

I had to reboot a few time to get this to work, partly because I only had one extra monitor to attach.  However, once I got this set up, I was able to detach the secondary monitor from the cards.

After setting up each display like this, I set up my xorg.conf file to force the monitors to be "connected" - and to turn on the fan control settings in Coolbits.

Section "Screen"
    Identifier     "Screen2"
    Device         "Device2"
    Monitor        "Monitor2"
    DefaultDepth    24
    Option         "ConnectedMonitor" "CRT"
    Option         "Coolbits" "5"
    Option         "TwinView" "0"
    Option         "metamodes" "nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Do this for all the screens you have, reboot, and you should be able to force fan speed in nvidia-settings in the thermal management screen.








This is all well and good, but what if you don't want to do it this way?  If you're a more advanced geek, you can easily use


The Advanced Method

This involves creating an xorg.conf file that has all the other cards added with the needed sections by hand.  I'm not sure why you'd want to do this, but you can.

You'll need the PCI IDs of each of your graphics cards.  This can be obtained as follows:


$ lspci | grep VGA
01:00.0 VGA compatible controller: nVidia Corporation Device 06cd (rev a3)
02:00.0 VGA compatible controller: nVidia Corporation Device 06cd (rev a3)
05:00.0 VGA compatible controller: nVidia Corporation Device 1080 (rev a1)


I now know the PCI IDs of my video cards: 01:00.0, 02:00.0, and 05:00.0.

At this point, I'm assuming you're familiar enough with xorg.conf to handle the needed configuration modifications for each card on your own (needing to use different monitor and device IDs).

You will likely already have one entry in your xorg.conf from your primary display.  You can simply copy and modify these to create the needed sections for each card you wish to control the fan on, or can create custom settings.  Given that the whole point of this is fan control, you'll probably want to enable Coolbits!


For each of my cards, I end up with a set of configuration settings like this:

 Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "CRT-0"
    HorizSync       28.0 - 81.0
    VertRefresh     48.0 - 75.0
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 470"
    BusID          "PCI:2:0:0"
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "ConnectedMonitor" "CRT"
    Option         "Coolbits" "5"
    Option         "TwinView" "0"
    Option         "TwinViewXineramaInfoOrder" "CRT-0"
    Option         "metamodes" "nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection



Not all of this is required, but this is what my settings are, and it works perfectly.  Restart X11, bring up nvidia-settings, and you should be able to control all the fan speeds manually!

As a side note, I cannot force the fan above 85% on my eVGA GTX580.  I'm not sure why, and I believe there is a BIOS flash that will let me force it to 100%, but for now, I'm happy with 85%.  It keeps it cool enough.

My next post will discuss some command line utilities for nVidia and some scripts I use to automate setting my fan speeds.



Keywords: nVidia CUDA fan control headless GTX470 GTX480 GTX580 CoolBits

1 comment:

  1. Hello: Very interesting, but I have not achieved good results.

    Tendo installed a GTX 450 + screen, activated fan control and a GTX590 (no screen) and I want the fan control the GTX590.

    You can see how your xorg.conf has cofigurado parqa work. Thank you.

    ReplyDelete