a 2009 macbook pro, 9°C cooler and quieter
i have an old macbook pro running headless ubuntu 24.04 on my tailnet. i call it mac-ubuntu. it has a core 2 duo p7550, 8 gb of ram, and an nvidia geforce 9400m. it does its job, but it ran hot at idle and i didn’t love that. i’d already fixed the gpu driver on blackbox and watched it run way cooler afterwards, so i wanted the same thing here.
it took one night, one network fix, a stack of community patches, and one reboot that took long enough to scare me.
the problem: a hot laptop doing nothing
at idle, with basically zero load (load average around 0.03), the box looked like this:
- cpu die sensor: ~65°C
- cpu cores: 62°C
- chipset/gpu sensor: 59°C
- fan: ~3,700 rpm
that’s really hot for a machine doing nothing. the cpu was scaling down to 800 mhz properly, so it wasn’t software spinning. the problem was the gpu. it was running on nouveau, the open-source driver, and nouveau can’t really reclock this chip (its reclocking support covers some discrete cards from this era, not the integrated 9400m). so the 9400m sat at full clocks forever. when i first loaded the nvidia driver, it reported 69°C at P0, the highest performance state.
the 9400m is also the chipset, and it shares a heatsink with the cpu. a hot gpu means a hot cpu too.
step 1: the box didn’t actually have internet
before i could download anything, i found out the box couldn’t reach github or nvidia. i assumed something was blocking it. nothing was.
the netplan config still had a static ip (10.0.0.17, gateway 10.0.0.1) from when it lived in a computer lab. on my current network nothing answers at that gateway, so ipv4 was just dead. it still half-worked because ipv6 autoconfigured fine, so tailscale, ssh, and even ubuntu’s mirrors kept working. github and nvidia’s download server are ipv4-only, so those failed.
the fix was switching enp0s10 to dhcp4: yes. this box is headless, so a bad network change would lock me out with no screen to fix it from. i did it with a safety net: back up the config, schedule an automatic rollback, apply the change, and only cancel the rollback if ipv4 actually works.
sudo cp /etc/netplan/01-netcfg.yaml /root/netplan.bak # your file name may differ
sudo systemd-run --on-active=150 --unit=netplan-rollback sh -c 'cp /root/netplan.bak /etc/netplan/01-netcfg.yaml && netplan apply'
sudo netplan apply
curl -4 -sI https://github.com | head -1 # does ipv4 work now?
sudo systemctl stop netplan-rollback.timer # only if it does
if the new config had cut me off, the timer would have restored the old one 150 seconds later. it came up with a dhcp address, github returned 200, and i cancelled the rollback.
step 2: nvidia 340 on kernel 6.8
the 9400m is a tesla-era chip. the last nvidia driver that supports it is 340.108, and it’s end of life: nvidia says 340.108 supports kernels up to linux 5.4, and no more 340 releases are planned. ubuntu 24.04 doesn’t package it, and out of the box it won’t build against kernel 6.8.
the community has kept it alive anyway. the arch aur nvidia-340xx package carries patches all the way through modern kernels and compilers (5.7 up through 6.8, plus gcc 14 and gcc 15 fixes). here’s what i did:
- downloaded
NVIDIA-Linux-x86_64-340.108-no-compat32.runand extracted it with--extract-only - applied all 19 aur patches, in the order the pkgbuild lists them. my first attempt skipped one and two hunks failed, so apply all of them
- test-built the kernel module on its own first, without installing anything
- installed it with dkms and without the desktop bits, since this box has no desktop
- blacklisted nouveau and rebuilt the initramfs
- added a small systemd service that turns on persistence mode at boot
the install and nouveau steps look like this:
sudo ./nvidia-installer --dkms --no-opengl-files --no-x-check
printf 'blacklist nouveau\noptions nouveau modeset=0\n' | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
sudo update-initramfs -u
and the persistence service just runs nvidia-smi -pm 1 once at boot.
the reboot took about 4 minutes and made me think i’d bricked it. then nvidia-smi showed the 9400m sitting in P12, its low-power state, instead of being stuck at full clocks.
i also put the kernel packages on hold (apt-mark hold linux-generic ...). this driver is patched together, and a kernel update could break the dkms rebuild. i’d rather update the kernel on purpose and test it first.
the results
i ran the fans at max for about 90 seconds, gave control back to mbpfan, and waited for it to settle on its normal curve before taking these numbers. i didn’t measure with the fans pinned, since that wouldn’t be a fair idle number.
| sensor | before (nouveau) | after (nvidia 340) |
|---|---|---|
| cpu die (TC0D) | ~65°C | ~56°C |
| cpu cores | 62°C | 58–59°C |
| chipset (TN0D) | 59°C | ~56°C |
| gpu (nvidia-smi) | 69°C at P0 | 54°C at P12 |
| fan | ~3,700 rpm | ~2,670 rpm |
so it went from about 65°C at idle to under 60°C, and the fan spins about 1,000 rpm slower to do it. the fan part is the real win. cooler and quieter at the same time means the heat source actually went down, not that the fan worked harder.
to be honest about it: these readings were taken a few minutes after the cooldown, and things were still creeping up a degree or so. i’ll check again after it’s been idle for a few hours and update this.
quick answers
does nvidia 340.108 work on linux kernel 6.8? not officially. nvidia stopped at linux 5.4. with the aur’s nvidia-340xx patches applied in order, it builds and runs on ubuntu 24.04’s 6.8 kernel.
why does my geforce 9400m run hot on linux?
check whether it’s stuck at full clocks on nouveau. nvidia-smi on the proprietary driver should show P12 at idle, not P0.
is it safe to change netplan on a headless box?
only with a way back. a systemd-run timer that restores the old config is a cheap undo button.
what’s next
- cuda 6.5. the toolkit is installed and
nvccruns, but cuda 6.5 only supports gcc 4.8 and older, and ubuntu 24.04 ships gcc 13. i still need a compiler that works with it. realistically, 16 cuda cores sharing system ram won’t beat the cpu at anything. i just want the gpu fully working. - thermal paste. the cores still idle near 60°C at almost zero load. on a machine this old the paste is almost certainly dried out, so a repaste is probably the next big drop.
this macbook now also drives an ipad mini dashboard that shows its temps live.
if you have an old nvidia laptop chip running hot on modern linux, check whether it’s stuck at full clocks on nouveau. the legacy driver plus the aur patches is a lot of work, but it made a real difference here.