Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Macbook Pro 2011 - Disable AMD GPU

Known Issues: On High Sierra there are problems related to the screen brightness and sleep issues.

1. Reset SMC and NVRAM

SMC: https://support.apple.com/en-us/HT201295

NVRAM: https://support.apple.com/en-us/HT204063

2. Change the gpu-power-prefs and disable SIP

Boot into recovery single user mode (press and hold Command + S + R) and run the following commands:

nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00
csrutil disable
reboot

3. Create a rescue thumb drive (Can be done in any OS)

In this step we will create a rescue thumb drive that you can use every time you are having trouble booting macOS.

3.1. Download ubuntu iso

http://releases.ubuntu.com/17.10/ubuntu-17.10-desktop-amd64.iso

3.2. Mount the iso

On Windows (7 and later) or Ubuntu should be straight forward (you just need to double click the iso). On macOS, assuming you have the iso in the Downloads folder, run the following command on the terminal:

hdiutil attach -nomount ~/Downloads/ubuntu-17.10-desktop-amd64.iso

Which should return something like:

/dev/disk2          	Apple_partition_scheme         	
/dev/disk2s1        	Apple_partition_map            	
/dev/disk2s2        	Apple_HFS  

Then run the following commands to mount and open the iso disk (in my case /dev/disk2)

mkdir /tmp/ubuntu 
mount -t cd9660 /dev/disk2 /tmp/ubuntu/
open /tmp/ubuntu/

3.3. Format and copy the files

Format your thumb drive as FAT32 and name it RESCUE, then copy the EFI and boot folders from the iso to your thumb drive.

3.4. Edit the grub.cfg file

On your thumb drive, open the file at boot/grub/grub.cfg with any text editor and change it to:

set timeout=10
menuentry "macOS" {
   insmod hfsplus
   outb 0x728 1
   outb 0x710 2
   outb 0x740 2
   outb 0x750 0
   search --set=root --file /System/Library/CoreServices/boot.efi
   chainloader /System/Library/CoreServices/boot.efi
}

If you are using High Sierra with APFS change it to:

set timeout=10
menuentry "macOS" {
    outb 0x728 1
    outb 0x710 2
    outb 0x740 2
    outb 0x750 0
    exit
}

If you have more than one macOS installed, add multiple menu entries like this (you can change the name):

set timeout=10
menuentry "macOS" {
    insmod hfsplus
    outb 0x728 1
    outb 0x710 2
    outb 0x740 2
    outb 0x750 0
    search --no-floppy --fs-uuid --set=root YOUR_UUID
    chainloader /System/Library/CoreServices/boot.efi
}

3.5. Boot you mac with the thumb drive

Boot your mac and when you hear the chimes, press and hold Option (alt) and then choose your thumb drive.

If you haven't added multiple menu entries in the last step, you just need to press enter when grub appears and go straight to step 4.

If you have multiple menu entries, when grub appears press c to open the grub console and run the command:

ls -l

A list of partitions should appear. Take note of the UUIDs for your macOS partitions.

Press ESC to exit the grub console.

Press e to edit one macOS menu entry you want to boot.

Replace YOUR_UUID with the uuid of your partition.

Press fn F10 to boot.

Your macOS should now boot normally.

3.6. Change the UUIDs on grub.cfg (Multiple menu entries only)

If you haven't added multiple menu entries, skip this step.

On your thumb drive, open the file at boot/grub/grub.cfg with any text editor and for each menu entry, replace YOUR_UUID with the uuid you got on the step 3.5.

You can now boot from the thumb drive without having to change the uuids every time.

4. Make it permanent

In this step we will make the macOS boot without the thumb drive.

After booting macOS with your thumb drive and with it still plugged, open the terminal and run the following commands (I will assume your thumb drive name is RESCUE, if not, replace RESCUE with your thumb drive name):

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

You are now able to boot without the thumb drive.

5. Preventing GPU from waking up from sleep (optional)

When waking up from sleep the GPU is enabled and will drain your battery faster and rise the temperatures slightly. To prevent this, you can use this kernel extension: https://github.com/blackgate/AMDGPUWakeHandler

6. Recover when macOS updates

Everytime macOS updates, you need to bless grub again. For this, you need to boot with your rescue thumb drive, and then on macOS terminal run the following commands:

cd /Volumes
sudo mkdir efi
sudo mount -t msdos /dev/disk0s1 /Volumes/efi
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
@SchmyeBubbula

This comment has been minimized.

Copy link

commented Oct 31, 2017

3.3 Will a simple Finder copy do? Do any ownership/permissions need to be set?

3.4 Ditto re ownership/permissions, and if editing in a Mac editor such as TextWrangler, does it need to be saved with Unix line endings, viz. linefeeds?

3.5 After pressing 'e', what are the exact steps & syntax to perform the edit?

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Oct 31, 2017

@SchmyeBubbula
3.3 Yes, a simple copy will do. And no you don't need to set any permissions/ownership.
3.4 Yes, you should mantain the Unix line endings (any good text editor should be able to detect that)
3.5 It's just text editing... when you press e, the menu entry is opened for editing, and you just need to replace the <YOUR UUID> with the uuid of your partition.

@RoboticEarthling

This comment has been minimized.

Copy link

commented Nov 2, 2017

Thanks very much for sharing this.

I followed these steps (using rEFInd in step 1 because I could not boot in recovery mode), but after entering my UUID (my partition's label is "Mac" and not "MacOS." Not sure if that matters.) in grub and trying to boot, I get the following error:

Can't get a FileSystem or LoadFile handle for boot volume
Boot failed, sleeping for 10 seconds before exiting...

Any idea what might be wrong?

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Nov 2, 2017

@RoboticEarthling
No it doesn't matter if the partition label is Mac or MacOS.
Are you running High Sierra?
If you are, you can try this menu entry:

menuentry "macOS" {
    outb 0x728 1
    outb 0x710 2
    outb 0x740 2
    outb 0x750 0
    exit
}

On my machine, this defaults back to booting macOS and the hack still works.

@RoboticEarthling

This comment has been minimized.

Copy link

commented Nov 3, 2017

@blackgate
I'm still running Sierra. I may have previously attempted to update to High Sierra (can't quite remember). But if I did I was unsuccessful because of the GPU issue.

Anyway I tried that menu entry and it worked perfectly. Thanks!

@ecstaticax

This comment has been minimized.

Copy link

commented Nov 4, 2017

On the last command, I receive an error:

Can't statfs /Volumes/efi/EFI/grub/grubx64.efi

I followed instructions perfectly, using the new menu entry for High Sierra...

Regards

@ecstaticax

This comment has been minimized.

Copy link

commented Nov 4, 2017

I think there may be a path mistake in your instructions. Now everything works, but when I reboot my Mac it goes into grub shell. I need to write "exit" and only then Mac os boots. How can remove the grub shell start? Thanks again.

@Dugganclock

This comment has been minimized.

Copy link

commented Nov 4, 2017

This method is great. A lot better than the others. One question is: if i have two separate drives containing two macos installations, how can i add these as separate working entries in the grub bootloader? I thought I did it correctly, but regardless of which drive uuid i use to boot, my mac will only boot to disk0. Cannot get it to boot disk1 even with the right uuid as a separate entry.

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Nov 4, 2017

@RoboticEarthling
You're welcome.

@ecstaticax
Did the mount command run without any error?
Make sure you have an EFI partition (you can run diskutil list to check).
To remove grub you just need to mount the EFI partition and remove the files

cd /Volumes
sudo mkdir efi
sudo mount -t msdos /dev/disk0s1 /Volumes/efi
sudo rm -rf /Volumes/efi/boot/grub/
sudo rm -rf /Volumes/efi/EFI/grub/

@Dugganclock
Yes. Create two entries in the step 3.4 (you can change the names), then when doing the ls -l take note of both uuids. and change them on step 3.6. The rest of the process is the same and the steps 4 and 6 should only be done once for the main EFI partition(disk0s1).

@ecstaticax

This comment has been minimized.

Copy link

commented Nov 5, 2017

Thanks for reply. I have the efi partition. The only problem I have is that I need to exit grub to boot Mac. Apart from this, everything is perfect. Since yesterday no reboots, but I need at least one week to be sure. Thanks.

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Nov 5, 2017

@ecstaticax
Did grub boot correctly from the thumb drive after the step 3.6?
Can you paste your grub.cfg here?

@nolaprinter

This comment has been minimized.

Copy link

commented Nov 5, 2017

blackgate - Thanks for your work so far!! I have 2 quick questions.

  1. Does your workaround work with OS 10.9.5 or do I need to upgrade to El Capitan or later?
  2. When I get to step 3.5 and try to boot into MacOS, I hit enter and the screen turns off and nothing happens (but the computer is still running) Here is what is in my grub.cfg file:
    menuentry "macOS" {
    insmod hfsplus
    outb 0x728 1
    outb 0x710 2
    outb 0x740 2
    outb 0x750 0
    search --no-floppy --fs-uuid --set=root 624b2137ff45a052
    chainloader /System/Library/CoreServices/boot.efi
    }

Thanks for your help!

@Miner01-PC

This comment has been minimized.

Copy link

commented Nov 6, 2017

I got to the sudo bless and I have this error: Could not set boot device property: 0xe00002bc

What went wrong?

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Nov 6, 2017

@Miner01-PC You need to disable SIP (2nd step)
@nolaprinter Did you change the nvram variable on the 1st step?

@FatlumIbishi

This comment has been minimized.

Copy link

commented Nov 7, 2017

I still get black screen after open the lid.. overall everything is perfect! Thank you @blackgate

@nolaprinter

This comment has been minimized.

Copy link

commented Nov 8, 2017

@blackgate - Just tried it again and it WORKED!! Thanks for all of your help!!!

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Nov 8, 2017

@Lumi89 Hum.. that's odd. Which macOS and Firmware/ROM version are you using? I'm using macOS 10.12.6 (Sierra) and my ROM version is "MBP81.0047.B3A".
@nolaprinter You're welcome.

@andywarduk

This comment has been minimized.

Copy link

commented Nov 10, 2017

This all works perfectly on High Sierra for me (thanks!) except that the panel backlight is no longer controllable. This I think then leads on to the next problem, which is probably the same as @Lumi89 - the panel backlight does not come back on after wake from sleep. I have installed AMDGPUWakeHandler but it's the same with or without it.

Boot ROM version is MBP81.004D.B00, MacbookPro8,3 (early 2011)

Any help greatly appreciated :)

@ecstaticax

This comment has been minimized.

Copy link

commented Nov 10, 2017

Hi @blackgate. I use high sierra, so I use the modified grub. This is my grub:

menuentry "macOS_High_Sierra" {
    outb 0x728 1
    outb 0x710 2
    outb 0x740 2
    outb 0x750 0
    exit
}

If I reboot I have a black screen and a grub prompt. I type exit and Mac boots. Btw it's nearly 6 days without reboots. Your medicine works :-)

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Nov 10, 2017

@andywarduk
The backlight problem is a known issue with High Sierra when the AMD kexts are removed or won't load(this solution). CurrentIy I don't see any advantage in updating, quite the opposite.

@ecstaticax
That's strange... When grub boots to a prompt, it normally means there is something wrong with your config file. It can be the line endings or incorrect file encoding... But if typing exit at the prompt works, you probably don't need grub anyway. I've heard that some people can boot into macOS just by changing the nvram variable (first step). That's probably your case.

@ecstaticax

This comment has been minimized.

Copy link

commented Nov 11, 2017

@blackgate

So what can I do to remove Grub?

These lines are ok?

cd /Volumes
sudo mkdir efi
sudo mount -t msdos /dev/disk0s1 /Volumes/efi
sudo rm -rf /Volumes/efi/boot/grub/
sudo rm -rf /Volumes/efi/EFI/grub/
@ecstaticax

This comment has been minimized.

Copy link

commented Nov 11, 2017

I tried the lines in previous message, but when I reboot I have the same black screen with grub :-O

@ecstaticax

This comment has been minimized.

Copy link

commented Nov 11, 2017

...and Mac doesn't boot anymore :-(

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Nov 11, 2017

@ecstaticax I'm sorry to hear that. If it's still booting grub, you probably have it in another place. Can you still boot by holding Option (alt) and choosing macOS? You can still reset NVRAM to force it to boot without grub.

@ecstaticax

This comment has been minimized.

Copy link

commented Nov 11, 2017

I made an usb install device and restored from time machine. I am testing nvram variable only.

@andywarduk

This comment has been minimized.

Copy link

commented Nov 13, 2017

Do you think it would be possible to restore the backlight in AMDGPUWakeHandler after wake up on High Sierra?

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Nov 13, 2017

@andywarduk I don't know. I'm using Sierra and everything is fine here. For me High Sierra doesn't add anything worth upgrading.

@FatlumIbishi

This comment has been minimized.

Copy link

commented Nov 15, 2017

@blackgate I have High Sierra (10.13.1) and ROM version is: MBP81.004D.B00, MacBookPro8,2.
Thank you @blackgate and @andywarduk. I'll try Sierra.

@herivorenz

This comment has been minimized.

Copy link

commented Nov 23, 2017

Hi there. I have been at this for days to no avail. Macbook pro 8,2 with El Capitan. All is good until step 3.5. I reboot and get the grub console and hit enter. Black screen holds for 40secs before restarting. Message appears 'Your computer restarted due to a problem'. It reboots back in normal mode. Have tried different usb sticks. Using:

set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

menuentry "macOS" {
insmod hfsplus
outb 0x728 1
outb 0x710 2
outb 0x740 2
outb 0x750 0
search --set=root --file /System/Library/CoreServices/boot.efi
chainloader /System/Library/CoreServices/boot.efi
}

Appreciate any suggestions where I am going wrong. Cheers,

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Nov 23, 2017

@herivorenz Repeat the first two steps, and make sure you type everything correctly.

@therif0

This comment has been minimized.

Copy link

commented Nov 25, 2017

Hey I've tried your solution and I get my mac to boot again!! GREAT!!!

but after booting into the mac it asks to initialize the thumbdrive...
and of course when arriving at the following steps :sudo cp -R /Volumes/RESCUE... it can't find this drive as it's not mounted.

any help?

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Nov 25, 2017

@therif0 To me, that sounds like you have a problem with your thumb drive, or you have formatted it with a file system your mac doesn't recognise.

@therif0

This comment has been minimized.

Copy link

commented Nov 26, 2017

@blackgate I formatted it in fat as suggested on ubuntu. but why can it read the content to boot, but then not in the OS.
I'm going to copy the content to dropbox on my linux pc and format the thumbdrive on mac os and copy on it again. it should be fine right?

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Nov 26, 2017

@therif0 Yes, it should work.

@m-a-v

This comment has been minimized.

Copy link

commented Dec 1, 2017

What is the advantage of this solution compared to the following (croll down to "100% WORKING SOLUTION")?

https://forums.macrumors.com/threads/force-2011-macbook-pro-8-2-with-failed-amd-gpu-to-always-use-intel-integrated-gpu-efi-variable-fix.2037591/

"On High Sierra there are problems related to the screen brightness and sleep issues."
Would it be possible to explain this in more detail?

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Dec 1, 2017

@m-a-v
I don't know, but some people say it's more stable. I'm using this for about one year and it has been stable so far.
I didn't really test on High Sierra, but some people have reported it has issues. If you want more details about those issues see the GRUB solution thread on macrumors.

@m-a-v

This comment has been minimized.

Copy link

commented Dec 2, 2017

Would it be possible to add a timeout for the boot menu?

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Dec 2, 2017

@m-a-v
Sure, you just need to set the timeout at the top of the grub.cfg file like this:

# Timeout of 10 seconds
set timeout=10
@m-a-v

This comment has been minimized.

Copy link

commented Dec 2, 2017

@blackgate: Thanks for the hint.

For macOS High Sierra users: By default hibernatemode is set to 3 [1]. Currently, the GPU does not wake up correctly with this settings on macOS High Sierra. A possible workaround is to use mode 25. With a fast hard disk the (SSD) the additional time required for startup is negligible.

sudo pmset -a hibernatemode 25

[1] https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/pmset.1.html

@m-a-v

This comment has been minimized.

Copy link

commented Dec 2, 2017

@blackgate: I would add the line with "set timeout=X" to 3.4. Normally, the user does not want to confirm the menu with the enter key every time.

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Dec 2, 2017

@m-a-v Ok, updated.

@luispuerto

This comment has been minimized.

Copy link

commented Dec 3, 2017

hey!!

Thanks a lot fo the fix!!! It would be great to be able to manage the brightness on High Sierra, but for now this make the work.

@transmogrify

This comment has been minimized.

Copy link

commented Dec 6, 2017

Hi @blackgate,
Thank you very much for the solution you are offering to us all MBP 2011 frustrated users. I have been following all relevant posts and solutions on this issue, i.e. https://tinyurl.com/ybqcn8wf and https://tinyurl.com/yamrarpe, as well as your instructions here. I decided to write here as I wanted to ask you several things below while referring to the numbered steps you have included with your instructions (please bare with me, and sorry for the long thread).

I have a 15" Macbook Pro (late 2011) 8,2 - intel core i7 - 2.2 Ghz - to which I have added a crucial RAM 16Gb (two slots of 8Gb). I have been running OS X Lion 6 years now. I have been given a free logicboard repair in the apple extension program two years ago. However, the GMU problem came back last week. I managed to do a clean/fresh install of OS X El Capitan 10.11.6 in a new crucial SSD (525Gb) I bought, using a bootable flash drive Mac OS installer I prepared in another laptop, and to solve temporarily the issue following the instructions by MikeyN without including MikeyN's executable. However, while running MaxMSP my computer dropped back into 'death' mode, which means that I did something wrong during the hack process. I repeated everything (i.e. a second clean/fresh install of OS X El Capitan 10.11.6 and followed MikeyN's solution), and now my MBP seems to be working again; I am writing this post from my hacked machine. However, I have decided to redo a (third) clean/fresh install of OS X El Capitan 10.11.6 and have a go with your solution since, from what I read on all threads I have included above, I am convinced that your's is the most neat and effective one. But, I haven't tried your solution yet as I wanted to ask you the following questions:

1. After the last (i.e. second) clean/fresh install of OS X El Capitan and all relevant App store updates I did, I can see in my system report that my MBP boot ROM version is: MBP81.0047.B27 and the SMC Version (system) is 1.69f3. However, given the characteristic of my macbook and this apple support article my Boot Rom version should be MBP81.0047.2AB. If you open the url links, this Mac EFI Security Update 2015-001 updating to MBP81.0047.2AB, it "improves security of Mac systems by addressing an issue where EFI could potentially be overwritten without authorisation" (Description1), as well as, solving "an insufficient locking issue existed with EFI flash when resuming from sleep states. This issue was addressed through improved locking"(Description2; I have copied/pasted/bold/italics the named as Descriptions 1/2 from the relevant urls). On that account, my first question has two fronts:

i) If I redo a (third) clean/fresh install of OS X EL Capitan and all relevant App store updates, and after that, I update my MBP boot Rom version to MBP81.0047.2AB following the apple support link I included earlier, will your EFI hack work given Description1 of the security update I have copy/pasted from the relevant apple support page, i.e. not allowing an EFI overwrite without authorisation?

ii) In case your EFI hack will work regardless of this new security update, will the kext you have created so as to prevent "GPU from waking up from sleep", work given Description2 of the security update I have copy/pasted from the relevant apple support page, i.e. insufficient locking issue existed with EFI flash when resuming from sleep states?

2. A general question:
Can I prepare the flash drive RESCUE on a different mac laptop, or, should I prepare this on my macbook after I have followed steps 1 and 2 of your instructions?

3. A question regarding a detail which is unclear to me on step 6 of your solution:
In any new macOS update, macbook laptops automatically reboot. On that account, should I let my macbook reboot normally, then shut it down, and follow step 3.5 and then step 6 of your solution, or, should I allow the installation of the new macOS update with the RESCUE flash drive in, and then, when it automatically reboots follow step 3.5 of your instructions and then move on to step 6?

4. How can somebody know whether the partition label is "Mac" or "MacOS" as @RoboticEarthling has commented here earlier in his November 2 post?

5. In the system report of my MBP and under the main bootable partition (which I have named as Macintosh_SSD when erasing/verifying disk during the second OS X El Capitan installation I did) I can see different types of UUID, i.e. Volume UUID, LV UUID, LVG UUID. To which one are you referring in step 3.5 of your instructions? I imagine that the recovery partition (named in my system report as Physical volume disk0s2, which also has a UUID named as PV UUID) does't count as a multiple entry, right? Thus, I only need to follow the first two lines of your 3.5 instruction step, and not need to worry about the things I am asking in this no.5 question of mine. Please correct me if I am wrong.

Many many thanks for you reply in advance.
Best,
transmogrify

PS. I have a concert next week and doing some heavy work in MaxMSP; I am in total panic whether things will work.
Apple should be ashamed for this 2011/2012 MBP issue, when we as customers have paid approx. $Β£2000-2500, and have treated with respect and care our machines. I fear that more issues like this is something that we should be expecting in this post-capitalist society of ours. Sorry for the political rant.

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Dec 6, 2017

@transmogrify

  1. That fix prevents the overwriting of the EFI ROM, and you're not overwriting your EFI ROM with this, not even touching it.
  2. Yes, you can.
  3. You should let it update. If after updating you can't boot macOS, you should boot with the rescue thumb drive and follow the step 6 only.
  4. If you only have one macOS installation, you don't need to worry about that, the guide was updated since then to find automatically the first macOS partition. If you have multiple macOS installations, when finding the UUIDs, the labels should be the same that appear on finder or disk utility. (Note that the partition label has nothing to do with the menuentry label)
  5. Don't use those UUIDs, they are different from what GRUB expects. Just follow the guide.
@mayankk2308

This comment has been minimized.

Copy link

commented Dec 7, 2017

@blackgate: Can the aforementioned GRUB workaround be employed to prevent detection of NVIDIA discrete graphics cards as well? I want to accomplish the equivalent of disabling the AMD GPU. I want it so that the kernel does not detect the card at all, uses the iGPU instead, and does not load ANY of the NVIDIA kexts.

@transmogrify

This comment has been minimized.

Copy link

commented Dec 7, 2017

Hey @blackgate,
Thanks for your reply!
I just tried it and it works like a charm.

Just for a heads up, I had to follow steps 1 and 2 of your instructions with the (already prepared) RESCUE drive in, and on the rebooting of step 2 to call Grub (step 3.5) and enter "macOS". Whenever I rebooted the system after step 2, and re-rebooted with the RESCUE drive so as to proceed to step 3.5, I always got what @herivorenz is writing approx. 17 posts above.

Also, I wish I wouldn't have to press enter in the "blessed" Grub console every time I reboot however.
Although this is a tiny thing given that the hack works, is there a way to overcome that?

Finally, I imagine that I shouldn't go back into single user recovery mode (cmd + r + s) and enable SIP since the "blessed" Grub won't work, right?

Cheers,
transmogrify

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Dec 8, 2017

@mayankk2308 Yes. If you have a non retina MBP, this should also work for NVIDIA gpus. If on other hand you have a retina MBP, the macrumors user nate922 has found a solution for that too.

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Dec 8, 2017

@transmogrify
If you correctly configured your thumb drive and followed the steps 1 and 2, and it still wont boot, then I don't know if can I help you... It can be another problem.

If you don't press enter, it will boot automatically after 10 seconds. You can set a shorter delay by changing it in the set timeout=10 line in your menu entry.

You can enable SIP, but when updating you need to disable it to bless GRUB again on step 6. Also, if you are using the kext, you need to at least have sip disabled for kexts: csrutil enable --without kext

@m1ndwalker

This comment has been minimized.

Copy link

commented Dec 20, 2017

Hi Blackgate!

Thanks for the marvellous work!

I just tried your fix with Sierra (not High Sierra) since I believed this is the last MacOS where the fix works properly. I've followed the guide and everything worked fine. However, when I close the laptop's lid (or use the Sleep option on the Mac's own Apple icon Menu Entry), the screen goes dead but the fans are still on and the pulsing LED isn't pulsating, but rather it is constantly on (white). If I then open the lid, the laptop seems to enter sleep for a second (fans go out and the pulsing light comes up) but then it just wakes up.

I'm running on MacbookPro 8.2 from Late 2011.

Is this the expected behaviour ?

Thanks for taking the time to reply!

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Dec 22, 2017

@m1ndwalker No, it's not the expected behaviour. I have an early 2011 MBP and everything works fine. It should work with or without the AMDGPUWakeHandler kext, but I recommend using the kext if you aren't using.

@m-a-v

This comment has been minimized.

Copy link

commented Dec 24, 2017

@m1ndwalker: As a possbile workaround, have a look at hibernatemode above. If you have a SSD it works quite fast.

@stephendt

This comment has been minimized.

Copy link

commented Dec 31, 2017

Unfortunately this method did not work for me. I was originally able to boot via USB, and once I executed Step 4, my Mac was no longer bootable and instead bootloops after the grub loading screen. Disappointing :( MacOS Sierra, was using the EFI fix but it was failing to boot every time I reboot and I had to run the EFI variables again. Had High Sierra and downgraded when things didn't work.

Edit: Update - I decided to reset NVRAM and run through this process again and to my surprise, it works OK now. The only difference is that at the end I decided to reboot instead of shutting down - not sure if that makes a difference or not.

@Javoy

This comment has been minimized.

Copy link

commented Jan 5, 2018

@blackgate, thanks a lot for this fix... Gave my 2011 mbp new life! I have it running with El Capitan and so far so good...

@bobharris

This comment has been minimized.

Copy link

commented Jan 5, 2018

Dead late 2011 17" Macbook Pro.
Wouldn't boot. Sometimes the screen was funked up during boot.

Did this exact guide on High Sierra to get back up and running. Then I downgraded to Sierra for the sleep and brightness.
Working fantastic so far.

I had tried a heatgun on the GPU previously and it only lasted maybe.....2 weeks.
Thanks so much! I was really bummed about my 2000$ paper weight. Should have gotten a new logic board from apple when I could. Or maybe I shouldn't have......

Update: 4_10_2018.

Still working great apart from a scare. Restarted macbook and no screen. Nothing. SRAM resetting didn't work. Uplugging battery didn't work. What did work was letting battery drain to 0 overnight. Plugging in power brick again and back to normal. Odd.

I'm gonna install the AMD Sleep Kext and sleep alot to try keep this baby alive.

@blackgate

This comment has been minimized.

Copy link
Owner Author

commented Jan 6, 2018

@Javoy and @bobharris You're welcome.
@stephendt I don't think it makes any difference. There are many steps and It's very easy to make a mistake.

@csirlmoore

This comment has been minimized.

Copy link

commented Jan 7, 2018

@blackgate Thank you sooo much for this solution! You have saved my $4k MBP (early 2011 17" running 10.10.5, in case that's useful).

@bobharris Sadly you might have ended up here anyway - Apple replaced my logic board in early 2016 and it failed again recently, this time they refused to help :(

@JfLat

This comment has been minimized.

Copy link

commented Jan 12, 2018

Thankful, thankful, thankful - am I for your talents, blackgate!!! Looks like the "you" part of "us" got my ole "vintage" pal up and booting consistently once again. One of the many having already been thru Apple's board replacement - in 2015. Same model and boot version as yours with SSD upgrade, 16GB. Likely the best anti-glare screen in Apple history?
It is likely something I have screwed up in syntax over multiple learning attempts, but she hangs up on restart and shut down, with the cursor still active. Goes to sleep and awakens every which way consistently. Any further healing thoughts/prayers/blessings much appreciated! Otherwise, I guess I could start over with a clean copy of Sierra? Thanks again. ~jf

@spinko101

This comment has been minimized.

Copy link

commented Jan 29, 2018

Thank you very much. So far it is working on my late 2011 Macbook Pro :-).

@ELaplume

This comment has been minimized.

Copy link

commented Feb 8, 2018

Hi and thanks a lot,

Works for me on a MacBook Pro i7 2.2 15" early 2011 with Mavericks 10.9.5 .

After step 4, it just try to boot with grub, so just a NVRAM reset make it works.

Thanks again

@ruben78236

This comment has been minimized.

Copy link

commented Feb 11, 2018

First of all, great work on all the hacks to make it possible to still use my MacBook.
Tried the other method and had some problems with brightness and sleep. Someone referred me to this solution.

I'm not really a coder, more of a trial-and-error-guy... so excuse me for any stupid questions.

I got quite far, my MacBook booted after the PRAM en SMC reset and the coding with alt+S+R.

created the RESCUE USB > booted the usb> press enter because had only one entry. then I got an error, unfortunately I don't have an image, also can't find it on the internet. It was a strange image with some logo put in front of the apple logo.

Is my text file correct? I'm using High Sierra on APFS

screen shot 2018-02-11 at 12 11 48

Or should I change it to this that someone else posted?

Hi @blackgate. I use high sierra, so I use the modified grub. This is my grub:

menuentry "macOS_High_Sierra" {
outb 0x728 1
outb 0x710 2
outb 0x740 2
outb 0x750 0
exit
}

If I reboot I have a black screen and a grub prompt. I type exit and Mac boots. Btw it's nearly 6 days without reboots. Your medicine works :-)

Thanks for the help!

@andrewstaker

This comment has been minimized.

Copy link

commented Feb 25, 2018

This worked like a charm on my 15" early 2011 MacBook Pro running El Capitan 10.11.6 πŸŽ‰

The only thing that tripped me up was doing the steps in order. Restarting my machine after creating the recovery USB seemed to revert the changes made in step 2 and I got the black screen like @herivorenz described. I repeated step 2 and continued from step 3.5 and all worked well.

Thanks a bunch @blackgate !

@tcapelle

This comment has been minimized.

Copy link

commented Mar 14, 2018

Thank you!
I have FileVault enabled over my boot drive, I am not able to boot in single user - recovery mode.
I did all the steps on single user mode (command+s) and it worked, but now my computer is powering off randomly.
Do you think it is related?
When booting I see grub and then it boots MacOS normally.
Also, I am unable to compile the wakeup handler in Yosemite with Xcode 6.3.1 (incompatible version)
Thanks!

@rickygm

This comment has been minimized.

Copy link

commented Mar 30, 2018

Hi, I worked well on the procedure in a macbook pro 15 early 2011, the two problems it presents, if restart is hung and if I turn off is the same, I have to turn off directly with the power button, any idea that can be?

but the procedure works perfect thank blackgate.

@digitarenet

This comment has been minimized.

Copy link

commented Mar 30, 2018

Perfect until today...
After updated to macOS 10.13.4 my 2011 MacBookPro doesn't boot anyway... also with usb with grub on it (previous macOS update work fine after re-copy file like https://gist.github.com/blackgate/17ac402e35d2f7e0f1c9708db3dc7a44#6-recover-when-macos-updates)...

Have you tried with last macOS update?
Thanks

@davidwerks

This comment has been minimized.

Copy link

commented Apr 1, 2018

@digitarenet Thanks for the information. I was about to install the update. I turned off the update notification for MacOS update immediately.

I could find people facing issues with 10.13.4 on twitter though I do not know which Macbook pro those users use.

@digitarenet

This comment has been minimized.

Copy link

commented Apr 10, 2018

ok, now all works fine also in macOS 10.13.4... I need to reinstall macOS from USB.

now, work again >:)
Thanks

@davidwerks

This comment has been minimized.

Copy link

commented Apr 19, 2018

@digitarenet

Thank you!

@montajd

This comment has been minimized.

Copy link

commented Jun 11, 2018

I noticed it was taking a very long time before the grub menu showed even though I only have one macOS partition,, and also noticed that there was no EFI Boot option in the Mac startup boot menu. So I mounted the EFI partition, created a new folder named BOOT, and put it in the efi folder of the efi partition. Then I copied the BOOTX64.EFI and grubx64.efi files into the BOOT folder. After rebooting, the EFI Boot entry showed, successfully booted into grub and so forth, and then from that point on, reboot and normal boot startup times are as fast as they should be. Hope this helps others!

@nsgrbr

This comment has been minimized.

Copy link

commented Jun 28, 2018

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.

grub-amd-macbookpro_2011-highsierra-10 13 5-brightness-slider

@leeuk321

This comment has been minimized.

Copy link

commented Jul 4, 2018

Hi, thanks for this guide, it got my 2011 MBP going again - much appreciated! Just curious, how usable should a MBP be after this? I figured that intensive graphics tasks might just be a little slower, but the whole system feels quite laggy, and Adobe Bridge just crashed after trying to open it. I'm not planning on using the MBP for video editing or anything, but I thought that everyday graphics stuff like browsing through images etc would be fine. Is it possible that I only partly succeeded in doing this method, and although the GPU is turned off my Mac is still trying to assign tasks to it? I've just tried to open an image in Photoshop and it's been beachballing for five minutes. And yet, I just went on safari and scrolled through a bunch of gifs fine, so it seems as if the lag is just application-dependant, as if some programs or processes are needing - or are still looking for - that other GPU. I'm using High Sierra 10.13.4, if that makes a difference? I heard some people say there are issue with High Sierra such as sleep/brightness, but no-one has really commented one way or another on how well a MBP is supposed to run after disabling the AMD GPU, with any OS.

Any help would be greatly appreciated!

Thanks.

@hiwixl

This comment has been minimized.

Copy link

commented Jul 12, 2018

Thanks for your work. Until today it worked wonderful. But now on Sierra 10.12.6 after Security Update 2018-004 I get a kernal panic. I can start only in single user mode, nvram command and reboot. Nothing automatic anymore.

@BeFiveINFO

This comment has been minimized.

Copy link

commented Jul 12, 2018

@leeuk321

I think that apps using GPU should work if you have applied the GRUB solution successfully.

screen shot 2018-07-13 at 0 27 06

What does your "About this Mac" dialog shows? If the Graphics ... shows Radeon, you have not applied the full solution yet.

@davidwerks

This comment has been minimized.

Copy link

commented Jul 13, 2018

Just in case anyone leaving computer screen on all the time even though they want to turn off the screen when they are not using the Mac. Display sleep still works without problems. Settings can be found in the "Energy Saver" preference pane.

I regularly use Screen Saver's "Hot Corners" option to turn off the screen at any moment. Moving mouse turns the screen back on.

screen shot 2018-07-14 at 0 30 57
screen shot 2018-07-14 at 0 30 26

@Swordz1222

This comment has been minimized.

Copy link

commented Jul 15, 2018

Is this going to work if you don't have macOS installed? Due to some reason my, MacOs was wiped out. I don't have MacOs anymore, I can't even restore it from internet (command+option+r) because it freezes stuck in white screen. Luckily I have a BOOTCAMP partition and I only have Windows in my MBP early 2011. Will this procedure still work for me? Problem is, Intel HD Graphics does not show as display adapter. I have disabled AMD Radeon HD 6750m in my device manager to let me use Windows in default graphics...

@ajkessel

This comment has been minimized.

Copy link

commented Jul 15, 2018

I've gotten some variation of these instructions to work on High Sierra 10.13.16 and my previously unusable 2011 MBP now fully boots and runs without crashing. The display rendering is, however, glitchy -- if I drag a window in front of another one, sometimes the pixels don't catch up right away so the screen appears distorted although eventually it usually refreshes. Is there some OS software setting that makes it work better with the GPU disabled? Has anyone else seen this behavior -- where they've successfully disabled the broken GPU and thus made the machine usable, but there are minor annoying display distortion issues?

@kevinlul

This comment has been minimized.

Copy link

commented Jul 17, 2018

@nsgrbr Any other information about the brightness issue on High Sierra?

@leeuk321

This comment has been minimized.

Copy link

commented Jul 17, 2018

@BeFiveINFO

Thanks for your reply. I've now reverted back to Sierra, after reading about the numerous glitches that High Sierra has. I'm sure that I had followed all the steps to the letter, and the graphics did show the Intel HD graphics in the system info, but I'm on Sierra now so I can't do any further troubleshooting. I read a couple of comments from people saying that it wasn't worth the update, and that sounded about right. Back on Sierra everything is working absolutely perfectly again, I don't do any graphics-intense work and honestly can't tell a single bit of difference to how it operated before the GPU croaked.

@hiwixl

Sorry to hear about the Sierra 2018-004 security update preventing the automatic process. It'd be great if there was some sort of updated log where users logged different security updates and solutions (if found). I'm holding back doing any updates for the time being, and am going to do a time machine backup right before any update (or any other significant change).

I'd just update the damn thing to a later MBP if they hadn't have done away with the anti-glare screen, which I'd find it hard to live without (I know there's antiglare covers, but they just don't seem the same). So, fingers crossed!

@a-eid

This comment has been minimized.

Copy link

commented Jul 25, 2018

do I need to replace the whole grub.cfg content??

@a-eid

This comment has been minimized.

Copy link

commented Jul 25, 2018

How do I make sure it's working correctly?
I'm using high sierra and the brightness is working fine.

@BeFiveINFO

This comment has been minimized.

Copy link

commented Jul 30, 2018

@a-eid

Are you sure? I am curious how you could get it working. Please see my comment to see if you have successfully disabled your dGPU.

@leeuk321

I do not think that there are any significantly compelling advantages of using High Sierra, either. But, in my case, I have a problem with my Apple BlueTooth keyboard with 10.12. It causes frequent chattering when I enable iCloud on 10.12, which makes my MacBook Pro utterly unusable. So I have to stick with 10.13.

@nsgrbr

This comment has been minimized.

Copy link

commented Aug 9, 2018

High Sierra 10.13.6 - Macbook Pro 15" Early 2011

@cumandr
No progress.

@leeuk321

Take a test by disabling AppleMuxControl - boot message: AGC:: force unloaded

Remembering that it is mandatory:
nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00

and GRUB to disable the AppleMuxControl (AGC).

Boot Recovery Mode (Command + R at boot) -> Utilities menu -> Terminal:

nvram boot-args="-v agc=-1"

AGC = Apple Graphics Control -> Plugins -> AppleMuxControl.

Putting a negative value in the agc, then the AppleMuxControl will not be loaded.

AppleMuxControl makes the switch between the Intel GPU and the AMD GPU.

Checking the "AGC" after normal boot (Sierra and High Sierra)-> Finder -> Applications -> Utilities -> Terminal:

log show --last 1h | grep -i AGC

2018-08-09 15:28:14.xxxxxx Default 0x0 0 0 kernel: (AppleMuxControl) AGC:: force unloaded
2018-08-09 16:12:26.xxxxxx Default 0x0 0 0 kernel: (AppleMuxControl) AGC:: force unloaded

El Capitan:
sudo syslog | grep -i AGC

or

sudo dmesg | grep -i AGC

If you do not use Grub Solution -> only boot-args="-v agc=-1" , then after manually loading "AMDRadeonX3000.kext" -> the AMD GPU temperature will not decrease. The AMD GPU will continue with Power On -> raising the system temperature and consuming more battery -> MikeyN Guide.

@nsgrbr

This comment has been minimized.

Copy link

commented Aug 11, 2018

@blackgate
@leeuk321

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.

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
  • 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:
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 .

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:
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:

csrutil enable --without kext
reboot

Boot-args only with verbose:
nvram boot-args="-v"

or

sudo nvram boot-args="-v"

2 - Manual loading of AMDGPUWakeHandler.kext (modified) with kexutil - after boot normal -> login -> Finder -> Applications -> Utilities -> Terminal:

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:

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:

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:

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:

+-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:
File System: APFS (Encrypted)

Explanation about Brightness Control in High Sierra (10:13) with the Macbook Pro 2011:
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.

Update 2:
You must have in your grub.cfg two options to Power Off the AMD GPU or leave the AMD GPU Power on at boot - 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
}

@kptin

This comment has been minimized.

Copy link

commented Aug 18, 2018

Hi. My 17 inch 2.4 i7 late 2011 gpu failed yesterday. I'm sure it has the last OS high Sierra updates. I'm lost in a all the procedures all of you have shared. Can anyone suggest me any step by step instructions for doing this? I'm very good following detailed instructions but no guessing what and expert should now. Please help

@kevinlul

This comment has been minimized.

Copy link

commented Aug 19, 2018

@nsgrbr

Firstly, thank you so much for your dedication to this. I'm not very well versed on the hardware side, so I don't know how to necessarily do these things, but I can certainly follow and kind of understand. I followed your most recent process and I can confirm your results. However, the computer temperature has risen considerably, likely due to the GPU remaining on and the X3000 kext missing?

Tests with sleep:
With hibernatemode 25, on wake from sleep, it kernel panics and restarts after a grey screen.
With hibernatemode 3, on wake from sleep, it also kernel panics and restarts after a grey screen.
With hibernatemode 0, on wake from sleep, it works as usual. Of course, this isn't any kind of hybrid sleep, so nothing is probably being powered off in this case.

Tests with moving the custom extension into /System/Library/Extensions and then touch (oops):
Crash after the verbose screen finishes. Expected.

Tests with moving the extension into /Library/Extensions and then touch:
Crash due to kernel panic. Expected, since loading the extension on boot would panic without the GRUB solution in place.

Question: Do you know what the nvram boot arg "agc" does? I've seen options for 0, 3, and now you've also suggested -1 in one instance in this thread. What does it do? Is this all figured out by experimentation?

EDIT:
I should point out that, even without loading the modded kext post-login, brightness control still works. So have we achieved anything here? The discrete GPU is locked to the brightness control kexts?

@nsgrbr

This comment has been minimized.

Copy link

commented Aug 19, 2018

Macbook Pro 15" Early 2011 - High Sierra 10.13.6

@cumandr
Remember that the modified AMDGPUWakeHandler.kext has to work with GRUB disabled at boot time.

I tested today various ways of interacting with AMDRadeonX3000.kext inside /System/Library/Extensions with the modified AMDGPUWakeHandler.kext and all gave kernel panic.

There is no way for High Sierra to work with AMDRadeonX3000.kext along with AMDGPUWakeHandler.kext.

The modified AMDGPUWakeHandler.kext must be outside of /System/Library/Extensions and outside of /Library/Extensions. Otherwise you will have kernel panic.

In my tests I put the modified AMDGPUWakeHandler.kext in the /Users/Shared/ directory.

Your Edit: Yes, in High Sierra the brightness control is locked to the AMD GPU. If you do not load the AMD6000Controller.kext, AMDLegacyFrameBuffer.kext and AMDLegacySupport.kext at boot time, then there is no brightness control.

Your Question: Yes, it's all by experiment. So far I have not seen anyone explain exactly what "agc" is in boot-args.

This started by seeing a post in the Apple forum where a user wrote that his Macbook Pro 2011 with the defective AMD chip, came back from the technical assistance with the following boot-args:

boot-args="-v debug=0xd46 _panicd_ip=1.2.3.4 kdp_match_name=firewire agc=3"

https://discussions.apple.com/thread/7295722

If you put agc=0 or agc=9 or agc=10 or any value above 9, then you can Power Off AMD GPU with AMDRadeonX3000.kext loaded manually or by LoginHook after the graphical login.

If you put agc=1 or agc=2 or agc=3 or any value below 9, then you can not Power Off AMD GPU with the AMDRadeonX3000.kext loaded manually or by LoginHook after the graphical login.

But here comes Apple screw us. When launching Sierra (10.12.0), if you put agc=0 in boot-args, then there was no gray screen even with AMDRadeonX3000.kext inside /System/Library/Extensions with defective chip AMD GPU.

After Apple changed the value of the variable EFI FirmwareFeaturesMask (i guess) and put a barrier in the AppleMuxControl.kext that says:

AGC: boot to IG, policy disable! After that agc=0 did not work anymore. The same was done with El Capitan.

IG = Integrated Graphics = Intel GPU

4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:FirmwareFeaturesMask

I tried to modify the value of EFI FirmwareFeaturesMask with the nvram command but after reboot, the value goes back to the original Apple default.

If the AMD GPU temperature is not decreasing, then your AMDGPUWakeHandler.kext is not turning it off.

You have to take the test:

sudo log show --last 1h --predicate 'senderImagePath contains "AMDGPUWakeHandler"'
Password:
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-18 19:40:27.525123-0300 0x986      Default     0x0                  0      0    kernel: (AMDGPUWakeHandler) Initializing
2018-08-18 19:40:27.525135-0300 0x986      Default     0x0                  0      0    kernel: (AMDGPUWakeHandler) Probing
2018-08-18 19:40:27.525149-0300 0x986      Default     0x0                  0      0    kernel: (AMDGPUWakeHandler) Starting
2018-08-18 19:40:27.525264-0300 0x198      Default     0x0                  0      0    kernel: (AMDGPUWakeHandler) Waking up
2018-08-18 19:40:27.525267-0300 0x198      Default     0x0                  0      0    kernel: (AMDGPUWakeHandler) Disabling GPU
 --------------------------------------------------------------------------------------------------------------------
Log      - Default:          5, Info:                0, Debug:             0, Error:          0, Fault:          0
Activity - Create:           0, Transition:          0, Actions:           0

The "log show" has to show the "Disabling GPU".

I recorded the screen on how to compile the modified AMDGPUWakeHandler.kext. I have to edit the video because it was like the size of 490MB.

Each time you take or put a kext inside /System/Library/Extensions or / Library/Extensions, then you have to do touch on /System/Library/Extensions or touch on /Library/Extensions to rebuild the kext cache.

After testing the manually loaded AMDGPUWakeHandler.kext, you can then automate the process by placing it in the LoginHook.

1 - Create AMDGPUWakeHandler.sh file with nano editor:
keys inside nano - CTRL + W: write file / CTRL + X: exit nano editor.

sudo nano /Library/LoginHook/AMDGPUWakeHandler.sh

2 - Copy and paste this content inside. In this example AMDGPUWakeHandler.kext is inside /User/Shared/ directory.

#!/bin/bash
kextload /Users/Shared/AMDGPUWakeHandler.kext
exit 0

3 - Make AMDGPUWakeHandler.sh with executable attribute.
sudo chmod a+x /Library/LoginHook/AMDGPUWakeHandler.sh

4 - Enable LoginHook:
sudo defaults write com.apple.loginwindow LoginHook /Library/LoginHook/AMDGPUWakeHandler.sh

To disable LoginHook:
sudo defaults delete com.apple.loginwindow LoginHook

https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CustomLogin.html

@nsgrbr

This comment has been minimized.

Copy link

commented Aug 19, 2018

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 inside 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".

@kevinlul

This comment has been minimized.

Copy link

commented Aug 19, 2018

So. Boot as usual, but with nvram setting to Intel GPU and boot mode verbose. Do not set agc to anything. Load the modified WakeHandler kext as part of the login hook.

@nsgrbr

This comment has been minimized.

Copy link

commented Aug 19, 2018

@cumandr

Yes, only:
nvram gpu-power-prefs to Intel GPU and boot-args="-v".

@kptin

This comment has been minimized.

Copy link

commented Aug 20, 2018

It is possible to revive a macbook pro with a new GPU
I was totally skeptical about the fact that it was even possible, but then I followed the link to Ebay and found so many happy users with their resurrected macbook and with all its original power, it has given me hope. I live too far: In Colombia, South America. That implies that it will be more complicated and costly for me to access that repair service. What do you think about this service?
https://becomethesolution.com/blogs/mac/disable-macbook-pro-2011-discrete-gpu-faulty-mac-os-high-sierra-10-13

@nsgrbr

This comment has been minimized.

Copy link

commented Aug 21, 2018

@cumandr

If you have the Kernel Panic coming back from Hibernate, then you have to test pmset -a gpuswitch 0 or 1 or 2.

sudo pmset -a force gpuswitch 0
sudo pmset -a force gpuswitch 1
sudo pmset -a force gpuswitch 2

gpuswitch 0 - Integrated GPU or Discrete GPU

gpuswitch 1 - Integrated GPU or Discrete GPU

gpuswitch 2 - Dynamic Mode

Information not documented by Apple. Some say gpuswitch 0 is Integrated GPU or Discrete GPU and vice versa.

You must also test System Preferences -> Energy Saver -> Automatic Graphics Switching enabled or disabled.

I also use Steve Schow's gfxcardstatus version 2.4.3i.
https://github.com/steveschow/gfxCardStatus/releases

https://github.com/steveschow/gfxCardStatus/releases/tag/v2.4.3i

With AGDCDiagnose -a, plus nvram gpu-power-prefs for Intel GPU, then enabling or disabling Automatic Graphics Switching, the value switches in AGDCDiagnose -a.

System Preferences -> Energy Saver -> Automatic Graphics Switching enable: System is in Dynamic mode: Better Battery Mode set, using Integrated

System Preferences -> Energy Saver -> Automatic Graphics Switching disable: System is in Dynamic mode: Better Performance Mode set, using Integrated

/System/Library/Extensions/AppleGraphicsControl.kext/Contents/MacOS/AGDCDiagnose -a


gpuswitch sets GPU behaviour during sleep, and appears to be undocumented;

https://eclecticlight.co/2017/01/20/power-management-in-detail-using-pmset/


https://www.reddit.com/r/applehelp/comments/3wurf2/using_gpuswitch_in_pmset_to_disable_automatic/

http://www.3u.com/news/articles/1866/how-to-switch-graphics-card-on-macbook-with-one-step

https://github.com/opensource-apple/IOKitUser/blob/master/pwr_mgt.subproj/IOPMEnergyPrefs.c

http://i-tweak.blogspot.com/2015/09/control-your-osx-powerperformance-with.html

@BeFiveINFO

This comment has been minimized.

Copy link

commented Aug 28, 2018

@kptin
I have tried a similar repair service in Japan, which costed me about 30,000 JPY (approx. 270 USD). It did solve the problem till the GPU broke again only in a year. Apple's official repair which is not available any longer also lasted only about a year. Your mileage will vary. It seems to me that 2011's GPU is destined to break sooner or later any way no matter what is done.

@kevinlul

This comment has been minimized.

Copy link

commented Aug 30, 2018

@nsgrbr

hibernatemode 25
sudo pmset -a gpuswitch 0 kernel panic on wake
sudo pmset -a gpuswitch 1 kernel panic on wake
sudo pmset -a gpuswitch 2 kernel panic on wake

hibernatemode 3, gpuswitch 2, kernel panic on wake
hibernatemode 0, gpuswitch 2, kernel panic on wake

*** Panic Report ***
panic(cpu 0 caller 0xffffff7fa468aa0f): "GPU Panic: mux-regs 2 0 1 0 0 0 severity 3 WS-ready 1 switch-state 0 IG FBs 1 EG FBs 0:0 power-state 0 3D idle HDA idle : UH	eHοΏ½lPH
E0L	H(L	@ H	HοΏ½HοΏ½
OοΏ½: GPU is not found. PCI config access fails!!!
\n"@/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleGraphicsControl/AppleGraphicsControl-3.18.52/src/AppleMuxControl/kext/GPUPanic.cpp:162
Backtrace (CPU 0), Frame : Return Address

hex addresses and then a list of kexts, seems normal

I'll keep doing more thorough testing.

@nsgrbr

This comment has been minimized.

Copy link

commented Aug 30, 2018

@cumandr

mux-regs refers to AppleMuxControl.kext or Mux chip (bad solder joints).

Run agc=-1 on boot-args. With a negative value in agc, then AppleMuxControl.kext is not loaded.
You will lose control of brightness but you will know if AppleMuxControl.kext is responsible for the Kernel Panic.

This your error message also appears on various forums with Macbook Pro 2012 Nvidia GPU.

The nvram agc in boot-args has to be done Recovery Mode because the SIP prevents this type of operation in Single User Mode or normal boot.

Boot Recovery Mode (Command + R at boot) -> Terminal:

nvram boot-args="-v agc=-1"

The -v is for verbose boot (optional).

https://www.rossmanngroup.com/boards/forum/board-repair-troubleshooting/21229-solved-gpu-panic-mux-regs

https://discussions.apple.com/thread/8440936

https://www.ifixit.com/Answers/View/498976/Random+Kernel+Panics+related+to+GPU

@kevinlul

This comment has been minimized.

Copy link

commented Aug 30, 2018

@nsgrbr

With that boot option, hibernatemode 0, I see the login screen for a brief moment before a black bar shows up across it and the system reboots twice, showing kernel panic the second time. The message:

panic(cpu 2 caller 0xffffff7fb270ac3a): "%s: GPU is not found. PCI config access fails!!!
"@/BuildRoot/Library/Caches/com.apple.xbs/Sources/GPUDriversAMD/GPUDriversAMD-1.66.42/Common/IONDRV/ATI/IOFramebuffer/ATIFramebuffer_Legacy/Abstraction/Sources/ATIController.cpp:1814

Maybe I should start from zero with the configuring?

@nsgrbr

This comment has been minimized.

Copy link

commented Aug 31, 2018

@cumandr
You say start from zero on agc?

nvram boot-args="-v agc=0"

I think agc=0 means Legacy. But it's just a guess.

enum {
    kIOFBNotifyGroupIndex_Legacy                        = 0,
    kIOFBNotifyGroupIndex_IODisplay                     = 1,
    kIOFBNotifyGroupIndex_AppleGraphicsControl          = 2,
    kIOFBNotifyGroupIndex_AppleGraphicsPowerManagement  = 3,
    kIOFBNotifyGroupIndex_AppleHDAController            = 4,
    kIOFBNotifyGroupIndex_AppleIOAccelDisplayPipe       = 5,
    kIOFBNotifyGroupIndex_AppleMCCSControl              = 6,
    kIOFBNotifyGroupIndex_VendorIntel                   = 7,
    kIOFBNotifyGroupIndex_VendorNVIDIA                  = 8,
    kIOFBNotifyGroupIndex_VendorAMD                     = 9,
    kIOFBNotifyGroupIndex_ThirdParty                    = 10,
    // Must be last
    kIOFBNotifyGroupIndex_LastIndex                     = kIOFBNotifyGroupIndex_ThirdParty,
    kIOFBNotifyGroupIndex_NumberOfGroups                = (kIOFBNotifyGroupIndex_LastIndex + 1)
};

https://opensource.apple.com/source/IOGraphics/IOGraphics-517.22/IOGraphicsFamily/IOFramebuffer.cpp.auto.html

or

nvram boot-args="-v agc=0x001"

enum {
    // 0x0 - 0xFF - Private: Reserved for IOGraphics.
    kIOFBNotifyGroupID_Legacy                         = 0x001,
    kIOFBNotifyGroupID_IODisplay                      = 0x010,

    // 0x100 - 0x1FF - Reserved for Apple kernel extensions
    kIOFBNotifyGroupID_AppleGraphicsDevicePolicy      = 0x100,
    kIOFBNotifyGroupID_AppleGraphicsMGPUPowerControl  = 0x110,
    kIOFBNotifyGroupID_AppleGraphicsMUXControl        = 0x120,
    kIOFBNotifyGroupID_AppleGraphicsControl           = 0x130,
    kIOFBNotifyGroupID_AppleGraphicsDisplayPolicy     = 0x140,
    kIOFBNotifyGroupID_AppleGraphicsPowerManagement   = 0x150,
    kIOFBNotifyGroupID_AppleHDAController             = 0x160,
    kIOFBNotifyGroupID_AppleIOAccelDisplayPipe        = 0x170,
    kIOFBNotifyGroupID_AppleMCCSControl               = 0x180,

    // 0x200 - 0x2FF - Reserved for vendor kernel extensions
    kIOFBNotifyGroupID_VendorIntel                    = 0x200,

    // 0x300 - 0x3FF - Reserved for vendor kernel extensions
    kIOFBNotifyGroupID_VendorNVIDIA                   = 0x300,

    // 0x400 - 0x4FF - Reserved for vendor kernel extensions
    kIOFBNotifyGroupID_VendorAMD                      = 0x400,

    // 0x500 - 0x7FFF - Reserved for future use

    // 0x8000+ - Reserved for third party software
    kIOFBNotifyGroupID_ThirdParty                     = 0x8000,

    kIOFBNotifyGroupID_Count                          = 15
};

https://opensource.apple.com/source/IOGraphics/IOGraphics-517.22/IOGraphicsFamily/IOKit/graphics/IOFramebuffer.h.auto.html

@nsgrbr

This comment has been minimized.

Copy link

commented Aug 31, 2018

@cumandr

Have you tried the MikeN Guide that does not use GRUB or AMDGPUWakeHandler.kext?

https://forums.macrumors.com/threads/force-2011-macbook-pro-8-2-with-failed-amd-gpu-to-always-use-intel-integrated-gpu-efi-variable-fix.2037591/page-35#post-24956091

Note:
I have noticed that in the last updates of El Capitan and High Sierra the Recovery Mode Single User is no longer working - Command + R + S keys at boot - Recovery Mode Text.

Only Command + R keys at boot works - Recovery Mode Graphical.

@kevinlul

This comment has been minimized.

Copy link

commented Sep 1, 2018

Hmm, I am still able to enter single user recovery. I meant that I'll start the "repair process" from zero. Remove the LoginHook, put the kexts back, reset what pmset that I can, and go from there. I am not booting from GRUB. I will try that solution and see what happens.

Pretty much, I just want to try for full functionality. I know that I can have it safely working without brightness or sleep capabilities on High Sierra, but I would certainly like those features to still work.

@nsgrbr

This comment has been minimized.

Copy link

commented Sep 1, 2018

@cumandr

In my tests I leave only these AMD kexts for loading at boot time:
/System/Library/Extensions
AMD6000Controller.kext
AMDLegacyFramebuffer.kext
AMDLegacySupport.kext

/DisableExtensions or /System/Library/Extensions-off
AMDRadeonX3000.kext -> LoginHook
Others AMD/ATI kexts -> AMD7000Controller.kext, AMDSupport.kext, AMDFrameBuffer.kext, etc.

Remember that every time you move the kexts from within /System/Library/Extensions, you should use the touch command in Single User Mode with Read and Write mount.

1 - Boot in Single User Mode: Command + S keys at boot.

2 - verify filesystem:
fsck -fy

3 - Mount filesystem with Read and Write:
mount -uw /

4 - Touch /System/Library/Extensions and wait 2 minutes, the reboot.

touch /System/Library/Extensions
reboot

5 - Boot normal -> system rebuild kext cache and reboot.

6 - Boot normal.

7 - Create LoginHook -> AMDRadeonX3000.kext -> reboot

8 - Boot normal and verify hibernate and pmset and -> System Preferences -> Energy Saver -> Enable/Disable Automatic Graphics Switching.

@kevinlul

This comment has been minimized.

Copy link

commented Sep 1, 2018

@nsgrbr

You are absolutely incredible. This appears to be the way. No hassle with custom kexts or bootloaders either =D Thank you so much!

On the first try, manually loading the kext, it seemed to work for sleep.
After setting up the LoginHook and rebooting though, it black screened on wake.
However, rebooting again, there was no problem. I don't know what might have caused it, but it is definitely alive and kicking now.
This is in the default hybrid sleep mode (3).

I'll try to continue to regularly check this thread to help anybody else with this route.

This bypasses the AMD GPU via software on High Sierra. The system boots in integrated, is unable to switch to discrete, sleeps normally, and can control brightness and power manage the disabled GPU. Due to EFI limitations, Bootcamp in emulated BIOS mode is unusable, and EFI boot does not expose sound, among other things, but this is a usable Mac!

EDIT: To update, obviously, all the kexts must be moved back, and then this process has to be done again, right?

@nsgrbr

This comment has been minimized.

Copy link

commented Sep 2, 2018

@cumandr

Yes, the new AMD kexts are placed inside the /System/Library/Extensions with each new update.

The problematic kext is AMDRadeonX3000.kext. This AMDRadeonX3000.kext freezes the Macbook Pro 2011 if it is inside /System/Library/Extensions with an damaged/failed AMD GPU + gpu-power-prefs to Intel GPU.

If you do not want to have to rename all the AMD kexts that have been moved, then you can create the directories /DisableExtensions, /DisableExtensions-01, /DisableExtensions-02, etc, and move the new AMD kexts and leaving only the AMD6000Controller.kext, AMDLegacySupport.kext, and AMDLegacyFrameBuffer.kext inside /System/Library/Extensions.

Or just move only the new AMDRadeonX3000.kext from /System/Library/Extensions to /DisableExtensions or /System/Library/Extensions-off .

1 - Install update from App Store. Choose only Install update and NOT reboot (phase 1). Some people have complained that the Macbook Pro 2011 freezes when trying to reboot after finishing the update.

2 - After finish install update, choose Logout -> Login screen -> Restart -> wait for a message saying that there is a pending installation (phase 2) and choose "continue installation and restart".

3 - After restart -> boot normal -> MacOS rebuild kext cache and frozem Macbook Pro 2011 -> AMDRadeonX3000.kext back to /System/Library/Extensions.

Attention: if you did an update and after the rebuild kext Macbook Pro 2011 did not freeze and boot normally, then Apple put an incomplete AMDRadeonX3000.kext without the Info.plist file.
Without Info.plist, then the new AMDRadeonX3000.kext is not loaded during the boot inside /System/Library/Extensions.
In this case it is not necessary to rename the old AMDRadeonX3000.kext and move the new AMDRadeonX3000.kext - steps 4, 5, 6, 7 and 8).

4 - Force shutdown with Power Button -> boot Single User Mode (Command + S keys at boot) -> verify filesystem and reboot.
You have made a forced shutdown because of the Macbook Pro 2011 freeze. The fsck command will check if you have to fix something on the file system.

fsck -fy
reboot

5 - Boot Recovery Mode (Command + R keys at boot) or Recovery Mode Single User (Command + R + S keys at boot) and disable SIP and reboot.

csrutil disable
reboot

6 - Boot Single User Mode (Command + S keys at boot) and Move AMDRadeonX3000.kext (MikeyN Guide - SIP disable) from /System/Library/Extensions to /DisableExtensions or /System/Library/Extensions-off

fsck -fy
mount -uw /

7 - Rename old AMDRadeonX3000.kext inside /DisableExtensions and move new AMDRadeonX3000.kext from /System/Library/Extensions to /DisableExtensions.
Kexts are directories and there can not be two directories with the same name inside /DisableExtensions.
mv command -> move or rename files and directories.

mv -v /DisableExtensions/AMDRadeonX3000.kext /DisableExtensions/AMDRadeonX3000.kext.01
mv -v /System/Library/Extensions/AMDRadeonX3000.kext /DisableExtensions

8 - touch command -> wait 2 minutes -> reboot -> boot normal -> MacOS rebuild kext cache and reboot -> boot normal.

touch /System/Library/Extensions
reboot

9 - LoginHook kextload new AMDRadeonX3000.kext after login and Power Off AMD GPU - decrease system temperature and increase battery life.

10 - Is everything OK with the normal boot and kexload AMDRadeonX3000.kext? If so, then restart Macbook Pro 2011.
Boot Recovery Mode (Command + R keys at boot) or Recovery Mode Single User (Command + R + S keys at boot) and enable SIP and reboot.

csrutil enable
reboot


Follow the MikeyN Guide - page 35 - #875 - to move the AMDRadeonX3000.kext from the /System/Library/Extensions directory and do not freeze Macbook Pro (at 75% progress bar or "IOConsoleUsers: gIOScreenLockState 3" message).

Rename old AMDRadeonX3000.kext and move new AMDRadeonX3000.kext after update - Page 57 - #1425

Shutdown or Restart Macbook Pro - avoid black screen freeze - Update 2 - Page 57 - #1425

Close the Lid - Sleep - Waking - Page 43 #1066 - Page 50 #1243

@philtesone

This comment has been minimized.

Copy link

commented Sep 3, 2018

Shades is a Preference Pane item on your Mac which adds smoother screen brightness controls than the defaults. After installing, you can brighten or darken your screen across a much wider range than the Mac’s built-in controls.

@kevinlul

This comment has been minimized.

Copy link

commented Sep 3, 2018

After some kerfuffles, the update worked.

Ouch. Cmd+R+S into Single User Recovery no longer works. Guess I'll bless rEFInd again.

Leaving SIP off then, in case it resets.

@iriann

This comment has been minimized.

Copy link

commented Sep 13, 2018

@blackgate thank you!

@takeshi74

This comment has been minimized.

Copy link

commented Sep 25, 2018

@nsgrbr Thank you for your work and for sharing all this information!

It took me a while but I think I finally got everything sorted out. My system was a bit of a mess from attempts to get MikeN's solution working, switching to the GRUB solution and now switching to yours. Several typos in Terminal -- leading to an incorrectly named script file and an error in the script itself as well -- didn't help either.

Additionally, I had problems with using show log --last kicking out a "cannot use --last when archive metadata is missing" but I finally sorted that out by deleting the logs. That allowed me to determine that the AMDGPUWakeHandler kext wasn't loading correctly. Don't recall exactly what I did to correct that but I am now getting the log show to show the "Disabling GPU".

It is really nice to have brightness control in High Sierra and to not have to deal with GRUB!

@filipeferraz

This comment has been minimized.

Copy link

commented Oct 15, 2018

Anyone tried to install OSX Mojave in MBP 2011?
I have installed with DosDude patch tool to force install on non compatible hardware about a week and is running fine without any graphic card trick. Don't know if it's because of missing graphic card driver to be an incompatible model. If others can try. In High Sierra the installer was crashing when I tried the Mojave.

@kandman

This comment has been minimized.

Copy link

commented Nov 16, 2018

Thank you for all the effort putting this together. I am currently using the MikeyN solution but would like to solve the issue with waking up requiring a reboot. Are there instructions on how to compile the kext AMDGPUWakeHandler as referenced in step 5 of the instructions? I don't see a makefile at the link provided (https://github.com/blackgate/AMDGPUWakeHandler). Thanks again!

@ferstar

This comment has been minimized.

Copy link

commented Dec 9, 2018

thx, your save my mac!!!
hw: mac pro i7 15' early 2011(with the fucking AMD GPU inside)
os: HighSierra 10.13.6 (17G4015)
here are my final EFI file tree structure(extra efi files are come from Ubuntu 18.04 official ISO):

.
β”œβ”€β”€ [ 512]  EFI
β”‚Β Β  β”œβ”€β”€ [ 512]  APPLE
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ [ 512]  CACHES
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── [ 512]  CAFEBEEF
β”‚Β Β  β”‚Β Β  └── [ 512]  EXTENSIONS
β”‚Β Β  β”‚Β Β      └── [ 15M]  Firmware.scap
β”‚Β Β  └── [ 512]  grub
β”‚Β Β      β”œβ”€β”€ [1.1M]  BOOTx64.EFI
β”‚Β Β      └── [1.1M]  grubx64.efi
└── [ 512]  boot
    └── [1.0K]  grub
        β”œβ”€β”€ [2.3M]  efi.img
        β”œβ”€β”€ [4.9K]  font.pf2
        β”œβ”€β”€ [ 278]  grub.cfg
        β”œβ”€β”€ [  55]  loopback.cfg
        └── [ 12K]  x86_64-efi
            β”œβ”€β”€ [ 15K]  acpi.mod
            β”œβ”€β”€ [1.9K]  adler32.mod
            β”œβ”€β”€ [ 22K] xxx.mod

and my grub.cfg:

set timeout=10
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
}

and follow this post steps load the attached kext to prevent the GPU from waking up from sleep
I also installed smcFanControl to lower the CPU temperature and use Brightness Slider to control screen light
Unfortunately, when I close the lid and open again, the screen can't wake up unless reboot it.
But, compared to the frequent crash and boot loops, the wake up issue is just little case which can be ignored.

PS: I upload some useful software to Google disk @kandman
https://drive.google.com/drive/folders/1bURkW1n8ARDR4TsjcE08WJ2gCpAevubw?usp=sharing

@leeevin99

This comment has been minimized.

Copy link

commented Jan 8, 2019

@nsgrbr
I solved the problem of kernel panic after waking up in High Sierra 10.13.6. with AMDGPUWakeHandler.kext.

First you need to do the steps listed here. Then you need to run the script that will unload the AMDGPUWakeHandler.kext before sleep. And also you need to run a script that will load the AMDGPUWakeHandler.kext after wake up. To do this, you will need SleepWatcher 2.2. Unzip it to the convenient for you folder. After that, run the following commands in the terminal (I found them here):

# go to the folder with sleepwatcher_2.2
cd /.../sleepwatcher_2.2

# create folders necessary for installation
sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8

# move files into installation folders
sudo cp sleepwatcher /usr/local/sbin
sudo cp sleepwatcher.8 /usr/local/share/man/man8
sudo cp config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist

sleep 1

# load launch agent
sudo launchctl load -w -F /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher.plist

# create script in local user directory and make them executable
sudo touch /etc/rc.wakeup
sudo touch /etc/rc.sleep
sudo chmod +x /etc/rc.sleep /etc/rc.wakeup

Now you need to go to the folder /etc:

1) In the finder press Shift + Cmd + G and type /private/etc
2) Find and open the rc.sleep in any text editor and write

#!/bin/bash
kextunload /.../AMDGPUWakeHandler.kext
exit 0

3) Find and open the rc.wakeup in any text editor and write

#!/bin/bash
kextutil /.../AMDGPUWakeHandler.kext
exit 0

All, now kernel panic because of AMDGPUWakeHandler.kext on your MacBook will no longer.

Note:
instead ... type the path to the file

I also want to thank @nsgrbr and everyone who took part in solving the problem. You've been very helpful.

I apologize if somewhere made mistakes in the text, because I do not know English very well and made a translation with the help of an online translator.

@rirenmargo

This comment has been minimized.

Copy link

commented Jan 18, 2019

After several reboots, the AMDRadeonX3000.kext is missing! Could somebody send it to me? I run Sierra on macbook late 2011.

@Rsavag01

This comment has been minimized.

Copy link

commented Jan 20, 2019

Help ! I'm running a late 2011 MacBook Pro, with Mac OS Sierra / Windows 10 ( dual boot option)
Ive created the the bootable USB and I'm trying to follow the instructions in time 3.5 however, I must be doing something wrong. When I boot I receive the following options when booting from the USB.

Try ubuntu without installing
Install ubuntu
OEM install (for manufacturers)
Check disc for defects
*MacOS

I assuming I highlight MacOS and type E to edit UUID as described above in instruction #3.5 the following lines of code are present when I highlight MacOS and type e to Edit

Setparams 'macOS'

insmod hfsplus
outb 0x728 1
outb 0x710 2
outb 0x740 2
outb 0x750 0
search --set=root --file /system/Library/CoreServices/boot.efi
chainloader /System/Library/CoreServices/boot.efi

I don't see where I'm suppose to " Replace YOUR_UUID with the uuid of your partition."

@iriann

This comment has been minimized.

Copy link

commented Jan 30, 2019

hi to all,

the fix is working very well on macbook pro late 2011 on sierra.

does anyone knows if i can run a fsck-fy on my boot disk with safety? or will it break the fix?

thanks,

@ashishjain77

This comment has been minimized.

Copy link

commented Feb 22, 2019

Hi,

I am not a mac developer but am in a stuck state now. Need help to get out of this mess.

  1. my hdd crashed which was having high sierra.
  2. got new SSD to replace the primary drive. Using recovery mode, installed upto el-capitan. during installation, my GPU fails. I use the method at start of this page to get into OS and successfully make the thing permanant.
  3. I was able to open my hdd and get the heads into parking position. HDD started working after that. I got greedy and want to move the items from HDD to SSD.
  4. since ssd is on el-capitan and HDD on high sierra. I need to upgrade the SSD. bad mistake. should have done as a fresh start.
  5. I started the upgrade process. on reboot option for upgrade. selected the same and now am stuck since GPU is failed and there is no way to complete the upgrade process. I am not able to use the HDD or SSD currently to get back.
  6. On trying to get into single recovery mode, disc that is getting mounted on root is disc3s1 and seems it is the upgrade dmg which got locked. when trying to use /sbin/mount -uw / the disc is getting write protected error. Not able to move the files AMD* from extensions folder to a separate folder.

Please help.

Regards,
Ashish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.