Skip to content
Kext for disabling a failed NVIDIA GPU after waking up from sleep.
C++
Branch: master
Clone or download
Pull request Compare This branch is 8 commits ahead of blackgate:master.
timpalpant Merge pull request #2 from chiccomask/master
updated README, fix grub entry and added more info
Latest commit 659e256 Feb 4, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
NVDAGPUWakeHandler.xcodeproj Add Controller.cpp to Xcode project Jan 29, 2019
NVDAGPUWakeHandler Add com.apple.kpi.bsd OSBundle, fix header, fix typo Feb 2, 2019
.gitignore
README.md

README.md

NVDAGPUWakeHandler

This kernel extension disables the NVIDIA GPU after waking up from sleep. It is intended to be used on a 2012 MacBook Pro (retina) with a failed NVIDIA GPU.

It is adapted from AMDGPUWakeHandler (for 2011 MacBook Pros with AMD GPUs).

NOTE: To use this extension, you will also want to disable the GPU at boot time using the Grub config:

set timeout=10
menuentry "macOS" {
  outb 0x7c2 1
  outb 0x7d4 0x28
  outb 0x7c2 2
  outb 0x7d4 0x10
  outb 0x7c2 2
  outb 0x7d4 0x40

  outb 0x7c2 1
  outb 0x7d4 0x50
  outb 0x7c2 0
  outb 0x7d4 0x50
  exit
}

See this gist for more info on how to set up booting from Grub.

Build with Xcode

To build the kext with Xcode you must disable SIP. Running recovery mode may be difficult with the broken NVIDIA GPU, you could try to create a macOS usb stick and run it to disable SIP.

To build the kext make sure the OSBundle versions in the Info.plist file match the kernel version of your system.

To check your kernel version run from terminal:

system_profiler SPSoftwareDataType

Installation

After building using Xcode, copy the kext to /Library/Extensions and run the following commands from terminal:

sudo chown -R root:wheel /Library/Extensions/NVDAGPUWakeHandler.kext
sudo touch /Library/Extensions

Reboot.

Manual loading

If you prefer to load the kext manually, then after building the kext, copy it to a location of your choice and run the following command to change its permissions:

sudo chown -R root:wheel /path/to/NVDAGPUWakeHandler.kext

Then when you want to load the kext you can simply run the command:

sudo kextload /path/to/NVDAGPUWakeHandler.kext

To unload:

sudo kextunload /path/to/NVDAGPUWakeHandler.kext

View logs

To view the logs for the last 24 hours run the following on the terminal:

log show --last 24h --predicate 'senderImagePath contains "NVDAGPUWakeHandler"'

Brightness control

To enable brightness control, after loading this kext, you can run NativeDisplayBrightness

You can’t perform that action at this time.