Fan control python script for 8-core Mac Pro

Ok, here it is. Sorry for the long wait.

This is a quick and dirty Python script to control the fan RPM on a 8-core Mac Pro (might work on other Mac Pro's too but hasn't been tested). You need the following things to get this thing running:

1. You need one of the following kernels:

-2.6.23 custom kernel that I posted in one of the previous posts
-any other mactel-linux patched kernel, that includes the 8-core mac pro temperature patch

It might work on other mactel-linux patched kernels too, but again, this hasn't been tested, so try this at your own risk. It will NOT run on 2.6.23 and previous unpatched kernels as the core temperature won't be read correctly. This might result in a too low RPM, so DO NOT TRY THIS!

The temperature patch was incorporated into the mainstream kernel at 2.6.24, but I haven't tested this.

2. The "coretemp" binary.

Unfortunately this binary was removed from the mactel-linux patches some time ago as it was incorporated into the kernel. As I have no idea how to access the data from the kernel, my script uses this binary to read the CPU temp. It's very primitive, but it works.

This is how you can get the coretemp binary:

a) Create a new directory in tmp

mkdir /tmp/coretemp
b) Save this link (the source of the Makefile) to /tmp/coretemp/Makefile

c) Save this link (the source of the coretemp program) to /tmp/coretemp/coretemp.c

d) Compile with
cd /tmp/coretemp
e) Copy the coretemp binary to /usr/bin
sudo cp /tmp/coretemp/coretemp /usr/bin
f) Download this script to your home directory, for example.

g) run the script with
sudo ~/

This is important. You have to run it with sudo!

You have to leave the terminal open, so the script can run in the background all the time. Do not close it or the fans won't be controlled.

Make sure you monitor the temperatures and fan RPMs the first time you run the script. There's a lot that can go wrong. If you have the wrong kernel, you're temperature readings may be off, resulting in too low/too high RPMs.

Again, this is a quick and dirty solution to the problem. Don't look at the code if you have a weak heart. ;)

Please don't forget to leave feedback including your kernel and other system infos. Thanks!

Posted byvfxdude at 10:26 AM  


vfxdude said... September 26, 2008 at 10:59 AM  

Did anyone have a chance to try the script? Please let me know. Thanks!

Simen said... October 7, 2008 at 11:03 PM  

You rock! I will try it out when I got the time.

Simen said... November 11, 2008 at 11:31 PM  

It does not work in 8.10 with kernel 2.6.27-7. I try to modproble applesmc and it says:

sudo modprobe applesmc

FATAL: Error inserting applesmc (/lib/modules/2.6.27-7-generic/kernel/drivers/hwmon/applesmc.ko): No such device

Sascha said... May 18, 2009 at 5:01 PM  

Unfortunately the link to the python script is broken. Could you please post it again? I would really like to give it a try on my MacPro.

Post a Comment

FeedBurner FeedCount

Subscribe to RSS feed