Skip to content

timpalpant/NVDAGPUWakeHandler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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