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
make
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 ~/macprofan.py

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 4 comments  

FeedBurner FeedCount

Subscribe to RSS feed