Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nsgr

macrumors 6502
May 22, 2017
317
117
@brainshutdown, @nsgr

I found this article regarding kext signing and unsigned kexts bypassing the SIP protocol. I can vaguely understand a few things, but, maybe you guys can shed light on this for us.

https://pikeralpha.wordpress.com/2015/07/28/apples-kext-signing-bypassed/
[doublepost=1518736811][/doublepost]

Wouldn't that require a password prompt to begin with? Any attempted changes inside the System folder requires root admin privileges, like installing apps in the Applications and Utilities folder.

Unfortunately I'm using the High Sierra. This PikerAlpha procedure was done in El Capitan. Many safety measures have been increased in the High Sierra in relation to kexts protection.
 

xanderx007

macrumors 6502
Nov 7, 2017
262
140
Unfortunately I'm using the High Sierra. This PikerAlpha procedure was done in El Capitan. Many safety measures have been increased in the High Sierra in relation to kexts protection.

But, wouldn't that be applicable SIP-wise?
 

nsgr

macrumors 6502
May 22, 2017
317
117
But, wouldn't that be applicable SIP-wise?

High Sierra has changed about how you handle the video (example brightness) and security system.

By the explanations of PikerAlpha you have to change the Prelinkedkernel and edit in a HexEditor. This at El Capitan. In the Sierra in High Sierra must have changed the hexadecimal values.

And the people here in the forum already have difficulty changing a SIP disable. Imagine changing hexadecimal codes that you have to pay close attention to.
 

nsgr

macrumors 6502
May 22, 2017
317
117
It would be better to use the Aurora Wright tip and use SIP enable --without kext. At least you do not have SIP completely disabled. #147

Boot at Recovery Mode Graphical (Command + R) or Recover Single User Mode (Command + R + S)
Code:
csrutil enable --without kext

reboot


Boot normal and confirm SIP status after login (Kext Signing: disabled):
Code:
csrutil status
System Integrity Protection status: enabled (Custom Configuration).
Configuration:
    Apple Internal: disabled
    Kext Signing: disabled
    Filesystem Protections: enabled
    Debugging Restrictions: enabled
    DTrace Restrictions: enabled
    NVRAM Protections: enabled
    BaseSystem Verification: enabled
This is an unsupported configuration, likely to break in the future and leave your machine in an unknown state.
 

jangoux

macrumors newbie
Jan 5, 2018
2
0
Dentro do estúdio
When I do the steps do boot directly from the HD my Macbook behaves extremely slow. Here is what I did :

Code:
cd /Volumes
sudo mkdir efi
sudo mount -t msdos /dev/disk0s1 /Volumes/efi
sudo mkdir /Volumes/efi/boot
sudo mkdir /Volumes/efi/EFI/grub
sudo cp -R /Volumes/RESCUE/boot/ /Volumes/efi/boot
sudo cp -R /Volumes/RESCUE/EFI/boot/ /Volumes/efi/EFI/grub
sudo bless --folder=/Volumes/efi --file=/Volumes/efi/EFI/grub/grubx64.efi --setBoot
sudo bless --mount=/Volumes/efi --file=/Volumes/efi/EFI/grub/grubx64.efi --setBoot

If I boot back from the USB drive, it behaves like it should again.

Also, if I have two OSX boot partitions, should I do this to both partitions ?
 

muddyMic

macrumors newbie
Mar 17, 2018
1
0
Hey Guys,

first of all thanks to brainshutdown and all the others who helped make this solution work. It enabled me to go on with my doctor's thesis on an otherwise useless machine! (I'm on El Capitan)

I have one question, however:
How do I completely revert the GRUB fix? (without deleting anything)
My seemingly cursed computer developed another problem and won't boot properly anymore - I'll spare you the details...
So I at least want to revert it to its original state to see if the GRUB fix has had anything to do with it (preferably though in such a manner that I can easily go back to the GRUB fix again when the time comes; so if possible I want to avoid removing the copied folders, and a complete reinstall of El Capitan is also out of question - for now...)
I'm guessing I only have to bless the correct folder / unbless the newly copied folders but since I'm a real noob with this kind of deep computer knowledge I would greatly appreciate a line by line solution similar to what jangoux wrote directly above.
I can boot my MBP 2011 in target disk mode as an external drive of a second MBP (2012, not mine) so the graphics issue can hopefully be bypassed for testing purposes.

I've already moved the AMDGPUwake...kext to another folder, so this part should be done.
I only need to use the normal mac boot code/folder/whatever again.

I really hope that s.o. here will read this and take the few minutes to write it down, it 'll probably be fairly easy..
Or maybe you can point me to an error in my thinking..
(Unfortunately I'm completely confused now by giving myself a two week "internet intensive course" in general UNIX, LINUX and specific MAC command line to at least copy my data safely to another hard drive - which worked...but I can't afford to spend another two weeks learning the intricate details of booting and blessing etc.....)
I just hope I can go on with my work as soon as possible!

Wish you all the best and may your MacBookPros lead a long and healthy life! ;)
 

abetancort

macrumors member
Oct 6, 2013
31
3
TheCanaries
High Sierra has changed about how you handle the video (example brightness) and security system.

By the explanations of PikerAlpha you have to change the Prelinkedkernel and edit in a HexEditor. This at El Capitan. In the Sierra in High Sierra must have changed the hexadecimal values.

And the people here in the forum already have difficulty changing a SIP disable. Imagine changing hexadecimal codes that you have to pay close attention to.

Actually changing 2 digit codes or copying them at the right address is much easier than working in console, the drawback is that you have to trust the source of those changes. It easy that any unintended mistake in the proposed changes when applied renders your OS unstable and not understanding what the changes do, the source could easily plant an intentional security hole (exploit) in your Mac without your knowledge.
[doublepost=1524083605][/doublepost]
^ It's not an option to run without SIP enabled after the GRUB solution is applied because this is not my Mac on which I'm being asked to do the surgery. If it were my Mac, I could live with it. But I have three friends who need the solution, and I cannot leave them with this security vulnerability. (Any more than I can return them a Mac with which sleep cannot be used or it runs hotter with the other solution.) The layman will not understand; it's a whole different set of expectations. We need a signed kext post haste, so that they're returned a Mac with the security to which they've become accustomed.

You can do it with friends but you cannot if you are charging someone a steep price for something that it’s not your IP and is not meant to for anyone to make a profit with it by deceiving his customers into thinking the IP is his.
[doublepost=1524083773][/doublepost]
Commenting just for following thread.

You don’t need to post to follow a thread, you just need to mark it as a watched thread in the top of any of the post pages.
 
Last edited:

abetancort

macrumors member
Oct 6, 2013
31
3
TheCanaries
Which is what I pointed out earlier on. It's not as simple to have a kext signed on a whim, just because a user with layman friends want it post haste. I've been checking my developer account (I have one under my Apple ID), but they changed the terms. I now have to re-enroll my account as a developer ID, with additional legalese. Any signed kext is tied to that ID, and if that kext does harm to any system, that developer will be held liable.



Which I also pointed out. Since laymen users, even with admin privileges, don't necessarily (or are afraid to) dive into low-level coding, running the system with SIP disabled shouldn't really be much of an issue.

Addendum:

Found this discussion on Stackoverflow. It's a bit old, but it addresses the reason why kext signing isn't as easy as it sounds, since apple does not allow/no longer allows non-Apple kext at all.

View attachment 751377

Like the sudo command tell a sudoer the first time he runs it interactively: “With great power, comes great responsibility”.

Apple is not telling you not to develop kexts but it’s saying that it lays on your side to inform clearly and faithfully your users of the risks of your third party kext and collect from them corresponding waivers of responsibility.

Only if your information is false or you or any third party use your kexts for nefarious ends then you will feel the power of all mighty Apple fall on you. That’s what Apple should do, police the development of kexts to avoid their voluntary nefarious usage to harm the users.
 
Last edited:

nsgr

macrumors 6502
May 22, 2017
317
117
HighSierra 10.13.5 - Macbook Pro 15 Early 2011:

/System/Library/Extensions/AppleGraphicsControl.kext/Contents/PlugIns/

Who shows or does not show the Brightness Slider are the AGDCBacklightControl.kext and AGDCPluginDisplayMetrics.kext.
These two kexts do not exist in El Capitan or Sierra.

I've moved these two kexts -> rebuild cache -> and the Brightness Slider has reappeared. But it has no effect on brightness. But it is a breakthrough in the problem.


It is necessary to rebuild the cache so that the slider appears again:

Boot Single User (Command + S at boot) -> fsck -fy -> mount -uw / -> touch /System/Library/Extensions -> and wait 2 minutes before reboot.
 

Attachments

  • GRUB-AMD-MacbookPro_2011-HighSierra-10.13.5-Brightness-Slider.jpg
    GRUB-AMD-MacbookPro_2011-HighSierra-10.13.5-Brightness-Slider.jpg
    208.4 KB · Views: 656
Last edited:

funkwizard

macrumors newbie
Jun 28, 2018
14
1
How to connect my MBP early 2011 built with complete black screen on turning on to a PC with Linux (Ubuntu) installed on it and remove the *kexts file.I think my amd GPU chip has failed completely.I have a mini display port to HDMI adapter and a HDMI cable.
Does Ubuntu uses amd chip if yes the what Linux should I install on my pc.And one more thing can I install Ubuntu Linux on a 2.5 " internal hard dial(spare one) and boot the Mac from the hard drive with Linux installed and remove the *kexts file.
 

abetancort

macrumors member
Oct 6, 2013
31
3
TheCanaries
How to connect my MBP early 2011 built with complete black screen on turning on to a PC with Linux (Ubuntu) installed on it and remove the *kexts file.I think my amd GPU chip has failed completely.I have a mini display port to HDMI adapter and a HDMI cable.
Does Ubuntu uses amd chip if yes the what Linux should I install on my pc.And one more thing can I install Ubuntu Linux on a 2.5 " internal hard dial(spare one) and boot the Mac from the hard drive with Linux installed and remove the *kexts file.

No GPU, no native support for external Monitor but if you install a text based Linux you should not have any problems running it in your MacBook Pro, you will have to disable the support for the GPU in Ubuntu because the the hardware reports it as functional and the OS tries to use it to render the screen faster but you get a black screen.
 

nsgr

macrumors 6502
May 22, 2017
317
117
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:
Code:
csrutil disable
reboot

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:
Code:
nvram boot-args="-v"

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
}
 
Last edited:
  • Like
Reactions: abetancort

nsgr

macrumors 6502
May 22, 2017
317
117
Macbook Pro 15" Early 2011 - High Sierra 10.13.6 - XCode 9.4.1 (9F2000) - brightness control back again.

AMDRadeonX3000.kext must be outside the /System/Library/Extensions directory. Otherwise the Macbook Pro 2011 will freeze on the screen gray and overheat.

AMDGPUWakeHandler.kext can not be within directories /System/Library/Extensions or /Library/Extensions. Otherwise there will be Kernel Panic.

The AMDGPUWakeHandler.kext must be loaded by kextload or kextutil only after the graphic login. To automate the process you can use LoginHook.
https://gist.github.com/blackgate/17ac402e35d2f7e0f1c9708db3dc7a44#gistcomment-2682673

Video where AMDGPUWakeHandler.kext is modified to be loaded with AMD GPU Power On. GRUB must be disabled at boot time.
The screen was recorded in the resolution 1440x900 but at the time of exporting the video only had the resolution 1280x720.
The part where the commands entered in the Terminal appear, so see the video in Full Screen for better view.

I'm going to download IMovie to see if the quality gets better. But for now this is it.

https://streamable.com/w16pa


If you want to download the video above, then you have to right-click on the video and choose the option "Download Video".
The video will open in a new Tab and you click again with the right mouse button and choose the option "Download video as".
 
Last edited:

abetancort

macrumors member
Oct 6, 2013
31
3
TheCanaries
Hi,

Great work @nsr, you finally crack it and thanks a lot.

Now I can try to upgrade my MacBookPro 15” to High Sierra and see what happens. I’ll have my fingers crossed, while the upgrade.

Regards and congratulations,

Alfonso
 

nsgr

macrumors 6502
May 22, 2017
317
117
Hi,

Great work @nsr, you finally crack it and thanks a lot.

Now I can try to upgrade my MacBookPro 15” to High Sierra and see what happens. I’ll have my fingers crossed, while the upgrade.

Regards and congratulations,

Alfonso

The user cumandr reported kernel panic when coming back from Hibernate. I do not know if this was only with his Macbook Pro 2011 or if that's a problem on all Macbook Pro 2011.

The discussion of the problem begins in this post:

https://gist.github.com/blackgate/17ac402e35d2f7e0f1c9708db3dc7a44#gistcomment-2675984
 

monofase

macrumors member
Sep 26, 2017
72
22
Italy
@nate922
This solution should also work for you. In fact this is valid for any dual GPU MBP. The "outb" commands in the GRUB menu entry, which the kext tries to replicate when waking from sleep, are just telling the GMUX to switch GPUs and turn off the discrete graphics.

You can create the rescue thumb drive as described in guide to see if it works for you. Just be aware that the kext should only be used with the GRUB solution in place, otherwise it will kernel panic.

Tried on 2 nVidia machines:

MBP 2010 with nVIDIA: Works successfully! That's very good because it is difficult to disable nvidia Gpu and use accellerated Intel Graphics.
MBP Retina 2012 with nVIDIA: NOT Working. macOS boots up and I can still see the nVidia card under the Graphics pane. And it crashesa

Any solution to make it working with 2012 retina models?
 

takeshi74

macrumors 601
Feb 9, 2011
4,974
68
Basically a dupe of my post over on GitHub but I wanted to thank nsgr for the work and for sharing the info. It's nice to have brightness control with High Sierra and no need for GRUB.
 

abetancort

macrumors member
Oct 6, 2013
31
3
TheCanaries
Dear takeshi74,

In collaborative solutions, there are no dupes, just spreading the word . By the way can you leave a link to your post in GitHub, so it’s in the thread for anyone to consult it.

Thanks,

abetancort
 

Dave111

macrumors newbie
Nov 1, 2018
24
4
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:
Code:
csrutil disable
reboot

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:
Code:
nvram boot-args="-v"

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
}

Amazing work @nsgr !! Question, does this fix also apply to Sierra/El Capitan for sleep mode functionality?
 

nsgr

macrumors 6502
May 22, 2017
317
117
Amazing work @nsgr !! Question, does this fix also apply to Sierra/El Capitan for sleep mode functionality?



User kevinlul reported Kernel Panic with High Sierra on the posts below.

Unfortunately Apple does not help at all to solve this problem. Even providing basic information for the user to try to solve the problem.

I did the tests only with the High Sierra that had the problem with the brightness slider.


https://gist.github.com/kevinlul

https://gist.github.com/blackgate/17ac402e35d2f7e0f1c9708db3dc7a44#gistcomment-2682653

https://gist.github.com/blackgate/17ac402e35d2f7e0f1c9708db3dc7a44#gistcomment-2692845

https://gist.github.com/blackgate/17ac402e35d2f7e0f1c9708db3dc7a44#gistcomment-2693763
 
Last edited:

jdran

macrumors newbie
May 22, 2013
21
2
Thank you for the guide @brainshutdown and the rest for your inputs.
I m going crazy (my brains are going to shut down too!) because I see so many different approaches that I can't follow up, why one version is better or not than the other, but I ended up in trying the GRUB one (update will follow with the results).
One must keep notes down before evaluate every post, opinion, problem, bug, etc... Very difficult and easy to drive you mad!
I had already followed another solution but it seems it did not help. Probably because during boot, my dGPU was working before gfxCardStatus app is able to block the dpgu.

My question (as a new to GRUB approach -and other approaches in general-) is about unsigned kext.
Why is this so important to be signed?
During reading and evaluating all the solutions, I read about a user (Schmye Babbula) that is pledging for a signed kext regarding security, if I understood well. Why?
Please, explain to a total ignorant as I am, why signed kext is important? Are there any security holes?
Not that such problems will stop me from trying to revive my mbp.
Also, what will happen if I do not follow the kext guide (but only the grub one)?

My specs:
MBP 17'', Early 2011 with AMD Radeon HD 6750M 1024 MB
MacBookPro8,3 with El Capitan
 

xanderx007

macrumors 6502
Nov 7, 2017
262
140
@brainshutdown

I did something stupid. I've had my old MBP working back then until earlier. The SMC no longer works, but resetting the NVRAM still does. Now, I've tried redoing the grub, but, as soon as I press enter/return, the screen just goes black. After a while, it restarts. At least a couple of times or so, it stays on black screen, but does nothing else.

Any thoughts?

Edit:

The issue, I suppose is that the recent NVRAM reset deleted the EFI boot partition on the Mac, hence, why it goes to black. I've been reading up, I can start it up on Ubuntu booting from a flash drive, with a funny green screen with "nomodeset."

How do I incorporate this into the grub fix? My next course of action is reinstalling El C, but, if I can fix the boot.efi partition, I'd rather do that first.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.