Anyone familiar with fancontrol and pwmconfig in Linux?

Control: management of fans, temp/rpm monitoring via soft/hardware

Moderators: NeilBlanchard, Ralf Hutter, sthayashi, Lawrence Lee

Post Reply
psyopper
Friend of SPCR
Posts: 336
Joined: Fri Mar 28, 2008 1:15 pm
Location: Portland, Oregon

Anyone familiar with fancontrol and pwmconfig in Linux?

Post by psyopper » Sat Apr 17, 2010 4:12 pm

I'll cross post this from ubuntuforums.org...

So I've been working on quieting down my machine... i3-530 on a Gigabyte H55M-UD2H. Ubuntu 9.10, Kernel 2.6.33 from the PPA so that my onboard Intel video works properly (more importantly, doesn't crash).

lm_sensors 3.1.2 from the 10.04 repo's to actually detect my sensors, it8720-isa-0290 (3.1.1 in the 9.10 repo's wouldn't detect anything).

When I run pwmconfig it detects my two fans, one attached to the CPU_FAN header, and the other attached to the SYS_FAN header. Both fans are Nexus D12-SL12 1200 RPM 3 wire voltage regulated fans, not 4 wire PWM fans. pwmconfig can successfully control them:

Code: Select all

$ sudo pwmconfig
# pwmconfig revision 5770 (2009-09-16)
This program will search your sensors for pulse width modulation (pwm)
controls, and test each one to see if it controls a fan on
your motherboard. Note that many motherboards do not have pwm
circuitry installed, even if your sensor chip supports pwm.

We will attempt to briefly stop each fan using the pwm controls.
The program will attempt to restore each fan to full speed
after testing. However, it is ** very important ** that you
physically verify that the fans have been to full speed
after the program has completed.

Found the following devices:
   hwmon0/device is it8720

Found the following PWM controls:
   hwmon0/device/pwm1
   hwmon0/device/pwm2
   hwmon0/device/pwm3

Giving the fans some time to reach full speed...
Found the following fan sensors:
   hwmon0/device/fan1_input     current speed: 975 RPM
   hwmon0/device/fan2_input     current speed: 1104 RPM

Warning!!! This program will stop your fans, one at a time,
for approximately 5 seconds each!!!
This may cause your processor temperature to rise!!!
If you do not want to do this hit control-C now!!!
Hit return to continue: 

Testing pwm control hwmon0/device/pwm1 ...
  hwmon0/device/fan1_input ... speed was 975 now 286
    It appears that fan hwmon0/device/fan1_input
    is controlled by pwm hwmon0/device/pwm1
Would you like to generate a detailed correlation (y)? 
Would you like to generate a graphical plot using gnuplot (y)? 
    PWM 255 FAN 557
    PWM 240 FAN 379
    PWM 225 FAN 523 (probably incorrect)
    PWM 210 FAN 740 (probably incorrect)
    PWM 195 FAN 799 (probably incorrect)
    PWM 180 FAN 770 (probably incorrect)
    PWM 165 FAN 723 (probably incorrect)
    PWM 150 FAN 676 (probably incorrect)
    PWM 135 FAN 623 (probably incorrect)
    PWM 120 FAN 574 (probably incorrect)
    PWM 105 FAN 509 (probably incorrect)
    PWM 90 FAN 451
    PWM 75 FAN 392
    PWM 60 FAN 329
    PWM 45 FAN 222
    PWM 30 FAN 113
    PWM 28 FAN 0
    Fan Stopped at PWM = 28
    Hit return to continue...

  hwmon0/device/fan2_input ... speed was 1104 now 1102
    no correlation

Testing pwm control hwmon0/device/pwm2 ...
  hwmon0/device/fan1_input ... speed was 975 now 967
    no correlation
  hwmon0/device/fan2_input ... speed was 1104 now 485
    It appears that fan hwmon0/device/fan2_input
    is controlled by pwm hwmon0/device/pwm2
Would you like to generate a detailed correlation (y)? 
Would you like to generate a graphical plot using gnuplot (y)? 
    PWM 255 FAN 529
    PWM 240 FAN 528
    PWM 225 FAN 729 (probably incorrect)
    PWM 210 FAN 927 (probably incorrect)
    PWM 195 FAN 928 (probably incorrect)
    PWM 180 FAN 889 (probably incorrect)
    PWM 165 FAN 837 (probably incorrect)
    PWM 150 FAN 785 (probably incorrect)
    PWM 135 FAN 726 (probably incorrect)
    PWM 120 FAN 667 (probably incorrect)
    PWM 105 FAN 601
    PWM 90 FAN 537
    PWM 75 FAN 466
    PWM 60 FAN 396
    PWM 45 FAN 314
    PWM 30 FAN 175
    PWM 28 FAN 84
    PWM 26 FAN 0
    Fan Stopped at PWM = 26
    Hit return to continue...


Testing pwm control hwmon0/device/pwm3 ...
  hwmon0/device/fan1_input ... speed was 975 now 981
    no correlation
  hwmon0/device/fan2_input ... speed was 1104 now 1101
    no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon0/device/pwm3,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)? n

Testing is complete.
Please verify that all fans have returned to their normal speed.
So it appears that I do have positive control over the fans. If anyone is interested I can post screenshots from gnuplot.

Here's the problem - no matter what kind of fan profile I configure in /etc/fancontrol the CPU_FAN throttles with CPU load and not against the cpu temp reported by sensors. The SYS_FAN always spins at 750 RPM, roughly 75% of it's rated speed.

What can I do to positively take control of my fan speeds?

I have tried a number of different things, it was just today that I figured out the correlation between cpu load (NOT cpu temp) and the cpu fan speed.

I don't think that fanspeed is controlling my fans. I think there is something somewhere else that is and am hoping someone can point me in the right direction.

Thanks!![/code]

lodestar
Posts: 1683
Joined: Fri Aug 05, 2005 3:29 am
Location: UK

Post by lodestar » Sun Apr 18, 2010 2:00 am

CPU Smart Fan in my experience normally works fine on Gigabyte motherboards, albeit with PWM fans. The issue may originate from the SYS_FAN header, which is 4 pin like the CPU header but is not PWM. What it actually is is a 3 pin fan header with a fourth pin which Gigabyte classify as reserved, so any fan plugged into it will run at full speed.

I would assume that your software needs to have Smart Fan enabled, and set to PWM mode. Clearly PWM mode will not do anything with SYS_FAN since it is not PWM, and this is might explain what you are seeing currently. You could try setting CPU Smart Fan to Voltage mode instead, which would hopefully give some control over a 3 pin CPU fan but I am not sure whether it will do anything with the SYS_FAN header. But this does not entirely explain why you are getting at least some fan control though SYS-FAN.

In any case I would argue that it is not desirable to use the Voltage mode of Smart Fan for CPU fan speed control for multi-core CPUs, and pwmconfig is a better option if it works. For pwmconfig to work it will need to link its fan control to the Digital Thermal Sensors which are reading the core temperatures on your CPU. This is not the same as the single CPU temperature that is shown in the BIOS, since this relies on a sensor which is on the CPU but is not on the cores. So I would assume that pwmconfig will need a source of sensor readings, and that somewhere under Linux you should be able to find those readings. If not already done so, they would need to be linked to pwmconfig and it should then work. But to me this seems like an awful lot of work simply to get 3 pin fans to work on hardware which is fundamentally geared to PWM fan control.

Maybe it is time to bite the bullet, and simply use PWM fans, since this would be a hardware only solution. If you want control over the PWM fan, particularly in the absence of motherboard PWM fan control modes, you could consider something like this http://www.frozencpu.com/products/6096/ ... L-PWM.html and set it to Low using the manual control supplied.
Last edited by lodestar on Sun Apr 18, 2010 3:59 am, edited 1 time in total.

ascl
Posts: 279
Joined: Tue May 05, 2009 1:15 am
Location: Sydney, Australia

Post by ascl » Sun Apr 18, 2010 3:47 am

Gigabyte's bios CPU fan control works fine with voltage (ie 3 wire) controlled fans on my EP45 board.

My guess is that the bios SmartFan is still enabled which overrides the software.

psyopper
Friend of SPCR
Posts: 336
Joined: Fri Mar 28, 2008 1:15 pm
Location: Portland, Oregon

Post by psyopper » Sun Apr 18, 2010 9:03 am

ascl wrote: My guess is that the bios SmartFan is still enabled which overrides the software.
Ding-ding-ding! We have a winner.

I had enabled SmartFan so that I could set the header to be in voltage mode rather than pwm mode but hadn't turned it off after that. Once I did it greyed out my ability to change the header type, but it remained at voltage controlled instead of flopping over to pwm controlled.

Once I turned off CPU SmartFan and booted back into Linux, fancontrol works as it should.

psyopper
Friend of SPCR
Posts: 336
Joined: Fri Mar 28, 2008 1:15 pm
Location: Portland, Oregon

Post by psyopper » Sun Apr 18, 2010 11:02 am

Now I just need to figure out how to get it to start correctly... :|

ascl
Posts: 279
Joined: Tue May 05, 2009 1:15 am
Location: Sydney, Australia

Post by ascl » Sun Apr 18, 2010 1:25 pm

Glad to hear your hardware is working correctly now :)


(I haven't used linux for a while, can't help with the software side of things, sorry -- good luck!).

dukla2000
*Lifetime Patron*
Posts: 1465
Joined: Sun Mar 09, 2003 12:27 pm
Location: Reading.England.EU

Post by dukla2000 » Sun Apr 18, 2010 3:23 pm

FWIW my Nexus D12-SL12 1200 RPM 3 wire ran fine (Abit mobo, so the start/stop values likely to be wrong for you) with the following /etc/fancontrol

Code: Select all

INTERVAL=10
DEVPATH=hwmon2=devices/platform/f71882fg.544
DEVNAME=hwmon2=f71862fg
FCTEMPS=hwmon2/device/pwm1=hwmon2/device/temp2_input
FCFANS= hwmon2/device/pwm1=hwmon2/device/fan1_input
MINTEMP=hwmon2/device/pwm1=50
MAXTEMP=hwmon2/device/pwm1=70
MINSTART=hwmon2/device/pwm1=76
MINSTOP=hwmon2/device/pwm1=52
[size=75]2009/Oct: Jetway JNC81-LF * 4850e naked under fanless Xigmatek Apache * Antec mini Skeleton w/Nexus 120mm PWM fan * Delta 90W brick w/Skeleton DC-DC board * WD2500BEVT 250Gb blue[/size]

psyopper
Friend of SPCR
Posts: 336
Joined: Fri Mar 28, 2008 1:15 pm
Location: Portland, Oregon

Post by psyopper » Sun Apr 18, 2010 5:20 pm

I had to use update-rc.d to remove fancontrol and then reinsert fancontrol into the startup subsystem.

my fancontrol.conf looks like this

Code: Select all

INTERVAL=2
DEVPATH=hwmon0=devices/platform/it87.656
DEVNAME=hwmon0=it8720
FCTEMPS=hwmon0/device/pwm2=hwmon0/device/temp1_input hwmon0/device/pwm1=hwmon0/device/temp1_input
FCFANS=hwmon0/device/pwm2=hwmon0/device/fan2_input hwmon0/device/pwm1=hwmon0/device/temp1_input
MINTEMP=hwmon0/device/pwm2=40 hwmon0/device/pwm1=40
MAXTEMP=hwmon0/device/pwm2=60 hwmon0/device/pwm1=60
MINSTART=hwmon0/device/pwm2=30 hwmon0/device/pwm1=30
MINSTOP=hwmon0/device/pwm2=101 hwmon0/device/pwm1=101
MINPWM=hwmon0/device/pwm2=100 hwmon0/device/pwm1=100
MAXPWM=hwmon0/device/pwm2=180 hwmon0/device/pwm1=180
I have two black/white D12-SL12's in my case, both purchased from www.endpcnoise.com (they're actually local to me). One of them is about 3 years old and has a white sticker on both the fan and the frame, this one is pwm2 on the SYS_FAN header. The other is brand new and has an orange sticker on the frame and no sticker on the fan, this is pwm1 on the CPU_FAN header. I have them both slaved to the CPU Temp, temp1.

They perform distinctly differently from each other. Right now with matched settings and the CPU idling at 34C, pwm1 = 436RPM and pwm2 = 561RPM. At PWM255 pwm1 = 950 RPM and pwm2 = 1120 RPM. They both sound nearly identical.

psyopper
Friend of SPCR
Posts: 336
Joined: Fri Mar 28, 2008 1:15 pm
Location: Portland, Oregon

Post by psyopper » Sun Apr 18, 2010 5:24 pm

Oh - and the vast majority of my machine noise is now gone!

Post Reply