Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
The first post of this thread is a WikiPost and can be edited by anyone with the appropiate permissions. Your edits will be public.

nsgr

macrumors 6502
May 22, 2017
317
117
I apologize if this has already been covered, but what is the easiest way to set the EFI back to the AMD Radeon GPU?

I successfully used the guide and other posts to modify my 2011 MBP 15's EFI to use Intel HD Graphics 3000. This works perfectly for macOS, but I have been unsuccessful in my attempts to get it to work with Windows 7 (which uses a BIOS-style boot rather than UEFI), so I am considering sending my laptop into a repair service to have the AMD GPU replaced. Just want to make sure it's set back to stock settings before that happens.

1 - Clear NVRAM / PRAM -> back to AMD gpu as primary gpu.

or

2 - Boot in Single User Mode (Command + S):
Code:
sudo nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%00%00%00%00

AMD gpu primary = %00%00%00%00

Intel gpu primary = %01%00%00%00
 

is3000

macrumors newbie
Dec 27, 2017
2
0
1 - Clear NVRAM / PRAM -> back to AMD gpu as primary gpu.

or

2 - Boot in Single User Mode (Command + S):
Code:
sudo nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%00%00%00%00

AMD gpu primary = %00%00%00%00

Intel gpu primary = %01%00%00%00

Thank you so much. Good to know it's that simple (although I'll bet it presents headaches for people hoping to use the integrated GPU indefinitely).
 

Mbpjoe

macrumors newbie
Dec 29, 2017
4
0
Hi there

This worked for me as well, but did you also rm the other gnu file.
cpu-active or gfx-saved-config-restore-status

Thanks


Hi guys, thanks for the solutions provided in this thread. Just a week ago my MBP 2011 AMD finally broke. But now I'm running again with the AMD switched off and the IntelHD working :)

Just a few hiccups; I read till page 27 and then decided I could better just ask the question...

-The MBP can't seem to wakeup from sleep mode
-The brightness controles aren't working

anyone has a solution for this?
[doublepost=1514556022][/doublepost]Hi AppleFinder
Thanks for this solution, seems to work ok on my 2011 MBP, But, do I need to rm the gnu-active as well?
also should the MBP boot completely normally or with some screen distortion and fan comes on

Thanks
Joseph


If you don't have time to read my story (which also describes some interesting technical approaches) just scroll down this thread until a "100% WORKING SOLUTION" text

Discrete AMD GPU of my 2011 MacBook Pro 8,2 has finally failed because of the reasons mentioned here ( http://logicboardmac.blogspot.ru/ ) and there ( https://www.macrumors.com/2015/02/19/2011-macbook-pro-repair-program-apple/ ) . It has been working perfectly for 6 years under quite a high load, even tried SETI@HOME mining at background! So I was confident that my MBP is not affected by bad solder / bad soldering quality and didn't want to bring it to Apple for a free repair program - partially because couldn't find the time to pause my important software projects, partially because I was afraid that Apple might give me a less reliable logic board or refuse a free repair because of the several unrelated repairs that I did manually by myself earlier to save money: changed thermal paste a few times, replaced the internal battery 2 times, replaced a keyboard with broken buttons, etc. But it finally broke down last week: laptop's screen image became distorted, it refused to boot OS X (always freezing half-way), and - Apple free repair program has already ended! I know there are affordable solutions like $50 BGA resoldering at unofficial local repair shop and that its possible to get a new replacement HD 6750M chip from AliExpress for $35 or cheaper ( http://www.aliexpress.com/item/DC-2...0028-216-0810028-BGA-Chipset/32764872143.html or https://www.aliexpress.com/item/DC-2015-New-216-0810001-216-0810001-Graphic-Chipset/32718112928.html , because don't know if this is true - https://www.rossmanngroup.com/board...0604-replace-216-0810005-gpu-with-216-0810028 ) to guarantee a successful repair, so the total price of repair would be either $50 or $50+$35=$85 - less than $100 in any case. But I don't like investing money to the old computers, so I have thought - what if there is some hack to force MBP to use integrated graphics ALL THE TIME, even while booting ? And then started to explore the possible solutions...

===

First of all, it is possible to successfully boot a MBP to OS X while still using the failed GPU, after you remove the AMD drivers by booting in command line mode (CMD+S) and entering these commands:
1) fsck -fy (to check a disk)
2) mount -uw / (mount a root filesystem with read/write permissions)
3) sudo mkdir /AMD_Kexts/ (make a directory to store the AMD drivers in case you'll need them in future)
4) sudo mv /System/Library/Extensions/AMD*.* /AMD_Kexts/ (move the AMD drivers)
5) sudo rm -rf /System/Library/Caches/com.apple.kext.caches/ (remove the AMD drivers cache)
6) sudo mkdir /System/Library/Caches/com.apple.kext.caches/ (just in case OS X will be dumb and will not recreate this directory, I am creating it for OS X)
7) sudo touch /System/Library/Extensions/ (to update the timestamps so that new driver caches - without AMD drivers - will be definitely rebuilt)
8) sudo umount / (umount a partition to guarantee that your changes are flushed to it)
9) sudo reboot

The degree of your inconvenience while doing these steps - strongly depends on how heavily a screen's image is distorted in your case. In my case it was even more difficult because the OS X partition became a "read-only" partition (because of too many emergency shutdowns I did while desperately trying to boot OS X with a failed GPU) so I had to remove a hard drive from MacBook Pro and (using a USB to SATA 2.5" adapter taken from my portable HDD) attached it to a computer with Linux, then followed these instructions:

https://superuser.com/questions/961401/mounting-hfs-partition-on-arch-linux (1st answer) - carefully executed a number of commands, calculated a sizelimit for my parition layout, and finally ran sudo mount -t hfsplus -o force,rw,sizelimit=YOURNUMBER /dev/sdb2 /mnt to mount this HFS+ partition to /mnt directory in read-write mode. Then I performed these "1)-7)" steps you see above, and also repaired a filesystem by running sudo fsck.hfsplus -f /dev/sdb2 before unmounting a partition with sudo umount /mnt and putting a hard drive back to MBP...

===

This gave me a MBP which could boot to OS X although STILL using a broken AMD GPU: so it screen's image is very distorted (could browse the Internet but quite inconvenient to read a text), Launchpad is super laggy, and you can't switch to Integrated GPU using gfxCardStatus because: without AMD drivers (which we had to remove to successfully boot to OS X) Macbook Pro thinks its' internal screen is External Display and gfxCardStatus tells it is impossible to switch because External Display is using AMD GPU. Somewhere I found a suggestion that it is possible to rebuild a gfxCardStatus from the source code - https://github.com/codykrieger/gfxCardStatus - with removed or commented out 156-166 lines in the ./gfxCardStatus/Classes/GSProcess.m to make it to ignore the external display:

// find out if an external monitor is forcing the discrete gpu on
CGDirectDisplayID displays[8];
CGDisplayCount displayCount = 0;
if (CGGetOnlineDisplayList(8, displays, &displayCount) == noErr) {
for (int i = 0; i < displayCount; i++) {
if ( ! CGDisplayIsBuiltin(displays))
[list addObject:[NSDictionary dictionaryWithObjectsAndKeys:
Str(@"External Display"), kTaskItemName,
@"", kTaskItemPID, nil]];
}
}


So I rebuilt a gfxCardStatus using the instructions from the last reply of this issue -
https://github.com/codykrieger/gfxCardStatus/issues/229
(also had to download a MacOSX10.11.sdk from here - https://github.com/phracker/MacOSX-SDKs/releases - unpack and copy it to XCode's /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk - because of the Apple's stupidity the latest XCode for El Capitan does not include SDK for El Capitan!) However, it still didn't work - gfxCardStatus only pretended that it has switched to Integrated GPU, while in reality OS X did not let it switch! Even after I edited ./gfxCardStatus/Classes/GSGPU.m file to enable the mysterious "Nuke it from orbit switching" option, it still couldn't switch...

===

Then I discovered this interesting repository - https://github.com/0xbb/gpu-switch - which is partially similar by its' source code to gfxCardStatus but also has the "Login Hooks" (install_hooks.sh) to "automate the switching process for login/logout". Sadly it didn't work for me... However, there is a very interesting gpu-switch text file right at the root of this repository, which describes the EFI variables!

https://github.com/0xbb/gpu-switch/blob/master/gpu-switch

After studying it and also reading this issue's comments - https://github.com/0xbb/gpu-switch/issues/11 - I became confident to try this solution, but found out that my MacBook Pro 2011 8,2 with OS X El Capitan 10.11.6 is in a VERY problematic situation:

1) rEFInd is not installed, and to install it - must disable SIP protection. But I cannot boot to Recovery mode (Command+Option+R) or to OS X Installation DVD/USB (hold Option), (to disable SIP), because they freeze while booting! - although I removed AMD kexts from my system, of course these recovery tools are using AMD kexts integrated to their design. Also cannot use Rootfool hack ( https://github.com/gdbinit/rootfool ) to disable SIP during runtime, because it works only at OS X version older than 10.11.4

2) Tried overheating my Macbook Pro on purpose (forcing CPU usage to 100% and putting it to a tightly closed bag) to force it to shutdown from overheating and then quickly reboot so that Integrated graphics will be enabled during the boot time - making it possible to boot to Recovery. But because of the wonderful high end thermal paste I have applied not so long ago - cannot overheat it even after waiting for a long time! At this point I thought that could either: a) remove AMD kexts from Installation media, or b) to connect MBP's hard drive to a Linux machine again and run a bunch of chmods to remove the SIP flags from the directories mentioned here ( http://apple.stackexchange.com/questions/193368/what-is-the-rootless-feature-in-el-capitan-really ) which could potentially make a system unbootable, or c) to try installing rEFInd to HFS+ partition directly from a Linux machine with root rights because it will bypass SIP --- but have not explored these options, although some of them might have worked...

3) Wanted to boot a Linux LiveCD to edit the EFI variables from there, but no matter what I did: tried booting straight without GRUB option modifications, tried editing GRUB boot options (with "e" key) to add nomodeset / remove quiet splash / or both in every combination , or like suggested in this article ( https://wiki.archlinux.org/index.php/MacBookPro8,1/8,2/8,3_(2011) ) also add i915.modeset=0 radeon.modeset=0 or radeon.modeset=0 i915.modeset=1 i915.lvds_channel_mode=2 ; and then pressed Fn+F10 or Shift+Ctrl+Fn+F10 to boot with these options: but the Linux boot process always failed at different boot stages, no matter what popular user-friendly Linux distribution or what version of it I am trying: tried many releases of Ubuntu / Lubuntu / Fedora , even the old "AMD64 Mac" and "Alternate AMD64 Mac" images, but they always failed - either at the very beginning of boot process (black screen, or a black screen with a blinking or stuck _ character at the left upper corner) or failed at the very end of it - right before it is supposed to show a graphical desktop environment...

Later, totoe_84 wrote that he was able to boot Ubuntu in graphical mode using the following setup for GRUB:
  • To disable the AMD graphics card I added the following lines after set gfxpayload=keep
outb 0x728 1
outb 0x710 2
outb 0x740 2
outb 0x750 0
  • Next I added the following after quiet splash
    i915.lvds_channel_mode=2 i915.modeset=1 i915.lvds_use_ssc=0
(based on https://ubuntuforums.org/showthread.php?t=2157775 )

===

Then I remembered that there are not-mainstream Linux distributions for advanced users, which have a LiveCD without any graphical interface: you are dropped to a pure console and you are supposed to install the system along with only those graphical interfaces and software packages / groups of packages which you explicitly select. For example: Arch Linux (https://www.archlinux.org/) and Gentoo Linux (https://gentoo.org/) . Because their LiveCD does not have a graphical interface, they could be booted without a problem to a pure Linux console and there you could edit the EFI variables ! So here is a...

===
=== 100% WORKING SOLUTION
===
=== Force your MBP to ALWAYS use Intel integrated GPU (EFI variable fix)
===
=== to make it great again ! ;)
===


1) Create the Arch Linux LiveCD/LiveUSB :

You need a working computer for that and a spare CD/DVD/USB drive. Download the latest Arch Linux ISO image from this page - https://www.archlinux.org/download/ , at the time of writing it is archlinux-2017.03.01-dual.iso . Then you could either simply burn this ISO to CD/DVD (which later could be either inserted to MBP's SuperDrive or External DVD Drive connected to MBP by two USB cables) or create a bootable USB: use the great detailed instructions from this page, https://wiki.archlinux.org/index.php/USB_flash_installation_media

2) Boot to it: insert this CD/DVD/USB to Macbook Pro, hold Option key while booting, choose "EFI boot" (that is your bootable installation media), press "e" key to edit the GRUB options of the Arch Linux archiso x86_64 UEFI CD menu entry while it is selected at the main screen, add nomodeset to the end of this line and press Enter. If everything is done correctly, you will find yourself at the Linux console!

3) Edit EFI vars: looks like efivarfs filesystem is mounted by default! So you can already cd /sys/firmware/efi/efivars and ls to explore this directory and see if there is a "gpu-power-prefs-..." variable (where ... is UUID of this variable). If there is such a variable, its better to remove it with rm. In my case the efivarfs has been mounted by default with read/write permissions, but if you are getting the "operation not permitted" message while attempting to rm, it means that in your case efivarfs has been mounted as read-only and you need to remount it with read-write permissions and try again (credits to totoe_84 for this valuable addition) :
*) cd /
*) umount /sys/firmware/efi/efivars/
*) mount -t efivarfs rw /sys/firmware/efi/efivars/
*) cd /sys/firmware/efi/efivars/

If your screen is so distorted that it is difficult to see the letters, just start typing the rm gpu-power-pre and then press TAB key for autocompletion. In my case there were not such a EFI variable, only "gpu-active-..." and maybe somehow related "gfx-saved-config-restore-status-..." . Then I looked again at that gpu-switch text file (mentioned above, https://github.com/0xbb/gpu-switch/blob/master/gpu-switch),
and entered THESE COMMANDS:

*) chattr -i "/sys/firmware/efi/efivars/" <----- skip this command

Actually a gpu-switch script had "${sysfs_efi_vars}/${efi_gpu}" but I didnt have a "gpu-power-prefs-..." variable - so, partially by mistake, I didn't add that efi_gpu suffix and entered this incomplete path accidentally

*)
printf "\x07\x00\x00\x00\x01\x00\x00\x00" > /sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9

Did not have a EFI "gpu-power-prefs-" variable so I thought that it will be OK to create a new one with a random UUID - in this case, taken directly from a gpu-switch script

*) chattr +i "/sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9"

http://www.tecmint.com/chattr-command-examples/ - chattr (Change Attribute) is a command line Linux utility that is used to set/unset certain attributes to a file in Linux system to secure accidental deletion or modification of important files and folders, even though you are logged in as a root user.
...
Syntax of chattr ---> chattr [operator] [flags] [filename]
...
A file is set with ‘i‘ attribute (+i as you see in this command) ---> cannot be modified (immutable). Means no renaming, no symbolic link creation, no execution, no writable, only superuser can unset the attribute.
...
Operator
  1. + : Adds the attribute to the existing attribute of the files.
  2. : Removes the attribute to the existing attribute of the files.
  3. = : Keep the existing attributes that the files have.
This chattr command is supposed to lock a file to make it accessible only by "superuser" - and so that, while booting, your EFI will have no chance to screw up your gpu-power-prefs-... variable under any circumstances

*) cd /

Could not unmount efivars if you are inside this directory, so change to the root directory

*) umount /sys/firmware/efi/efivars/

Guarantees that your EFI variables are flushed to efivarfs filesystem, please unmount it safely before rebooting)

*) reboot

===> IF YOU DID EVERYTHING CORRECTLY, MOST LIKELY THAT YOUR MACBOOK PRO IS NOW USING INTEGRATED GRAPHICS WHILE BOOTING, AFTER BOOTING, AND IS WORKING GREAT AGAIN ! ;)

In the future maybe you could need to re-apply this solution if you would have to reset your PRAM / NVRAM / SMC because of some other problems, so remember this solution somewhere... Funny thing: now you can't switch to Discrete GPU even using gfxCardStatus, it is forever stuck at Integrated


I spent two working days to discover this solution, and really hope that it will work flawlessly for every MBP owner with a broken discrete GPU. Good luck!
 

ssvegeta96

macrumors newbie
Dec 29, 2017
7
1
u dont need any of that other than nomodeset as a kernel parameter. tested it with elementary os and kubuntu

@AppleMacFinder I was able to boot Ubuntu in graphical mode using the following setup for GRUB:
  • To disable the AMD graphics card I added the following lines after set gfxpayload=keep:
outb 0x728 1
outb 0x710 2
outb 0x740 2
outb 0x750 0​
  • Next I added the following after “quiet splash”:
    i915.lvds_channel_mode=2 i915.modeset=1 i915.lvds_use_ssc=0​
I found this procedure on https://ubuntuforums.org/showthread.php?t=2157775
 

amingh92

macrumors newbie
Dec 29, 2017
2
0
If you don't have time to read my story (which also describes some interesting technical approaches) just scroll down this thread until a "100% WORKING SOLUTION" text

Discrete AMD GPU of my 2011 MacBook Pro 8,2 has finally failed because of the reasons mentioned here ( http://logicboardmac.blogspot.ru/ ) and there ( https://www.macrumors.com/2015/02/19/2011-macbook-pro-repair-program-apple/ ) . It has been working perfectly for 6 years under quite a high load, even tried SETI@HOME mining at background! So I was confident that my MBP is not affected by bad solder / bad soldering quality and didn't want to bring it to Apple for a free repair program - partially because couldn't find the time to pause my important software projects, partially because I was afraid that Apple might give me a less reliable logic board or refuse a free repair because of the several unrelated repairs that I did manually by myself earlier to save money: changed thermal paste a few times, replaced the internal battery 2 times, replaced a keyboard with broken buttons, etc. But it finally broke down last week: laptop's screen image became distorted, it refused to boot OS X (always freezing half-way), and - Apple free repair program has already ended! I know there are affordable solutions like $50 BGA resoldering at unofficial local repair shop and that its possible to get a new replacement HD 6750M chip from AliExpress for $35 or cheaper ( http://www.aliexpress.com/item/DC-2...0028-216-0810028-BGA-Chipset/32764872143.html or https://www.aliexpress.com/item/DC-2015-New-216-0810001-216-0810001-Graphic-Chipset/32718112928.html , because don't know if this is true - https://www.rossmanngroup.com/board...0604-replace-216-0810005-gpu-with-216-0810028 ) to guarantee a successful repair, so the total price of repair would be either $50 or $50+$35=$85 - less than $100 in any case. But I don't like investing money to the old computers, so I have thought - what if there is some hack to force MBP to use integrated graphics ALL THE TIME, even while booting ? And then started to explore the possible solutions...

===

First of all, it is possible to successfully boot a MBP to OS X while still using the failed GPU, after you remove the AMD drivers by booting in command line mode (CMD+S) and entering these commands:
1) fsck -fy (to check a disk)
2) mount -uw / (mount a root filesystem with read/write permissions)
3) sudo mkdir /AMD_Kexts/ (make a directory to store the AMD drivers in case you'll need them in future)
4) sudo mv /System/Library/Extensions/AMD*.* /AMD_Kexts/ (move the AMD drivers)
5) sudo rm -rf /System/Library/Caches/com.apple.kext.caches/ (remove the AMD drivers cache)
6) sudo mkdir /System/Library/Caches/com.apple.kext.caches/ (just in case OS X will be dumb and will not recreate this directory, I am creating it for OS X)
7) sudo touch /System/Library/Extensions/ (to update the timestamps so that new driver caches - without AMD drivers - will be definitely rebuilt)
8) sudo umount / (umount a partition to guarantee that your changes are flushed to it)
9) sudo reboot

The degree of your inconvenience while doing these steps - strongly depends on how heavily a screen's image is distorted in your case. In my case it was even more difficult because the OS X partition became a "read-only" partition (because of too many emergency shutdowns I did while desperately trying to boot OS X with a failed GPU) so I had to remove a hard drive from MacBook Pro and (using a USB to SATA 2.5" adapter taken from my portable HDD) attached it to a computer with Linux, then followed these instructions:

https://superuser.com/questions/961401/mounting-hfs-partition-on-arch-linux (1st answer) - carefully executed a number of commands, calculated a sizelimit for my parition layout, and finally ran sudo mount -t hfsplus -o force,rw,sizelimit=YOURNUMBER /dev/sdb2 /mnt to mount this HFS+ partition to /mnt directory in read-write mode. Then I performed these "1)-7)" steps you see above, and also repaired a filesystem by running sudo fsck.hfsplus -f /dev/sdb2 before unmounting a partition with sudo umount /mnt and putting a hard drive back to MBP...

===

This gave me a MBP which could boot to OS X although STILL using a broken AMD GPU: so it screen's image is very distorted (could browse the Internet but quite inconvenient to read a text), Launchpad is super laggy, and you can't switch to Integrated GPU using gfxCardStatus because: without AMD drivers (which we had to remove to successfully boot to OS X) Macbook Pro thinks its' internal screen is External Display and gfxCardStatus tells it is impossible to switch because External Display is using AMD GPU. Somewhere I found a suggestion that it is possible to rebuild a gfxCardStatus from the source code - https://github.com/codykrieger/gfxCardStatus - with removed or commented out 156-166 lines in the ./gfxCardStatus/Classes/GSProcess.m to make it to ignore the external display:

// find out if an external monitor is forcing the discrete gpu on
CGDirectDisplayID displays[8];
CGDisplayCount displayCount = 0;
if (CGGetOnlineDisplayList(8, displays, &displayCount) == noErr) {
for (int i = 0; i < displayCount; i++) {
if ( ! CGDisplayIsBuiltin(displays))
[list addObject:[NSDictionary dictionaryWithObjectsAndKeys:
Str(@"External Display"), kTaskItemName,
@"", kTaskItemPID, nil]];
}
}


So I rebuilt a gfxCardStatus using the instructions from the last reply of this issue -
https://github.com/codykrieger/gfxCardStatus/issues/229
(also had to download a MacOSX10.11.sdk from here - https://github.com/phracker/MacOSX-SDKs/releases - unpack and copy it to XCode's /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk - because of the Apple's stupidity the latest XCode for El Capitan does not include SDK for El Capitan!) However, it still didn't work - gfxCardStatus only pretended that it has switched to Integrated GPU, while in reality OS X did not let it switch! Even after I edited ./gfxCardStatus/Classes/GSGPU.m file to enable the mysterious "Nuke it from orbit switching" option, it still couldn't switch...

===

Then I discovered this interesting repository - https://github.com/0xbb/gpu-switch - which is partially similar by its' source code to gfxCardStatus but also has the "Login Hooks" (install_hooks.sh) to "automate the switching process for login/logout". Sadly it didn't work for me... However, there is a very interesting gpu-switch text file right at the root of this repository, which describes the EFI variables!

https://github.com/0xbb/gpu-switch/blob/master/gpu-switch

After studying it and also reading this issue's comments - https://github.com/0xbb/gpu-switch/issues/11 - I became confident to try this solution, but found out that my MacBook Pro 2011 8,2 with OS X El Capitan 10.11.6 is in a VERY problematic situation:

1) rEFInd is not installed, and to install it - must disable SIP protection. But I cannot boot to Recovery mode (Command+Option+R) or to OS X Installation DVD/USB (hold Option), (to disable SIP), because they freeze while booting! - although I removed AMD kexts from my system, of course these recovery tools are using AMD kexts integrated to their design. Also cannot use Rootfool hack ( https://github.com/gdbinit/rootfool ) to disable SIP during runtime, because it works only at OS X version older than 10.11.4

2) Tried overheating my Macbook Pro on purpose (forcing CPU usage to 100% and putting it to a tightly closed bag) to force it to shutdown from overheating and then quickly reboot so that Integrated graphics will be enabled during the boot time - making it possible to boot to Recovery. But because of the wonderful high end thermal paste I have applied not so long ago - cannot overheat it even after waiting for a long time! At this point I thought that could either: a) remove AMD kexts from Installation media, or b) to connect MBP's hard drive to a Linux machine again and run a bunch of chmods to remove the SIP flags from the directories mentioned here ( http://apple.stackexchange.com/questions/193368/what-is-the-rootless-feature-in-el-capitan-really ) which could potentially make a system unbootable, or c) to try installing rEFInd to HFS+ partition directly from a Linux machine with root rights because it will bypass SIP --- but have not explored these options, although some of them might have worked...

3) Wanted to boot a Linux LiveCD to edit the EFI variables from there, but no matter what I did: tried booting straight without GRUB option modifications, tried editing GRUB boot options (with "e" key) to add nomodeset / remove quiet splash / or both in every combination , or like suggested in this article ( https://wiki.archlinux.org/index.php/MacBookPro8,1/8,2/8,3_(2011) ) also add i915.modeset=0 radeon.modeset=0 or radeon.modeset=0 i915.modeset=1 i915.lvds_channel_mode=2 ; and then pressed Fn+F10 or Shift+Ctrl+Fn+F10 to boot with these options: but the Linux boot process always failed at different boot stages, no matter what popular user-friendly Linux distribution or what version of it I am trying: tried many releases of Ubuntu / Lubuntu / Fedora , even the old "AMD64 Mac" and "Alternate AMD64 Mac" images, but they always failed - either at the very beginning of boot process (black screen, or a black screen with a blinking or stuck _ character at the left upper corner) or failed at the very end of it - right before it is supposed to show a graphical desktop environment...

Later, totoe_84 wrote that he was able to boot Ubuntu in graphical mode using the following setup for GRUB:
  • To disable the AMD graphics card I added the following lines after set gfxpayload=keep
outb 0x728 1
outb 0x710 2
outb 0x740 2
outb 0x750 0
  • Next I added the following after quiet splash
    i915.lvds_channel_mode=2 i915.modeset=1 i915.lvds_use_ssc=0
(based on https://ubuntuforums.org/showthread.php?t=2157775 )

===

Then I remembered that there are not-mainstream Linux distributions for advanced users, which have a LiveCD without any graphical interface: you are dropped to a pure console and you are supposed to install the system along with only those graphical interfaces and software packages / groups of packages which you explicitly select. For example: Arch Linux (https://www.archlinux.org/) and Gentoo Linux (https://gentoo.org/) . Because their LiveCD does not have a graphical interface, they could be booted without a problem to a pure Linux console and there you could edit the EFI variables ! So here is a...

===
=== 100% WORKING SOLUTION
===
=== Force your MBP to ALWAYS use Intel integrated GPU (EFI variable fix)
===
=== to make it great again ! ;)
===


1) Create the Arch Linux LiveCD/LiveUSB :

You need a working computer for that and a spare CD/DVD/USB drive. Download the latest Arch Linux ISO image from this page - https://www.archlinux.org/download/ , at the time of writing it is archlinux-2017.03.01-dual.iso . Then you could either simply burn this ISO to CD/DVD (which later could be either inserted to MBP's SuperDrive or External DVD Drive connected to MBP by two USB cables) or create a bootable USB: use the great detailed instructions from this page, https://wiki.archlinux.org/index.php/USB_flash_installation_media

2) Boot to it: insert this CD/DVD/USB to Macbook Pro, hold Option key while booting, choose "EFI boot" (that is your bootable installation media), press "e" key to edit the GRUB options of the Arch Linux archiso x86_64 UEFI CD menu entry while it is selected at the main screen, add nomodeset to the end of this line and press Enter. If everything is done correctly, you will find yourself at the Linux console!

3) Edit EFI vars: looks like efivarfs filesystem is mounted by default! So you can already cd /sys/firmware/efi/efivars and ls to explore this directory and see if there is a "gpu-power-prefs-..." variable (where ... is UUID of this variable). If there is such a variable, its better to remove it with rm. In my case the efivarfs has been mounted by default with read/write permissions, but if you are getting the "operation not permitted" message while attempting to rm, it means that in your case efivarfs has been mounted as read-only and you need to remount it with read-write permissions and try again (credits to totoe_84 for this valuable addition) :
*) cd /
*) umount /sys/firmware/efi/efivars/
*) mount -t efivarfs rw /sys/firmware/efi/efivars/
*) cd /sys/firmware/efi/efivars/

If your screen is so distorted that it is difficult to see the letters, just start typing the rm gpu-power-pre and then press TAB key for autocompletion. In my case there were not such a EFI variable, only "gpu-active-..." and maybe somehow related "gfx-saved-config-restore-status-..." . Then I looked again at that gpu-switch text file (mentioned above, https://github.com/0xbb/gpu-switch/blob/master/gpu-switch),
and entered THESE COMMANDS:

*) chattr -i "/sys/firmware/efi/efivars/" <----- skip this command

Actually a gpu-switch script had "${sysfs_efi_vars}/${efi_gpu}" but I didnt have a "gpu-power-prefs-..." variable - so, partially by mistake, I didn't add that efi_gpu suffix and entered this incomplete path accidentally

*)
printf "\x07\x00\x00\x00\x01\x00\x00\x00" > /sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9

Did not have a EFI "gpu-power-prefs-" variable so I thought that it will be OK to create a new one with a random UUID - in this case, taken directly from a gpu-switch script

*) chattr +i "/sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9"

http://www.tecmint.com/chattr-command-examples/ - chattr (Change Attribute) is a command line Linux utility that is used to set/unset certain attributes to a file in Linux system to secure accidental deletion or modification of important files and folders, even though you are logged in as a root user.
...
Syntax of chattr ---> chattr [operator] [flags] [filename]
...
A file is set with ‘i‘ attribute (+i as you see in this command) ---> cannot be modified (immutable). Means no renaming, no symbolic link creation, no execution, no writable, only superuser can unset the attribute.
...
Operator
  1. + : Adds the attribute to the existing attribute of the files.
  2. : Removes the attribute to the existing attribute of the files.
  3. = : Keep the existing attributes that the files have.
This chattr command is supposed to lock a file to make it accessible only by "superuser" - and so that, while booting, your EFI will have no chance to screw up your gpu-power-prefs-... variable under any circumstances

*) cd /

Could not unmount efivars if you are inside this directory, so change to the root directory

*) umount /sys/firmware/efi/efivars/

Guarantees that your EFI variables are flushed to efivarfs filesystem, please unmount it safely before rebooting)

*) reboot

===> IF YOU DID EVERYTHING CORRECTLY, MOST LIKELY THAT YOUR MACBOOK PRO IS NOW USING INTEGRATED GRAPHICS WHILE BOOTING, AFTER BOOTING, AND IS WORKING GREAT AGAIN ! ;)

In the future maybe you could need to re-apply this solution if you would have to reset your PRAM / NVRAM / SMC because of some other problems, so remember this solution somewhere... Funny thing: now you can't switch to Discrete GPU even using gfxCardStatus, it is forever stuck at Integrated


I spent two working days to discover this solution, and really hope that it will work flawlessly for every MBP owner with a broken discrete GPU. Good luck!
If you don't have time to read my story (which also describes some interesting technical approaches) just scroll down this thread until a "100% WORKING SOLUTION" text

Discrete AMD GPU of my 2011 MacBook Pro 8,2 has finally failed because of the reasons mentioned here ( http://logicboardmac.blogspot.ru/ ) and there ( https://www.macrumors.com/2015/02/19/2011-macbook-pro-repair-program-apple/ ) . It has been working perfectly for 6 years under quite a high load, even tried SETI@HOME mining at background! So I was confident that my MBP is not affected by bad solder / bad soldering quality and didn't want to bring it to Apple for a free repair program - partially because couldn't find the time to pause my important software projects, partially because I was afraid that Apple might give me a less reliable logic board or refuse a free repair because of the several unrelated repairs that I did manually by myself earlier to save money: changed thermal paste a few times, replaced the internal battery 2 times, replaced a keyboard with broken buttons, etc. But it finally broke down last week: laptop's screen image became distorted, it refused to boot OS X (always freezing half-way), and - Apple free repair program has already ended! I know there are affordable solutions like $50 BGA resoldering at unofficial local repair shop and that its possible to get a new replacement HD 6750M chip from AliExpress for $35 or cheaper ( http://www.aliexpress.com/item/DC-2...0028-216-0810028-BGA-Chipset/32764872143.html or https://www.aliexpress.com/item/DC-2015-New-216-0810001-216-0810001-Graphic-Chipset/32718112928.html , because don't know if this is true - https://www.rossmanngroup.com/board...0604-replace-216-0810005-gpu-with-216-0810028 ) to guarantee a successful repair, so the total price of repair would be either $50 or $50+$35=$85 - less than $100 in any case. But I don't like investing money to the old computers, so I have thought - what if there is some hack to force MBP to use integrated graphics ALL THE TIME, even while booting ? And then started to explore the possible solutions...

===

First of all, it is possible to successfully boot a MBP to OS X while still using the failed GPU, after you remove the AMD drivers by booting in command line mode (CMD+S) and entering these commands:
1) fsck -fy (to check a disk)
2) mount -uw / (mount a root filesystem with read/write permissions)
3) sudo mkdir /AMD_Kexts/ (make a directory to store the AMD drivers in case you'll need them in future)
4) sudo mv /System/Library/Extensions/AMD*.* /AMD_Kexts/ (move the AMD drivers)
5) sudo rm -rf /System/Library/Caches/com.apple.kext.caches/ (remove the AMD drivers cache)
6) sudo mkdir /System/Library/Caches/com.apple.kext.caches/ (just in case OS X will be dumb and will not recreate this directory, I am creating it for OS X)
7) sudo touch /System/Library/Extensions/ (to update the timestamps so that new driver caches - without AMD drivers - will be definitely rebuilt)
8) sudo umount / (umount a partition to guarantee that your changes are flushed to it)
9) sudo reboot

The degree of your inconvenience while doing these steps - strongly depends on how heavily a screen's image is distorted in your case. In my case it was even more difficult because the OS X partition became a "read-only" partition (because of too many emergency shutdowns I did while desperately trying to boot OS X with a failed GPU) so I had to remove a hard drive from MacBook Pro and (using a USB to SATA 2.5" adapter taken from my portable HDD) attached it to a computer with Linux, then followed these instructions:

https://superuser.com/questions/961401/mounting-hfs-partition-on-arch-linux (1st answer) - carefully executed a number of commands, calculated a sizelimit for my parition layout, and finally ran sudo mount -t hfsplus -o force,rw,sizelimit=YOURNUMBER /dev/sdb2 /mnt to mount this HFS+ partition to /mnt directory in read-write mode. Then I performed these "1)-7)" steps you see above, and also repaired a filesystem by running sudo fsck.hfsplus -f /dev/sdb2 before unmounting a partition with sudo umount /mnt and putting a hard drive back to MBP...

===

This gave me a MBP which could boot to OS X although STILL using a broken AMD GPU: so it screen's image is very distorted (could browse the Internet but quite inconvenient to read a text), Launchpad is super laggy, and you can't switch to Integrated GPU using gfxCardStatus because: without AMD drivers (which we had to remove to successfully boot to OS X) Macbook Pro thinks its' internal screen is External Display and gfxCardStatus tells it is impossible to switch because External Display is using AMD GPU. Somewhere I found a suggestion that it is possible to rebuild a gfxCardStatus from the source code - https://github.com/codykrieger/gfxCardStatus - with removed or commented out 156-166 lines in the ./gfxCardStatus/Classes/GSProcess.m to make it to ignore the external display:

// find out if an external monitor is forcing the discrete gpu on
CGDirectDisplayID displays[8];
CGDisplayCount displayCount = 0;
if (CGGetOnlineDisplayList(8, displays, &displayCount) == noErr) {
for (int i = 0; i < displayCount; i++) {
if ( ! CGDisplayIsBuiltin(displays))
[list addObject:[NSDictionary dictionaryWithObjectsAndKeys:
Str(@"External Display"), kTaskItemName,
@"", kTaskItemPID, nil]];
}
}


So I rebuilt a gfxCardStatus using the instructions from the last reply of this issue -
https://github.com/codykrieger/gfxCardStatus/issues/229
(also had to download a MacOSX10.11.sdk from here - https://github.com/phracker/MacOSX-SDKs/releases - unpack and copy it to XCode's /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk - because of the Apple's stupidity the latest XCode for El Capitan does not include SDK for El Capitan!) However, it still didn't work - gfxCardStatus only pretended that it has switched to Integrated GPU, while in reality OS X did not let it switch! Even after I edited ./gfxCardStatus/Classes/GSGPU.m file to enable the mysterious "Nuke it from orbit switching" option, it still couldn't switch...

===

Then I discovered this interesting repository - https://github.com/0xbb/gpu-switch - which is partially similar by its' source code to gfxCardStatus but also has the "Login Hooks" (install_hooks.sh) to "automate the switching process for login/logout". Sadly it didn't work for me... However, there is a very interesting gpu-switch text file right at the root of this repository, which describes the EFI variables!

https://github.com/0xbb/gpu-switch/blob/master/gpu-switch

After studying it and also reading this issue's comments - https://github.com/0xbb/gpu-switch/issues/11 - I became confident to try this solution, but found out that my MacBook Pro 2011 8,2 with OS X El Capitan 10.11.6 is in a VERY problematic situation:

1) rEFInd is not installed, and to install it - must disable SIP protection. But I cannot boot to Recovery mode (Command+Option+R) or to OS X Installation DVD/USB (hold Option), (to disable SIP), because they freeze while booting! - although I removed AMD kexts from my system, of course these recovery tools are using AMD kexts integrated to their design. Also cannot use Rootfool hack ( https://github.com/gdbinit/rootfool ) to disable SIP during runtime, because it works only at OS X version older than 10.11.4

2) Tried overheating my Macbook Pro on purpose (forcing CPU usage to 100% and putting it to a tightly closed bag) to force it to shutdown from overheating and then quickly reboot so that Integrated graphics will be enabled during the boot time - making it possible to boot to Recovery. But because of the wonderful high end thermal paste I have applied not so long ago - cannot overheat it even after waiting for a long time! At this point I thought that could either: a) remove AMD kexts from Installation media, or b) to connect MBP's hard drive to a Linux machine again and run a bunch of chmods to remove the SIP flags from the directories mentioned here ( http://apple.stackexchange.com/questions/193368/what-is-the-rootless-feature-in-el-capitan-really ) which could potentially make a system unbootable, or c) to try installing rEFInd to HFS+ partition directly from a Linux machine with root rights because it will bypass SIP --- but have not explored these options, although some of them might have worked...

3) Wanted to boot a Linux LiveCD to edit the EFI variables from there, but no matter what I did: tried booting straight without GRUB option modifications, tried editing GRUB boot options (with "e" key) to add nomodeset / remove quiet splash / or both in every combination , or like suggested in this article ( https://wiki.archlinux.org/index.php/MacBookPro8,1/8,2/8,3_(2011) ) also add i915.modeset=0 radeon.modeset=0 or radeon.modeset=0 i915.modeset=1 i915.lvds_channel_mode=2 ; and then pressed Fn+F10 or Shift+Ctrl+Fn+F10 to boot with these options: but the Linux boot process always failed at different boot stages, no matter what popular user-friendly Linux distribution or what version of it I am trying: tried many releases of Ubuntu / Lubuntu / Fedora , even the old "AMD64 Mac" and "Alternate AMD64 Mac" images, but they always failed - either at the very beginning of boot process (black screen, or a black screen with a blinking or stuck _ character at the left upper corner) or failed at the very end of it - right before it is supposed to show a graphical desktop environment...

Later, totoe_84 wrote that he was able to boot Ubuntu in graphical mode using the following setup for GRUB:
  • To disable the AMD graphics card I added the following lines after set gfxpayload=keep
outb 0x728 1
outb 0x710 2
outb 0x740 2
outb 0x750 0
  • Next I added the following after quiet splash
    i915.lvds_channel_mode=2 i915.modeset=1 i915.lvds_use_ssc=0
(based on https://ubuntuforums.org/showthread.php?t=2157775 )

===

Then I remembered that there are not-mainstream Linux distributions for advanced users, which have a LiveCD without any graphical interface: you are dropped to a pure console and you are supposed to install the system along with only those graphical interfaces and software packages / groups of packages which you explicitly select. For example: Arch Linux (https://www.archlinux.org/) and Gentoo Linux (https://gentoo.org/) . Because their LiveCD does not have a graphical interface, they could be booted without a problem to a pure Linux console and there you could edit the EFI variables ! So here is a...

===
=== 100% WORKING SOLUTION
===
=== Force your MBP to ALWAYS use Intel integrated GPU (EFI variable fix)
===
=== to make it great again ! ;)
===


1) Create the Arch Linux LiveCD/LiveUSB :

You need a working computer for that and a spare CD/DVD/USB drive. Download the latest Arch Linux ISO image from this page - https://www.archlinux.org/download/ , at the time of writing it is archlinux-2017.03.01-dual.iso . Then you could either simply burn this ISO to CD/DVD (which later could be either inserted to MBP's SuperDrive or External DVD Drive connected to MBP by two USB cables) or create a bootable USB: use the great detailed instructions from this page, https://wiki.archlinux.org/index.php/USB_flash_installation_media

2) Boot to it: insert this CD/DVD/USB to Macbook Pro, hold Option key while booting, choose "EFI boot" (that is your bootable installation media), press "e" key to edit the GRUB options of the Arch Linux archiso x86_64 UEFI CD menu entry while it is selected at the main screen, add nomodeset to the end of this line and press Enter. If everything is done correctly, you will find yourself at the Linux console!

3) Edit EFI vars: looks like efivarfs filesystem is mounted by default! So you can already cd /sys/firmware/efi/efivars and ls to explore this directory and see if there is a "gpu-power-prefs-..." variable (where ... is UUID of this variable). If there is such a variable, its better to remove it with rm. In my case the efivarfs has been mounted by default with read/write permissions, but if you are getting the "operation not permitted" message while attempting to rm, it means that in your case efivarfs has been mounted as read-only and you need to remount it with read-write permissions and try again (credits to totoe_84 for this valuable addition) :
*) cd /
*) umount /sys/firmware/efi/efivars/
*) mount -t efivarfs rw /sys/firmware/efi/efivars/
*) cd /sys/firmware/efi/efivars/

If your screen is so distorted that it is difficult to see the letters, just start typing the rm gpu-power-pre and then press TAB key for autocompletion. In my case there were not such a EFI variable, only "gpu-active-..." and maybe somehow related "gfx-saved-config-restore-status-..." . Then I looked again at that gpu-switch text file (mentioned above, https://github.com/0xbb/gpu-switch/blob/master/gpu-switch),
and entered THESE COMMANDS:

*) chattr -i "/sys/firmware/efi/efivars/" <----- skip this command

Actually a gpu-switch script had "${sysfs_efi_vars}/${efi_gpu}" but I didnt have a "gpu-power-prefs-..." variable - so, partially by mistake, I didn't add that efi_gpu suffix and entered this incomplete path accidentally

*)
printf "\x07\x00\x00\x00\x01\x00\x00\x00" > /sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9

Did not have a EFI "gpu-power-prefs-" variable so I thought that it will be OK to create a new one with a random UUID - in this case, taken directly from a gpu-switch script

*) chattr +i "/sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9"

http://www.tecmint.com/chattr-command-examples/ - chattr (Change Attribute) is a command line Linux utility that is used to set/unset certain attributes to a file in Linux system to secure accidental deletion or modification of important files and folders, even though you are logged in as a root user.
...
Syntax of chattr ---> chattr [operator] [flags] [filename]
...
A file is set with ‘i‘ attribute (+i as you see in this command) ---> cannot be modified (immutable). Means no renaming, no symbolic link creation, no execution, no writable, only superuser can unset the attribute.
...
Operator
  1. + : Adds the attribute to the existing attribute of the files.
  2. : Removes the attribute to the existing attribute of the files.
  3. = : Keep the existing attributes that the files have.
This chattr command is supposed to lock a file to make it accessible only by "superuser" - and so that, while booting, your EFI will have no chance to screw up your gpu-power-prefs-... variable under any circumstances

*) cd /

Could not unmount efivars if you are inside this directory, so change to the root directory

*) umount /sys/firmware/efi/efivars/

Guarantees that your EFI variables are flushed to efivarfs filesystem, please unmount it safely before rebooting)

*) reboot

===> IF YOU DID EVERYTHING CORRECTLY, MOST LIKELY THAT YOUR MACBOOK PRO IS NOW USING INTEGRATED GRAPHICS WHILE BOOTING, AFTER BOOTING, AND IS WORKING GREAT AGAIN ! ;)

In the future maybe you could need to re-apply this solution if you would have to reset your PRAM / NVRAM / SMC because of some other problems, so remember this solution somewhere... Funny thing: now you can't switch to Discrete GPU even using gfxCardStatus, it is forever stuck at Integrated


I spent two working days to discover this solution, and really hope that it will work flawlessly for every MBP owner with a broken discrete GPU. Good luck!




Literally amazing, worked like a charm. Now I’m wondering how long will this intel 3000 HD last me??!!!
 

jackin6

macrumors newbie
Dec 29, 2017
4
0
So I've been doing some reading and fiddling around with a bused 2011 Macbook Pro here. Would I be right in saying that I should stick to MacOS Sierra 10.12.x instead of using High Sierra (10.13.x) due to the brightness and sleep bug? These would be rather dealbreaking for me IMO
 

pete1

macrumors regular
Feb 19, 2008
121
69
London, UK
If your gpu-power-prefs has the correct effect, then the Intel gpu driver will take over. Otherwise, the AMD gpu will be the primary gpu.

Hi nsgr,

I tried to follow all your steps. Firstly, ioreg -l does not list ActiveGPU. It does not return anything when I use the command you supplied.

Gpu-power-prefs has the correct uuid, and I tried the four nvram commands you supplied in single user mode. Upon a normal restart, all indications are that the Mac mini is using the AMD graphics in fallback mode.

Is it not possible that the Mac mini with discrete AMD graphics is different from MacBook Pros of the same era, in that it is designed only to ever use the discrete chip, and to ignore the built in Intel 3000 graphics? After all, it’s not a portable machine running on a battery, so there is no reason for it to switch to a lower power chip. That’s the impression I am getting and I’m almost ready to give up, honestly...
 

Mbpjoe

macrumors newbie
Dec 29, 2017
4
0
Followed the instructions, apprears to work, but did a NVRAM/SMC reset to try and reset graphics cache,
now boots ok, I can see the screen, but if I boot via the Linux USB and ls the /efivars directory, it comes back blank!

and in OS X Sierra, my AMD GPU is showing as "online" how can I check if the changes have all taken effect properly please?
 

pete1

macrumors regular
Feb 19, 2008
121
69
London, UK
Mbpjoe,

If you reset the NVRAM it will clear the gpu-power-prefs that you previously set up, unless of course you have set a firmware password. My understanding is that you don’t reset NVRAM unless you want to re-enable the discrete GPU as primary.

To check which GPU is primary you can boot into safe mode (hold shift at boot time) and once at the desktop open terminal and run the following command:

ioreg -l | grep -i ActiveGPU​
 
  • Like
Reactions: MrAverigeUser

MrAverigeUser

macrumors 6502a
May 20, 2015
895
397
europe
Hi There...

a friend of mine owns a rMBP (2012 retina) and told me he suffers of the main problems like the cMBP 2011/2012.
Fortunately, he is still able to start his machine (GPU-problems coming after some times, but sooner and sooner every day after start).

Question: Could he try to switch to "iGPU only" as well or does this not work with the rMBPs of 2012?

(at least this is what I think, but I am not an expert at all)

Thanks in his name in advance!

And happy new year!
 
Last edited:

amingh92

macrumors newbie
Dec 29, 2017
2
0
So I do get through to my OS but I have to keep my MacBook Pro on and hope that it won't restart as it would get stuck on the gray screen again as soon as it's shut off or restarted. Is there a way to get around this issue? @AppleMacFinder
 

Watermann

macrumors member
Dec 12, 2014
61
7
After doing what is explained on first post mac boots, but only on safe mode. As explained on this thread I had to move the radeon kext to a temp dir to make it boot normally

Not sure if this is safe or best option, because radeon is still consuming power so more heat/current used?
 

cretale

macrumors newbie
Sep 16, 2017
1
0
Skip the instructions on the first page. There is a better and easier solution posted on page 38 of this thread.
you mean post #875? It would be a huge favor you to reply, see I tried to follow the successful attemps on the thread with matching specifications of my MacBook and yours is the one of them, thanks!
 

Idgit

macrumors 6502a
Mar 14, 2004
556
183
you mean post #875? It would be a huge favor you to reply, see I tried to follow the successful attemps on the thread with matching specifications of my MacBook and yours is the one of them, thanks!

I think I used a combo of post #875 and this one from page 38 (post #947).

These steps are almost the same as those in post #947.

1. To start from a clean slate: reset SMC and PRAM/NVRAM:

Shutdown, unplug everything except power, now hold:
<leftShift>+<Ctrl>+<Opt>+<Power>

Release at the same time.

2. Now power on again and hold
<Cmd>+<Opt>+<p>+<r>

at the same time until you hear the startup chime two times, then immediately press and hold:
<Cmd>+<r>+<s>

to boot into Recovery Mode. If done correctly, you will boot to a command line (DOS-like) interface.

3. Disable dGPU on boot

type: nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00 (press ‘Enter')

4. Enable Verbose Boot Mode and Reboot:
type: nvram boot-args="-v" (press ‘Enter')

type: reboot (press ‘Enter’), then hold:
<Cmd>+<s>

to reboot into single user mode.

Again, you will reboot to a command line interface.

5. Make root partition writeable:
type: /sbin/mount -uw / (press ‘Enter')

6. Make a kext-backup directory:

type: mkdir -p /System/Library/Extensions-off (press ‘Enter')

7. Only move ONE offending kext out of the way:

type: sudo mv /System/Library/Extensions/AMDRadeonX3000.kext /System/Library/Extensions-off/ (press ‘Enter')


8. Let the system update its kextcache:

type: sudo kextcache -v 1 -m /System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mkext /System/Library/Extensions/ (press 'Enter’)

type: touch /System/Library/Extensions/

This process may take a few moments to complete. Then:

9. Turn off Verbose Boot Mode and Reboot:

type: nvram boot-args="" (press ‘Enter’)

type: sudo reboot (press ‘Enter’)

You should now be able to boot to the login screen and/or desktop. In my case, I needed to QUICKLY DO THE FOLLOWING STEP to keep my Mac from shutting down:

10. Manually load the dGPU kext (this needs to be done for power management. You are NOT re-enabling the faulty dGPU)

Open the Terminal and type: sudo kextload /System/Library/Extensions-off/AMDRadeonX3000.kext (press ‘Enter’)


11. Now follow the rest of MikeyN’s guide:

Automate this with the following LoginHook

sudo mkdir -p /Library/LoginHook

sudo nano /Library/LoginHook/LoadX3000.sh

with the following content:


#!/bin/bash

kextload /System/Library/Extensions-off/AMDRadeonX3000.kext

exit 0


Hit Control-X to exit nano. Select "Yes" (or y) to save changes to the file, and hit Return/Enter. Confirm that the file "LoadX3000.sh" was created in /Library/LoginHook.


then make it executable and active:

sudo chmod a+x /Library/LoginHook/LoadX3000.sh

sudo defaults write com.apple.loginwindow LoginHook /Library/LoginHook/LoadX3000.sh


Preventive measures for future use

There are two further caveats to know: This is reversible when the SMC/PRAM/NVRAM is reset. If that happens the GPU-power-pref nvram can/has to be set again to force the use of the iGPU from boot-time.

Since this can happen quite easily (and is often erroneously recommended way too many times than it is actually useful), you should probably prepare for such a scenario and create a simple script to greatly speed up the process and also make entering the necessary variable much less error prone:

sudo nano /force-iGPU-boot.sh

– Enter the following content to this file:

#/bin/sh

sudo nvram boot-args="-v"

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

exit 0


– Now make that executable:

sudo chmod a+x /force-iGPU-boot.sh

In the future, when the SMC/PRAM/NVRAM gets reset to default values it is now possible to boot into SingleUser with:

<Cmd>+<s>

– And after mounting your boot-volume read-write to execute just:

sh /force-iGPU-boot.sh​
 
Last edited:
  • Like
Reactions: hdn.hrt and cretale

nsgr

macrumors 6502
May 22, 2017
317
117
Hi nsgr,

I tried to follow all your steps. Firstly, ioreg -l does not list ActiveGPU. It does not return anything when I use the command you supplied.

Gpu-power-prefs has the correct uuid, and I tried the four nvram commands you supplied in single user mode. Upon a normal restart, all indications are that the Mac mini is using the AMD graphics in fallback mode.

Is it not possible that the Mac mini with discrete AMD graphics is different from MacBook Pros of the same era, in that it is designed only to ever use the discrete chip, and to ignore the built in Intel 3000 graphics? After all, it’s not a portable machine running on a battery, so there is no reason for it to switch to a lower power chip. That’s the impression I am getting and I’m almost ready to give up, honestly...

I do not know how the Mac Mini was made to be connected to the GPU via the HDMI port or Thunderbolt.

In Macbook Pro 2011 is made by Thunderbolt because it does not have the HDMI port. It is done automatically when you connect an external display on the Thunderbolt (Thunderbolt wired to AMD GPU).

Macbook Pro 2011 -> connect Thunderbolt port to external display -> switch automatic to AMD GPU.

Second solution Macbook Pro 2011 -> connect USB adapter to external display -> gpu-power-prefs to Intel GPU works.

On the Mac Mini you have the extra HDMI option. It would be a big engineering design error if Apple wired HDMI and Thunderbolt to AMD GPU.
You would detonate two ports (HDMI and Thunderbolt) in case the AMD GPU failed.

Did you test with the Thunderbolt port connected to the external display and also test with the HDMI port connected to the external display? Or you tested only in Thunderbolt port?




Apple Technician Guide - Mac mini (Mid 2010) - Page 16 - Mac mini 2010 - Thunderbolt and HDMI connected to TMDS0

http://tim.id.au/laptops/apple/macmini/mac_mini_mid_2010.pdf

https://www.manualslib.com/manual/370457/Apple-Mc408ll-Mac-Mini-Snow-Leopard-Server.html?page=16

MacBook Pro: How to determine which graphics processor is in use:
https://support.apple.com/en-au/HT202053

or

Terminal -> system_profiler SPDisplaysDataType

Intel GPU -> Displays -> Online: Yes
Code:
system_profiler SPDisplaysDataType
Graphics/Displays:
    Intel HD Graphics 3000:
      Chipset Model: Intel HD Graphics 3000
      Type: GPU
      Bus: Built-In
      VRAM (Dynamic, Max): 512 MB
      Vendor: Intel
      Device ID: 0x0126
      Revision ID: 0x0009
      Automatic Graphics Switching: Supported
      gMux Version: 1.9.23
      Displays:
        Color LCD:
          Display Type: LCD
          Resolution: 1440 x 900
          Framebuffer Depth: 24-Bit Color (ARGB8888)
          Main Display: Yes
          Mirror: Off
          Online: Yes
          Rotation: Supported
          Automatically Adjust Brightness: No
    AMD Radeon HD 6750M:
      Chipset Model: AMD Radeon HD 6750M
      Type: GPU
      Bus: PCIe
      PCIe Lane Width: x8
      VRAM (Total): 1 GB
      Vendor: AMD (0x1002)
      Device ID: 0x6741
      Revision ID: 0x0000
      ROM Revision: 113-C0170L-573
      VBIOS Version: 113-C0170K-007
      EFI Driver Version: 01.00.573
      Automatic Graphics Switching: Supported
      gMux Version: 1.9.23
 
Last edited:

Mbpjoe

macrumors newbie
Dec 29, 2017
4
0
I do not know how the Mac Mini was made to be connected to the GPU via the HDMI port or Thunderbolt.

In Macbook Pro 2011 is made by Thunderbolt because it does not have the HDMI port. It is done automatically when you connect an external display on the Thunderbolt (Thunderbolt wired to AMD GPU).

Macbook Pro 2011 -> connect Thunderbolt port to external display -> switch automatic to AMD GPU.

Second solution Macbook Pro 2011 -> connect USB adapter to external display -> gpu-power-prefs to Intel GPU works.

On the Mac Mini you have the extra HDMI option. It would be a big engineering design error if Apple wired HDMI and Thunderbolt to AMD GPU.
You would detonate two ports (HDMI and Thunderbolt) in case the AMD GPU failed.

Did you test with the Thunderbolt port connected to the external display and also test with the HDMI port connected to the external display? Or you tested only in Thunderbolt port?




Apple Technician Guide - Mac mini (Mid 2010) - Page 16 - Mac mini 2010 - Thunderbolt and HDMI connected to TMDS0

http://tim.id.au/laptops/apple/macmini/mac_mini_mid_2010.pdf

https://www.manualslib.com/manual/370457/Apple-Mc408ll-Mac-Mini-Snow-Leopard-Server.html?page=16

MacBook Pro: How to determine which graphics processor is in use:
https://support.apple.com/en-au/HT202053

or

Terminal -> system_profiler SPDisplaysDataType

Intel GPU -> Displays -> Online: Yes
Code:
system_profiler SPDisplaysDataType
Graphics/Displays:
    Intel HD Graphics 3000:
      Chipset Model: Intel HD Graphics 3000
      Type: GPU
      Bus: Built-In
      VRAM (Dynamic, Max): 512 MB
      Vendor: Intel
      Device ID: 0x0126
      Revision ID: 0x0009
      Automatic Graphics Switching: Supported
      gMux Version: 1.9.23
      Displays:
        Color LCD:
          Display Type: LCD
          Resolution: 1440 x 900
          Framebuffer Depth: 24-Bit Color (ARGB8888)
          Main Display: Yes
          Mirror: Off
          Online: Yes
          Rotation: Supported
          Automatically Adjust Brightness: No
    AMD Radeon HD 6750M:
      Chipset Model: AMD Radeon HD 6750M
      Type: GPU
      Bus: PCIe
      PCIe Lane Width: x8
      VRAM (Total): 1 GB
      Vendor: AMD (0x1002)
      Device ID: 0x6741
      Revision ID: 0x0000
      ROM Revision: 113-C0170L-573
      VBIOS Version: 113-C0170K-007
      EFI Driver Version: 01.00.573
      Automatic Graphics Switching: Supported
      gMux Version: 1.9.23

Tried the terminal command above to determine what GPU was being used, and shows AMD Radeon as "Main Display",
I presume that means my 2011 MBP is still using the AMD GPU as default in spite of the GPU-Powerprefs solution being implemented.


Anyone else have a similar problem, I find when the machine goes to sleep mode my screen saver pics don't load and black screen with 'red snow' instead and text "loading pictures" which it never does.

Shall I try and redo the entire procedure? Maybe I missed something, not very handy with terminal commands

By the way the ArchLinux USB boot seemed to work perfectly

thanks
Joseph
 

xanderx007

macrumors 6502
Nov 7, 2017
262
140
Typing chattr gives an command not found error...

I'm not sure if you've already figured this out, but, you're supposed to skip the chattr -i command, since you don't have any existing prefs when you zap the NVRAM/PRAM.

Screen Shot 2018-01-03 at 01.26.30.png

So I've been doing some reading and fiddling around with a bused 2011 Macbook Pro here. Would I be right in saying that I should stick to MacOS Sierra 10.12.x instead of using High Sierra (10.13.x) due to the brightness and sleep bug? These would be rather dealbreaking for me IMO

There's no distinct advantages of upgrading to High Sierra, so, sticking with Sierra for the moment is best. Personally, I'm still on Yosemite, since the apps I use do not require later OS X versions.
 

nsgr

macrumors 6502
May 22, 2017
317
117
Tried the terminal command above to determine what GPU was being used, and shows AMD Radeon as "Main Display",
I presume that means my 2011 MBP is still using the AMD GPU as default in spite of the GPU-Powerprefs solution being implemented.


Anyone else have a similar problem, I find when the machine goes to sleep mode my screen saver pics don't load and black screen with 'red snow' instead and text "loading pictures" which it never does.

Shall I try and redo the entire procedure? Maybe I missed something, not very handy with terminal commands

By the way the ArchLinux USB boot seemed to work perfectly

thanks
Joseph


Have you tested this command in Single User Mode (Command + S -> at boot)?

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

woolooo

macrumors newbie
May 19, 2011
3
1
Hello,
Thanks to the community, I was able to do the fix months ago and it has been working great, even if I don't use this macbook much anymore (I have a newer one and a hackintosh that I both work with).

I am running 10.12.1 and I am considering updating to 10.12.6 : Is this a good idea ? Do I risk to have to do it all over again ? Because it wasn't easy with the screen being very very distorted it took me a while to go through all the steps.

I was also wondering if there is a way to get the Video Out working again ?

THanks,
 

Mbpjoe

macrumors newbie
Dec 29, 2017
4
0
Have you tested this command in Single User Mode (Command + S -> at boot)?

sudo nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00
Hi there NSGR
I followed your advice and after few false starts everything seems to be working fine now,
Thanks very much to everyone who contributed to this thread, its an incredible service you've done us all!
I know our 2011 MBP's are 'vintage' to quote my local Apple Store, and will need replacing, but this fix buys me a few months ( I guess) to look around and find a replacement under the RRP f about AU$4,000. Which is just crazy for a laptop (no matter how much I love Mac).

As a note, I did the various bits of the fix over about a 2 week period, and had to redo some since I reset the NVRAM etc at least once, but now as I say all good and amazed at what can be done if one only knows how :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.