Skip to content

Instantly share code, notes, and snippets.

@blackgate
Last active October 14, 2024 00:44
Show Gist options
  • Save blackgate/17ac402e35d2f7e0f1c9708db3dc7a44 to your computer and use it in GitHub Desktop.
Save blackgate/17ac402e35d2f7e0f1c9708db3dc7a44 to your computer and use it in GitHub Desktop.
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
@ChristianHaeuber
Copy link

I'd also like to thank the developer for these instructions. I followed them and was able to get my 2011 mbp 15" functioning again. Thank you!

@suwandyt
Copy link

suwandyt commented Jun 2, 2020

Hi, has anyone here tried installing Mojave or Catalina on their 2011 MBP?

The solution posted by @blackgate and @nsgrbr has worked wonders on my old device. And I will be eternally grateful for the solution :) However, it has come time for me to part with this machine as I purchased a new 13" MBP and am planning to sell this one.

I'm now on High Sierra with the latest solution applied and was hoping to do a clean install of Mojave or Catalina and then sell it off.

Otherwise, I'll just sell it with a caveat, they can't and shouldn't update past High Sierra.

@zsoltsavanya
Copy link

Hi suwandyt. Based on my experience: the only system without any problem is Sierra with this solution (using it now, it's fine since more than a half year now). With high Sierra: if something wrong, than you can't access to single-user mode easily.
If you want to upgrade: it is possible, but I recommend the hardware-based solution (I know it's not free, but is the best and final). Or you can do it yourself, but... : https://www.youtube.com/watch?v=vbXb0gfRxEY So, it is possible to disable the Amd GPU permanently with a kind of hardware modification. Then you can install any OS, even unsupported ones with dosdude1's solutions (just as if you have a MacBook with Intel-only gpu). Your buyer will be fine, will not ever face any problem...

@fjdr
Copy link

fjdr commented Jun 2, 2020

Hello to all: I work with my MacBook Pro 17 early 2011 with an update in RAM and Bluetooth 4.0 card. And change 3 kext files to reach 1536 Mb VRAM. Shortly will test it with Mojave and Catalina.

I use it with High Sierra since years without troubles until each Security Updates. For that reason make a procedure with a sure success.

General Hacks MBP 17 for boot

DISABLE AMD EFI commands

Start in single mode:

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

Then reboot Restore and Disable SIP
Reboot on Recovery mode: In Terminal do:
csrutil disable

And then
Go to your macOS Volume and do:

mv /Volumes/(your Mac Volume)/System/Library/Extensions/AMDRadeonX3000.kext /Volumes/(your Mac Volume)/System/Library/Extension-off/
reboot


Force CAT
sudo /Applications/Utilities/Continuity-Activation-Tool/Continuity\ Activation\ Tool.app/Contents/Resources/contitool.sh -f

@fjdr
Copy link

fjdr commented Jun 2, 2020

NOTE: My discrete Graphic card dies long time ago. Then work only with the integrated only. Upgrade to 16 GB RAM and it is very stable until editing very large photos. But it is reasonably operative.

@fjdr
Copy link

fjdr commented Jun 2, 2020

Other thing: Mojave and Catalina do not use the discrete card at all. But I do not sure about CAT

@BeauSlim
Copy link

@suwandyt I have been running on Mojave for couple weeks. The latest patch for high-sierra wouldn't install for me so I used dosdude's Mojave enabler to install Mojave. I have a startup script to kextload AMDRadeonX3000.kext. Backlight works. GPU diode temp seems higher than it used to be but 40C is okay. Sleep is buggy and I have not yet tried the wake handler.

I would imagine that you will get the best price if you do dosdude's hardware mod to disable the faulty GPU.

@brianjessup
Copy link

Hi! Where did you all track down the gmux i/o ports addresses?

I have a MacBookPro9,1 Mid-2012 nonretina and I'm trying to track those down to modify the kext. The 2011 values don't seem to work for me.

Thank you!

@iriann
Copy link

iriann commented Nov 24, 2020

anyone tried this awsome method on Catalina?

@kandman
Copy link

kandman commented Mar 8, 2021

This is great! I've been using the kext solution for years but always had problems with sleeping and shutdown. This solves everything.

Many thanks to the developer and to everyone who has shared their knowledge.

Question: Currently on 10.11.6 and would like to get to 10.12.x. Has anyone done this successfully and if so, how?

Thanks in advance for your time.

@gaddyya
Copy link

gaddyya commented Dec 4, 2021

In my case, I did the following:

  • option + R + Boot
  • csrutil disable
  • reboot
  • option + S
  • mount -uw /
  • mkdir /Extention-off
  • mv /System/Library/Extension/ATIRadeonX3000.kext /Extention-off
  • reboot

This completely disables the discrete graphics and everything else continues to work. Is retained when falling asleep and rebooting, the brightness change is also alive working!

PS. I've tried to disable by nvram, but for me it dosn't work. But this one is done! Excellent! I satisfied!

@jxdesign
Copy link

My 2011 macbook pro was restarting into what seemed somewhat normal, but then would get stuck on a grey screen and I couldn't access anything. Running this line in single user mode:

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

did the trick. Thank you so much for making this so clear.

Is there a way to make this permanent? I don't need the whole reboot thumb drive steps. Just wondering if there's a way for me to permanently change the gpu power prefs so I don't have to manually type in each digit and letter. The computer will freeze up when I close the screen and put it to sleep and I"ll get the spinning rainbow ball of death and have to restart, and then type the above code in. So anything to permanently run this would be very helpful!

@IgnacioPaiz
Copy link

In step 3, nothing happens when I click the link. "Download ubuntu iso", am I missing something?

@blackgate
Copy link
Author

@IgnacioPaiz This uses an outdated version of Ubuntu, you probably need to download a newer version.

@zsoltsavanya
Copy link

Hi, the link works here, and no, I think you don't need newer, the old version is fine, I'm still using it.

@m-a-v
Copy link

m-a-v commented Apr 16, 2023

This would be the working URL.
https://old-releases.ubuntu.com/releases/artful/ubuntu-17.10-desktop-amd64.iso

But this Ubuntu version is already very much outdated. Basically, you can still use it, but probably an Ubuntu 22.04 LTS would do as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment