How to re-enable Instant GPU Switching / GPU Switching on the fly on MacBook Pro Mid 2009 (MacBookPro5,2)
Background: As you may know, the classic first real "unibody" MacBook Pro Early/Mid 2009 (MacBookPro5,2) came with an integrated and a discrete graphics card, a nVidia GeForce 9400M (integrated) and a more capable nVidia GeForce 9600M GT. While both GPU hardwares are capable of instantly switching from one to the other, subsequently called "Instand GPU Switching" or "GPU Switching on the fly", Apple never integrated it into their OS releases before declaring the MacBookPro5,2 EoL. The feature was however implemented by third-party applications like
gfxCardStatus,
gSwitch,
gpu-switch, until Apple broke the underlying OS mechanism in macOS 10.13.0 High Sierra. For more details, I'd like to refer to a
2019 macrumors post of mine.
After quite some research, I think I have now managed to reenable the MacBook Pro's "Instant GPU Switching" ability by a few rather simple steps at least on High Sierra and Mojave and I would like to share the following info with you.
Tested on: macOS 10.13 High Sierra, macOS 10.14 Mojave, macOS 12 Monterey (
1)
Yet to be tested on (volunteers welcome! @hvds , @jackluke ?): macOS 10.15 Catalina, macOS 11 Big Sur
Works with: gfxCardStatus 2.5 by Cody Krieger (although the author, obviously unaware of this hack, lists the MacBook Pro 2010 series as his application's minimum requirement),
gfxCardStatus 2.4.x (fork by Steve Schow)
Please note: In the following steps, I've used a High Sierra / Mojave installation stick generated by
@dosdude1's
High Sierra Patcher /
Mojave Patcher to boot from to cleanly rebuild the system partition's kext cache. If you follow these steps, you also need to prepare one in advance!
Steps:
Download Apple's last security update for macOS 10.12.6 Sierra, Security Update 2019-005:
Bash:
wget https://swcdn.apple.com/content/downloads/55/63/061-41803-A_87X0EHD65R/gt50wt0ye0twqkj227l9g7vw2ok4nl72a6/SecUpd2019-005Sierra.pkg -O /tmp/SecUpd2019-005Sierra.pkg
Expand the downloaded Security Update 2019-005 via the undocumented pkgutil switch "--expand-full":
Bash:
pkgutil --expand-full "/tmp/SecUpd2019-005Sierra.pkg" "/tmp/SecUpd2019-005Sierra"
Backup your current system's /System/Library/Extensions/AppleGraphicsControl.kext/Content/PlugIns/AppleMuxControl.kext to a safe location.
Delete your current system's /System/Library/Extensions/AppleGraphicsControl.kext/Content/PlugIns/AppleMuxControl.kext
(before doing that, please make absolutely sure you have a working High Sierra / Mojave installation stick generated by dosdude1's High Sierra Patcher / Mojave Patcher to reboot from):
Bash:
sudo rm -rf /System/Library/Extensions/AppleGraphicsControl.kext/Content/PlugIns/AppleMuxControl.kext
(do not touch AppleMuxControl2.kext, which exists since macOS 10.13.3 and is - to the best of my knowledge - not relevant here)
Copy AppleMuxControl.kext version 3.14.52b52 from Sierra's Security Update 2019-005 to /S/L/E/AppleGraphicsControl.kext/Contents/PlugIns (in other words to the place where you've just deleted your system's current AppleMuxControl.kext):
Bash:
sudo cp -p -R /tmp/SecUpd2019-005Sierra/Payload/System/Library/Extensions/AppleGraphicsControl.kext/Contents/PlugIns/AppleMuxControl.kext /System/Library/Extensions/AppleGraphicsControl.kext/Contents/PlugIns/
Shutdown your system, reboot from your High Sierra / Mojave installation stick generated by dosdude1's
High Sierra Patcher /
Mojave Patcher (depending on whether you have High Sierra or Mojave, of course).
Once you've booted into your installation stick's installer, launch dosdude1's macOS Post Install from the Utilities window.
In the launched macOS Post Install utility, select "MacBookPro5,2" as your Mac model and your system partition under "Select Volume:", deselect all patches / patch options for your MacBookPro5,2, as we don't want to overwrite our modified AppleMuxControl.kext (this is important!). Select "Force Cache Rebuild" and click on Reboot.
On reboot, reset your MacBook Pro's NVRAM by using CMD + Shift + P + R (this is also important!).
After the NVRAM reset's reboot, log into High Sierra / Mojave, launch gfxCardStatus and now switch instantly between your nVidia GeForce 9400M and 9600M GT again!
Please note: In my experience, Instant GPU Switching can be blocked by either specific applications creating dependencies to the discrete GPU (specifically QT-based applications like
Nextcloud Client …) or broken NVRAM settings. If you encounter difficulties with Instant GPU Switching, a reboot + a NVRAM reset is recommended.
Any feedback would be highly appreciated, of course!