I solved the brightness control problem in High Sierra 10.13.6 with all the updates installed (10 / August / 2018) with AMDGPUWakeHandler.kext
without GRUB Solution. Yes, only AMDGPUWakeHandler.kext
(source code changed).
Works brightness slider and F1 / F2 keys.
In the High Sierra (10.13) the brightness control is done by AGDCBacklightControl.kext.
The AGDCBacklightControl.kext is connected to the AMD6000Controller.kext.
The AMD6000Controller.kext has the dependent kexts: AMDLegacySupport.kext and AMDLegacyFramebuffer.
If you use GRUB Solution at boot (grub.cfg), then your AMD GPU will be Power Off and the AMD6000Controller.kext will not be loaded at boot time.
Consequence: you lose control of brightness.
It was necessary to change a portion of the AMDGPUWakeHandler.cpp source code. See the description below.
I'm going to make a video this saturday of how AMDGPUWakeHandler (AMDGPUWakeHandler.cpp) was changed and compiled.
I do not tested the Computer Sleep.
Still in the test phase.
Tested machine:
- Macbook Pro 15" Early 2011 - Intel HD Graphics 3000 (Device ID: 0x0126) / AMD Radeon HD 6750M (Device ID: 0x6741)
- Model Identifier: MacBookPro8,2
- File System: APFS (Encrypted)
- Boot ROM Version: MBP81.0050.B00
- SMC Version (system): 1.69f4
- System Version: macOS 10.13.6 (17G65)
- Kernel Version: Darwin 17.7.0
- XCode 9.4.1 (9F2000) - Necessary to compile the changed source code of AMDGPUWakeHandler.kext.
https://github.com/blackgate/AMDGPUWakeHandler
- Only AMDRadeonX3000.kext has been moved from /System/Library/Extensions to /DisableExtensions . Otherwise Macbook Pro will freeze on the gray screen during normal boot.
See MikeyN Guide - create directory and move AMDRadeonX3000.kext .
- SIP must be totally disabled to move the AMDRadeonX3000.kext. Otherwise you will receive the message: Operation not permitted.
Boot Recovery Mode (press Command + R at boot) -> Utilities -> Terminal:
After you move AMDRadeonX3000.kext, you can partially enable
SIP in Recovery Mode for more system protection.
Loads unsigned kexts - AMDGPUWakeHandler.kext .
Code:
csrutil enable --without kext
reboot
The AMDGPUWakeHandler.cpp makes a condition before to see if the AMD GPU continues with Power On. If so, the AMDGPUWakeHandler.kext is not loaded.
Messsage log: Failed to Load. Discrete GPU was powered on.
It is necessary to change a portion of the source code so that AMDGPUWakeHandler.kext is loaded with the AMD GPU with Power On.
https://github.com/blackgate/AMDGPUWakeHandler/blob/master/AMDGPUWakeHandler/AMDGPUWakeHandler.cpp
Original
AMDGPUWakeHandler.cpp: if (get_discrete_state() != 0) {
Modified
AMDGPUWakeHandler.cpp: if (get_discrete_state() == 0) {
After manually loading the AMDGPUWakeHandler.kext, then the AMD GPU goes to Power Off. Temperature check by IstatMenu 5.32 - Sensors: GPU Die Analog.
0 - Remembering that it is mandatory set up gpu-power-prefs to Intel GPU - Boot in Single User Mode (press Command + S at boot):
Code:
nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00
1 - Partially disabled SIP (Loads unsigned kexts - AMDGPUWakeHandler.kext)
SIP totally disabled (csrutil disable) -> less system protection. It is not good.:
Boot Recovery Mode (press Command + R at boot) -> Utilities -> Terminal:
Code:
csrutil enable --without kext
reboot
Boot-args only with verbose:
or
Code:
sudo nvram boot-args="-v"
2 - Manual loading of AMDGPUWakeHandler.kext (modified) with kexutil - after boot normal -> login -> Finder -> Applications -> Utilities -> Terminal:
Code:
sudo kextutil /Users/Shared/AMDGPUWakeHandler.kext
Kext with invalid signatured (-67062) allowed: <OSKext 0x7f868ac11290 [0x7fff9d67faf0]> { URL = "file:///Users/Shared/AMDGPUWakeHandler.kext/", ID = "io.github.blackgate.AMDGPUWakeHandler" }
Code Signing Failure: not code signed
3 - Verify that the AMDGPUWakeHandler.kext has been loaded:
Code:
kextstat | grep -i AMD
com.apple.kext.AMDLegacySupport (1.6.8)
com.apple.kext.AMD6000Controller (1.6.8)
com.apple.kext.AMDLegacyFramebuffer (1.6.8)
io.github.blackgate.AMDGPUWakeHandler (1)
4 - View log AMDGPUWakeHandler.kext last 1 hour:
Code:
log show --last 1h --predicate 'senderImagePath contains "AMDGPUWakeHandler"'
Filtering the log data using "senderImagePath CONTAINS "AMDGPUWakeHandler""
Skipping info and debug messages, pass --info and/or --debug to include.
Timestamp Thread Type Activity PID TTL
2018-08-10 21:53:23.013052-0300 0x1979 Default 0x0 0 0 kernel: (AMDGPUWakeHandler) Initializing
2018-08-10 21:53:23.013067-0300 0x1979 Default 0x0 0 0 kernel: (AMDGPUWakeHandler) Probing
2018-08-10 21:53:23.013080-0300 0x1979 Default 0x0 0 0 kernel: (AMDGPUWakeHandler) Starting
2018-08-10 21:53:23.013198-0300 0x1be Default 0x0 0 0 kernel: (AMDGPUWakeHandler) Waking up
2018-08-10 21:53:23.013202-0300 0x1be Default 0x0 0 0 kernel: (AMDGPUWakeHandler) Disabling GPU
--------------------------------------------------------------------------------------------------------------------
Log - Default: 10, Info: 0, Debug: 0, Error: 0, Fault: 0
Activity - Create: 0, Transition: 0, Actions: 0
5 - View kextstat AGDCBacklightControl.kext - This kext is responsible for the brightness control (High Sierra - 10.13):
Code:
kextstat | grep -i Back
com.apple.driver.AppleBacklightExpert (1.1.0)
com.apple.driver.AGDCBacklightControl (3.20.13)
6 - System Information -> Software -> Logs -> IORegistry Contents -> AMDGPUWakeHandler:
Code:
+-o AMDGPUWakeHandler <class AMDGPUWakeHandler, id 0x10000064a, !registered, !matched, active, busy 0, retain 5>
{
"IOProbeScore" = 0x0
"CFBundleIdentifier" = "io.github.blackgate.AMDGPUWakeHandler"
"IOProviderClass" = "IOResources"
"IOClass" = "AMDGPUWakeHandler"
"IOMatchCategory" = "AMDGPUWakeHandler"
"IOPowerManagement" = {"CapabilityFlags"=0x2,"MaxPowerState"=0x1,"CurrentPowerState"=0x1}
"IOResourceMatch" = "IOKit"
}
Update 1:
You must have in your
grub.cfg two options to Power Off the AMD GPU or leave the AMD GPU Power on - High Sierra 10.13.
grub.cfg:
menuentry "macOS with outb - Power Off AMD GPU at boot - lose brightness control HighSierra" {
outb 0x728 1
outb 0x710 2
outb 0x740 2
outb 0x750 0
exit
}
menuentry "macOS without outb - AMD GPU stay Power On at boot - with brightness control HighSierra" {
exit
}