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.

sodbileg

macrumors newbie
May 23, 2017
4
6
First of all, thank you so much for your detailed instruction. I've used my MBP Early 2011 for about 6 years now and haven't experienced the black screen/red screen/screen flickering before. However, when I opened Photoshop and started doing something, the screen started to become messy and the system froze completely. Then it happened severel times since yesterday. So I started to look for a solution and found this useful discussion.

I did everything successfully. However, when I open Photoshop, the system froze completely while Photoshop was on startup screen. Is it supposed to be like this? Can Photoshop work on iGPU even if its performance is poor?
 
  • Like
Reactions: AppleMacFinder

Shug Ninx

macrumors newbie
May 22, 2017
3
3
I do not know how much you know how to use the terminal on Linux (your level of experience in Linux).

What is your experience with Terminal in Linux? Novice or experienced?

Many people are missing the spaces between the commands and also in the " versus double '.

In this tutorial is used -> press SHIFT key + " -> On the US keyboard, is next to the Enter / Return key.

http://switchtoamac.com/images/hardware/macs/macbookpro/late_2008_mbp_keyboard.png

Hello !

I use the terminal on a daily basis, but with much simpler commands (i.e not involving quotes or specific back quotes and such).

And again, the printf command does produces a non empty file when output to /root instead of /sys/firmware/efi/efivars/, without any error message.
Trying printf, mv or cp to /sys/firmware/efi/efivars/ produces a write error and a 0B file.
Seems like specific write access on that folder, but I'm very bad in that field ;-)

Edit : after a little digging, I found this interesting thread. Apparently some Macs (MBP6,2 and also 5,4) cause this very specific trouble when trying to write to /sys/firmware/efi/efivars/. I posted another help request at github on this very same thread, let's see if we can find a workaround.

Edit2 : started a new issue thread here, as the previous one is closed.
 
Last edited:
  • Like
Reactions: AppleMacFinder

FreddyM

macrumors newbie
May 23, 2017
1
1
Looks like some are having difficulty running certain applications when the dGPU is disabled? Saw the one above about Photoshop, and saw another about Apple Photos app crashing as well. Do the applications that would rather use the dGPU crash if the dGPU is disabled with this fix? That would be strange as those same apps work well with machines that only have the integrated GPU.
 
Last edited:
  • Like
Reactions: AppleMacFinder

flownorth

macrumors newbie
May 23, 2017
2
1
Hi everyone, first I want to thanks all of you to try so hard to fix the ****** mbp 2011.
I got my issue solved, huge thanks to AppleMacFinder and FGuarini, you guys are amazing!
 
Last edited:
  • Like
Reactions: AppleMacFinder

sodbileg

macrumors newbie
May 23, 2017
4
6
Fix for 17 inch dGPU switch issue

(Tested successfully in both “early” and “late” 2011 17 inch MacBook Pro)



This guide is based on the experience of many users (including me) while trying to fix the very well known issue with AMD dGPU on 17’’ MacBook Pro from 2011 (both early and late):



Step 0) As a starting point I made a clean installation of Sierra (Version 10.12.4) — This is just a step for establishing a common middle ground and is not really needed….

0.1) To do this just download the installer from the App Store and then use “DiskMaker X” to create a bootable installation.

0.2) After the bootable image is created, proceed to turn off your computer and hold the “Alt” or “Options” Key. Select the Sierra installer and proceed with the installation (I format the HDD partition to make a clean install on it)



Note: You might need to do this on another computer. Just buy one of those cheap usb to sata connectors and use it to connect it to another Mac so you don’t risk having your installation failed because of your machine.



Step 1) Prepare a Bootable USB pendrive with a non GUI Linux (Credits to AppleMacFinder)



1.1) Download ArchLinux ISO

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



1.2) Creating the bootable USB with the .iso:

In macOS

First, you need to identify the USB device. Open /Applications/Utilities/Terminal and list all storage devices with the command:

*) diskutil list


Your USB device will appear as something like /dev/disk2 (external, physical). Verify that this is the device you want to erase by checking its name and size and then use its identifier for the commands below instead of /dev/diskX.

A USB device is normally auto-mounted in macOS, and you have to unmount (not eject) it before block-writing to it with dd. In Terminal, do:

*) diskutil unmountDisk /dev/diskX


Now copy the ISO image file to the device. The dd command is similar to its Linux counterpart, but notice the 'r' before 'disk' for raw mode which makes the transfer much faster:

*) sudo dd if=path/to/arch.iso of=/dev/rdiskX bs=1m

After completion, macOS may complain that "The disk you inserted was not readable by this computer". Select 'Ignore'. The USB device will be bootable.


Step 2) Boot to Linux (Credits to AppleMacFinder):

2.1) 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! (It takes some time so be patient and wait for the prompt)


2.2) 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).


2.2-Case 1:

If there is such a variable, its better to remove it with rm.

*) rm gpu-power-prefs-…


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) (Try this and then try to remove it):

*) cd /

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

*) mount -t efivarfs rw /sys/firmware/efi/efivars/

*) cd /sys/firmware/efi/efivars/

*) rm gpu-power-prefs-…


If this also fails (If you still can’t erase the file) use chattr command to disable file immutability and then erase the file:

*) chattr -i "/sys/firmware/efi/efivars/gpu-power-prefs-…”

*) cd /sys/firmware/efi/efivars/

*) rm gpu-power-prefs-…


2.2-Case 2:

The file gpu-power-prefs-… doesn’t exist well then you don’t have to delete it hahaha. (I repaired 2 17 inch models and 1 didn’t have it, so it’s fine)


2.3) Create a new gpu-power-prefs-… file (Original credit mentioned above, https://github.com/0xbb/gpu-switch/blob/master/gpu-switch, Credits to AppleMacFinder):

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


2.4) Add immutability to the gpu-power-prefs-… file (Credits to AppleMacFinder):

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


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


2.5) Unmount efivars and reboot (Credits to AppleMacFinder):

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

*) cd /

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

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

*) reboot


3) Eliminate AMD Kexts (Credits to newfield),
Note: You might need to do this every time you do an OS updates, since each update normally writes the AMD Kexts again.


(His words and this also happened to me!: After disabling the dGPU using Arch, normal boot would hang halfway. Although safe boot would work. I wound up having to remove all the AMD kext files in the Terminal in Recovery Console)


Trying to remove them in Single User just gave me sandbox errors. (Summary -> Don’t do it in Single User Mode the one that you boot with Cmd + S)


3.1) So what you have to do is:

If you have FileVault Unlock it first:

Unlock first.

Then Boot into Recovery (“cmd + r”, it will boot without failing, if it fails then repeat step 2 and then after that boot directly into recovery with command + R, I had to do this once because the dGPU got active again after booting into the os with AMD kexts)

*) Boot into recovery mode (Command + r)

*) Start Terminal

*) diskutil cs list (find UUID for drive)

*) diskutil coreStorage unlockVolume UUID

*) cd /Volumes/Macintosh\ HD

*) mkdir AMD_Kexts

*) mv System/Library/Extensions/AMD*.* AMD_Kexts/

*) reboot



(If you only have one storage with 1 partition just use "cd /Volumes/Macintosh\ HD" and the remaining commands after starting the terminal)


Extra STEP), if your PC is now working! Download “steveschow” branch of gfxCardStatus (gfxCardStatus v2.4.3i) or just download the app directly from:

URLS:

https://github.com/steveschow/gfxCardStatus/releases

https://github.com/steveschow/gfxCardStatus

With this application you can even prove that the dedicated GPU can't get activated. Even if you try to change the selected GPU to the dedicated one, it just won't change.


—————

The End!

AND VOILA!!! You have a working 17 inch MacBook Pro. As I said I tested this with an early 2011 and late 2011 17 inch MacBook Pro’s and both are now running (Before they were both dead)


Big thanks to AppleMacFinder, to the makers and contributors of this thread, to gfxCardStatus maker and forkers :D (steveschow) and to switch-gpu makers I can’t thank you guys enough as I am so happy to bring both of this incredible machines back to life. With this post I am not trying to take any credit, but as I had 2 machines I run into different issues with both, which could be helpful to others, thats why I was inclined to make “my own” guide and share it with you.


I just created an account here to share this, Hope it helps more people!

I can confirm that this solution works. AppleMacFinder and FGuarini, you guys ROCK!
My computer was going back to the problematic situation after a reboot even if I did all the steps successfully. After removing the kexts as above, it's not going back even after a reboot.

Now I installed the steveschow branch of gfxCardStatus, however, I'm too afraid to click on "Discrete Only", because I just spent too much time for getting it working. Thank you so much guys.
 

m_piet

macrumors newbie
May 24, 2017
4
3
Yes!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I had no idea that there was a recall due to these GPU issues and of course, by the time mine had failed, the offer to fix it from Apple was no longer available. You just saved me about $500!

Thank you so very much!
--
Marty
 
  • Like
Reactions: AppleMacFinder

m_piet

macrumors newbie
May 24, 2017
4
3
Follow-up:

If I power down and re-boot, then I get the WSOD (White Screen Of Death) again and I have to re-perform all steps after deleting the gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9 file. Further, I see that there are two other gpu-* files that get created and I wonder if they are the reason for the WSOD.

Has anybody else had this power-down/power-up issue?
--
Marty
 
  • Like
Reactions: AppleMacFinder

sodbileg

macrumors newbie
May 23, 2017
4
6
Follow-up:

If I power down and re-boot, then I get the WSOD (White Screen Of Death) again and I have to re-perform all steps after deleting the gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9 file. Further, I see that there are two other gpu-* files that get created and I wonder if they are the reason for the WSOD.

Has anybody else had this power-down/power-up issue?
--
Marty

You only need to remove gpu-power-prefs-... file. The other two should remain as they are. Mine was reverting back to dGPU after power/reboot. I followed these steps exactly and there is no more issue.

https://forums.macrumors.com/thread...efi-variable-fix.2037591/page-5#post-24511780
[doublepost=1495704043][/doublepost]
Looks like some are having difficulty running certain applications when the dGPU is disabled? Saw the one above about Photoshop, and saw another about Apple Photos app crashing as well. Do the applications that would rather use the dGPU crash if the dGPU is disabled with this fix? That would be strange as those same apps work well with machines that only have the integrated GPU.
Photoshop is working fine now. Followed these steps. https://forums.macrumors.com/thread...efi-variable-fix.2037591/page-5#post-24511780
 

m_piet

macrumors newbie
May 24, 2017
4
3
You only need to remove gpu-power-prefs-... file. The other two should remain as they are. Mine was reverting back to dGPU after power/reboot. I followed these steps exactly and there is no more issue.

https://forums.macrumors.com/thread...efi-variable-fix.2037591/page-5#post-24511780
[doublepost=1495704043][/doublepost]
Photoshop is working fine now. Followed these steps. https://forums.macrumors.com/thread...efi-variable-fix.2037591/page-5#post-24511780

Thank you! I will try the extra steps and see how it goes.
--
Marty
 
  • Like
Reactions: AppleMacFinder

Gosa

macrumors newbie
May 25, 2017
1
1
Hi,

I can't believe this actually worked!!! Thank you very much!!!!!
I've tried everything and I was about to give up.
I saw a youtube video pointing to this thread and I did the last part: 100% WORKING SOLUTION

This seemed to work for my Macbook Pro Late 2011
I didn't have "gpu-power-prefs..." so I skipped that part and continued.


One question though, how can I revert to how it was before (so that the horizontal lines are visible again). I know this might sound strange but I want to be able to prove on my work that there is indeed a problem. I don't mind doing the steps again afterwards.

Thanks again

Gosa
 
  • Like
Reactions: AppleMacFinder

Gfast2

macrumors newbie
May 26, 2017
2
2
Triple CHECK if your SD Card get read correctely by your Card-Reader!!!
####
Hi AppleMacFinder,
I just registe this Forum to thank you specifically!!! It work on my early 2011 15 MBP just fine! ;)
####
Not like others, My own story is more about hardware issues during this process introduced by AppleMacFinder:
I used a "SanDisk 16GB Extrem" (45MB/s, SD HC) Full size SD card as the media for Archlinux.
I burn the Archlinux (2017.05.01) with Win32DiskImager
I used the built-in SD-card-reader on my Macbook Pro
...
I spend about 5 hour to figure it out that the Archlinux get bootet not correctly. (newbie for Archlinux) -> I can't use command chattr, But other command like umount, ls seems works as they should.
The key difference (the most simplest way) is: If your Archlinux booted properly, you'll have a colored GUI, if not, you won't have any color stuff at all.
###
You guys just awesome! All apple user should united together in order to make apple Great Again!:):apple:
 
  • Like
Reactions: AppleMacFinder

blueman2

macrumors newbie
May 26, 2017
2
2
SFO
Another happy customer here!!! Fixed a late 2011 17" MBP that had become totally unusable due to GPU problem. This fix worked!!! First time I did not delete the kext files due to not seeing that final step. It somehow re-enabled dGPU mode so did not work. On second attempt, I followed the directions exactly including moving the AMD kexts and it works!! Confirmed it with steveschow's gfxCardStatus and sure enough it stays in integrated mode at all times! Thank you SOOOOOO much for this fix.
 
  • Like
Reactions: AppleMacFinder

Gfast2

macrumors newbie
May 26, 2017
2
2
Then Boot into Recovery (“cmd + r”, it will boot without failing, if it fails then repeat step 2 and then after that boot directly into recovery with command + R, I had to do this once because the dGPU got active again after booting into the os with AMD kexts)

1) Boot into recovery mode (Command + r)
2) Start Terminal
3) diskutil cs list (find UUID for drive)
4) diskutil coreStorage unlockVolume UUID
5) cd /Volumes/Macintosh\ HD
6) mkdir AMD_Kexts
7) mv System/Library/Extensions/AMD*.* AMD_Kexts/
8) reboot
Hi FGuarini, That survive me another time from this topic!!!
But on my computer on step 5 above:
Because I have another Harddisk that I built into the place where the DVD were. So the path on this step is something like:
cd /Volumes/ssd250g
ps:
I'm not 100% sure this name is created by apple. But it's a 250GB SSD.
 
  • Like
Reactions: AppleMacFinder

AppleMacFinder

macrumors 6502a
Original poster
Dec 7, 2009
796
152
Update - Done another 10+ reboots this morning and still ok. :):):)
Very happy to hear your final success! ;)

Last thing for now. Is there any notible performance change. It is not used for gaming at all. It's main need is for professional music recording with apps like ProTools and Reason

It depends on whether these professional tools could use GPU features such as OpenCL to accelerate the music/video transcoding. If they could use - and now they can't because of integrated GPU - you are losing some performance. If they can't use - the performance should stay the same as before

Should I re-installed gfxCardstatus to test the fix because the AMD kexts have been moved? I kinda think there is no point????

The only point of gfxCardstatus installation is to verify that fix went 100% successful - that you can't switch to discrete graphics even if you try to do it on purpose

Also up to what year model do you think this fix would work? There are MBPs up to mid 2015 that are dual graphics models. Who knows maybe they will start playing up soon. I would rather have one of them than the latest models. Don't like the limited "built in" ports that they come with now and preformace of the new ones are not any better than those i7 2015 models.
(and they cost an arm and a leg now) - anyway each to there own.

Theoretically this fix should work with any MBP which has integrated+discrete graphics combination, because it does not rely on any MBP-2011-specific hardware/software thing. But you can't be completely sure before you try ;)

here's a link from Apple.com that may be useful:

About EFI and SMC firmware updates for Intel-based Mac computers
This article lists firmware updates available as standalone installers for Intel-based Mac computers.

https://support.apple.com/en-us/HT201518

Thanks for a link, although its usefullness is limited because the last EFI firmware update for MBP 2011 has been years ago and almost everyone should be running the latest version of it

Fail
  • MacBook Pro hangs everytime I tried to open Photos app
This could be fixed if you reset the Photos app plist. Maybe this app has detected during its' first launch that your MBP has the discrete graphics, so this app is trying to enable the GPU acceleration feature like OpenCL - earlier it worked but now doesn't work so it hangs, but if you reset a plist it might force Photos to re-evaluate your hardware, don't enable the GPU acceleration and so the problem could be fixed

What is the probability of having the same UUID (this tutorial)? I suppose it's not a random UUID.

This UUID numbering would not be pre-configured? If you use a different UUID may not work (Macbook Pro Early 2011).

Has anyone tested with a different UUID numbering and worked (Macbook Pro Early 2011)?

gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9

This UUID number seems to be universal - I believe that it could work with any MBP out there. I also think that maybe there are some other UUID numbers that could be used instead of that "universal UUID number" given above - but please note that not every UUID number can work there. As you could see from this thread, one person has accidentally tried -fa4ce28d-b62f-4c99-9cc3-6815686e30fg instead of -fa4ce28d-b62f-4c99-9cc3-6815686e30f9 and the fix didn't work - probably because UUID number can't be 100% random and should meet some constraints

Have you tried using this procedure in the Info.plist file? It's inside Software.app :

Example Firefox:

Finder -> Folder Applications -> Right-click on Firefox.app -> Show Package Contents -> Contents -> Info.plist
Firefox 53.0.2 (64-bit) - NSSupportsAutomaticGraphicsSwitching already exists in the Info.plist.

Google Chrome 58.0.3029.110 (64-bit) - NSSupportsAutomaticGraphicsSwitching already exists in the Info.plist.

VLC 2.2.5.1 Umbrella (Intel 64bit) - Different structure of Info.list.
It's not like:
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>

QuickTime Player 10.4 (894.12) - There is no NSSupportsAutomaticGraphicsSwitching in Info.plist

Thanks for this interesting note. Don't worry, NSSupportsAutomaticGraphicsSwitching directive does not work anymore because this EFI variable fix is stronger. Even gfxCardStatus couldn't switch to discrete if this fix is applied properly! So you don't need to spend time to remove NSSupportsAutomaticGraphicsSwitching from the every plist out there ;)
In addition, I don't think this would have gotten fixed for free without it being just out of the repair window. If you have a early 2011 or late 2010 with this happening, you are better off buying a new logic board off of ebay for cheap (in comparison to Apple, who wanted upwards of $700 to fix this problem) and doing it yourself. I found them on ebay for around $250 for well-reviewed ones

Please note that the "Apple's solution" is to replace a faulty logic board with another faulty logic board which will still fail but later... It is only delaying the inevitable, so you better bookmark this thread :eek: The only real hardware solution is to either do BGA reball of your existing GPU - with high quality lead solder - or to replace the existing GPU completely with a new one. You could get a replacement BGA GPU chip from China for like $30-$35 but its very difficult to do BGA repairs at home and you better bring it to unofficial repair store which will charge around $50 for their service

I did everything successfully. However, when I open Photoshop, the system froze completely while Photoshop was on startup screen. Is it supposed to be like this? Can Photoshop work on iGPU even if its performance is poor?

Of course the Photoshop could work on iGPU, just its' GPU acceleration features such as OpenCL will be disabled - so its' image rendering will be slower. I see from your later post - a problem was that initially you didn't perform the fix completely, forgot to remove the AMD kexts. Very happy that it works for you now :)

Edit : after a little digging, I found this interesting thread. Apparently some Macs (MBP6,2 and also 5,4) cause this very specific trouble when trying to write to /sys/firmware/efi/efivars/. I posted another help request at github on this very same thread, let's see if we can find a workaround.

Edit2 : started a new issue thread here, as the previous one is closed.

The people in this thread - already had success in resolving this EFI variable write permission issue. MBP 2011 is 8,1 / 8,2 / 8,3 so even if "MBP 6,2 and also 5,4" have this EFI writing issue - it doesn't affect us. Please try resetting PRAM / NVRAM / SMC and especially looking through the previous pages of this thread, it contains a lot of helpful notes that could help to fix your problem

Looks like some are having difficulty running certain applications when the dGPU is disabled? Saw the one above about Photoshop, and saw another about Apple Photos app crashing as well. Do the applications that would rather use the dGPU crash if the dGPU is disabled with this fix? That would be strange as those same apps work well with machines that only have the integrated GPU.

If this "EFI variable fix" is applied 100% completely, including that AMD kexts are removed, then you could launch any apps without a problem. Moreover, you should be able to launch any relatively modern operating system without a problem, if the installation media of that OS supports the computers with EFI

How can I revert to how it was before (so that the horizontal lines are visible again). I know this might sound strange but I want to be able to prove on my work that there is indeed a problem. I don't mind doing the steps again afterwards

You could do the following:

According to https://github.com/0xbb/gpu-switch/blob/master/gpu-switch , you will be able to restore the original settings: by removing this EFI variable and creating it again with \x07\x00\x00\x00\x00\x00\x00\x00 value instead of \x07\x00\x00\x00\x01\x00\x00\x00 value. Alternatively you could just remove this variable and see what happens

A lot of answers have been already given at this thread. Wish the people could quickly look through this thread before asking new questions :cool:

Triple CHECK if your SD Card get read correctly by your Card-Reader!!!

Don't know why, but I never had any success at booting the Linux live installation media from SD cards :D So I'm writing those Linux LiveCDs (also called as LiveUSBs) either to CD / DVD or to USB flash drive

Hi FGuarini, That survive me another time from this topic!!!
But on my computer on step 5 above:
Because I have another Harddisk that I built into the place where the DVD were. So the path on this step is something like:
cd /Volumes/ssd250g
ps:
I'm not 100% sure this name is created by apple. But it's a 250GB SSD.
This "ssd250g" name is a title of partition which also determines its preferable mount point. It could be changed if you don't like the current name
 
Last edited:

m_piet

macrumors newbie
May 24, 2017
4
3
Thank you! I will try the extra steps and see how it goes.

Followup...

You guys are the best!

After following the steps to move the AMD kexts files, I can reboot without having to re-apply the gpu* patch.

Absolutely thrilled with this.

Thank you all so very much! :)
--
Marty
 

anrelph

macrumors newbie
May 28, 2017
1
1
===
=== 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
+ : Adds the attribute to the existing attribute of the files.
: Removes the attribute to the existing attribute of the files.
= : 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![/QUOTE]




Hey AppleMacFinder,

I followed your instructions as best as I could but I'm not very savvy with coding or anything and I'm pretty sure I'm doing something wrong after step 2. I get to a red screen which I think is the linux console, but I honestly am not sure how to put in commands after that. I bought my MacBook last year and didn't have a problem with the graphics card until a couple weeks ago. Is there a video that would show me how to follow these instructions or something? Any help would be appreciated.

Thanks


also, sorry, idk how to post stuff to show its from you
[doublepost=1495960511][/doublepost]^update^

messed with the instructions for awhile and my macbook is working now. thanks AppleMacFinder for the instructions
 
Last edited:
  • Like
Reactions: AppleMacFinder

nsgr

macrumors 6502
May 22, 2017
317
117
Macbook Pro Early 2011 - Intel HD 3000 and AMD Radeon HD 6750M - Mac OS Sierra 10.12.5

Some people are not able to load Arch Linux correctly, so I decided to write this information.
I'm still testing.

I had to clear NVRAM (Option + Command + P + R) and the gpu-power-prefs setting was cleared from efivars.

No problem, Now I know how to do it (efivars modification in ArchLinux).

But I'm having a temperature rise problem of 20 degrees Celsius. This I resolve after investigating gpu-policy.

In short, I researched some information (AppleMacFinder, FGuarani, gmux-scripts, gpu-switch) again and fell into a Wikileaks page with the nvram variables after searching gpu-policy and boot-args = "argc = 1" on Google.

I had tried without success the famous sudo nvram gpu-power-prefs=%01%00%00%00 .

Now I have discovered that there is a way to do this. And it is not listed later in nvram -p .

Format:

sudo nvram GUID:NVRAM_Variable=value

GUID - Standard Apple Macbook Pro Early 2011-> fa4ce28d-b62f-4c99-9cc3-6815686e30f9

NVRAM Variable -> gpu-power-prefs

Value for Integrated gpu - In this case Binary data Hexadecimal (%) -> %01%00%00%00

Test: Single-User mode (Command + S) with red background screen and white stripes.


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


After the reboot, the screen became normal again.


Setting NVRAM Variables from OS X - Wikileaks
Example: DriverOrder

sudo nvram 8BE4DF61-93CA-11D2-AA0D-00E098032B8C:DriverOrder=%00%50

https://wikileaks.org/ciav7p1/cms/page_26968084.html

http://www.insanelymac.com/forum/topic/291655-ozmosis/page-3

https://github.com/erikberglund/AppleNVRAM

https://github.com/gdbinit/firmware_vault

gmux-scripts - user Sprin commented on Dec 25, 2014
https://github.com/ah-/gmux-scripts/issues/1#issuecomment-68113930

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

nvram-dump
https://github.com/ah-/nvram-dump/blob/master/nvram-dump.m

dmpstore - Variables EFI

http://en.community.dell.com/techcenter/os-applications/f/4457/t/19589262

https://forums.macrumors.com/thread...o-bios-emulation.696523/page-42#post-20529412

http://www.sysadminshare.com/2012/01/efi-shell-commands.html


Update from the future ( 11 july 2017) :


This procedure remains until Reset NVRAM / PRAM (Option + Command + P + R) .

My test on Macbook Pro Early 2011:

One week of reboots and shutdowns and the configuration remains active and running correctly (gpu-power-prefs -> Intel video card)

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

 
Last edited:

matbert

macrumors newbie
May 28, 2017
2
2
Hello,

I am having a hard time figuring out if it worked or not for me. Basically, I would not be able to switch back to the AMD card right? I have gfxcardstatus, and I still can switch discrete (AMD).

I have El capitan, got the "gpu-power-prefs-..." variable by default and did the following :

1. cd/sys/firmware/efi/efivars then LS to confirm the presence of the gpu-power-prefs

2. umount /sys/firmware/efi/efivars/

3. mount –t efivarfs rw /sys/firmware/efi/efivars/

4. chattr -i /sys/firmware/efi/efivars/gpu-power-prefs-[press TAB to autocomplete]

5. rm /sys/firmware/efi/efivars/gpu-power-prefs-[press TAB to autocomplete]

6. cd /

7. umount /sys/firmware/efi/efivars

8. Reboot

Am I missing something ?
 
  • Like
Reactions: AppleMacFinder

spidertnt

macrumors member
Aug 11, 2014
53
34
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!


I have a Raspberry Pi and can read and write the EFI bios . Would it possible to edit the bios directly turning off the GPU ?
 
  • Like
Reactions: AppleMacFinder

nsgr

macrumors 6502
May 22, 2017
317
117
Hello,

I am having a hard time figuring out if it worked or not for me. Basically, I would not be able to switch back to the AMD card right? I have gfxcardstatus, and I still can switch discrete (AMD).

I have El capitan, got the "gpu-power-prefs-..." variable by default and did the following :

1. cd/sys/firmware/efi/efivars then LS to confirm the presence of the gpu-power-prefs

2. umount /sys/firmware/efi/efivars/

3. mount –t efivarfs rw /sys/firmware/efi/efivars/

4. chattr -i /sys/firmware/efi/efivars/gpu-power-prefs-[press TAB to autocomplete]

5. rm /sys/firmware/efi/efivars/gpu-power-prefs-[press TAB to autocomplete]

6. cd /

7. umount /sys/firmware/efi/efivars

8. Reboot

Am I missing something ?

Steps missing:

5.1 - You did not create a new file gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9

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

5.2 - Change file to Immutable:

chattr +i "/sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9"
[doublepost=1496022603][/doublepost]
This UUID number seems to be universal - I believe that it could work with any MBP out there. I also think that maybe there are some other UUID numbers that could be used instead of that "universal UUID number" given above - but please note that not every UUID number can work there. As you could see from this thread, one person has accidentally tried -fa4ce28d-b62f-4c99-9cc3-6815686e30fg instead of -fa4ce28d-b62f-4c99-9cc3-6815686e30f9 and the fix didn't work - probably because UUID number can't be 100% random and should meet some constraints

Yes, Macbook Pro 2011 (AMD) and Macbook Pro 2014 (Nvidia) have the same GUIDs / UUIDs:

FA4CE28D-B62F-4C99-9CC3-6815686E30F9:gpu-active

FA4CE28D-B62F-4C99-9CC3-6815686E30F9:gpu-power-prefs

7C436110-AB2A-4BBB-A880-FE41995C9F8:gpu-policy


https://github.com/ah-/gmux-scripts/issues/1#issuecomment-68113930
 
Last edited:
  • Like
Reactions: AppleMacFinder

matbert

macrumors newbie
May 28, 2017
2
2
Steps missing:

5.1 - You did not create a new file gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9

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

5.2 - Change file to Immutable:

chattr +i "/sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9"
[doublepost=1496022603][/doublepost]

Yes, Macbook Pro 2011 (AMD) and Macbook Pro 2014 (Nvidia) have the same GUIDs / UUIDs:

FA4CE28D-B62F-4C99-9CC3-6815686E30F9:gpu-active

FA4CE28D-B62F-4C99-9CC3-6815686E30F9:gpu-power-prefs

7C436110-AB2A-4BBB-A880-FE41995C9F8:gpu-policy


https://github.com/ah-/gmux-scripts/issues/1#issuecomment-68113930
Thanks for the input but.. still not working.. do I have to be in cd /sys/firmware/efi/efivars/ before 4. (cattr -i ...) ?
 
  • Like
Reactions: AppleMacFinder

nsgr

macrumors 6502
May 22, 2017
317
117
Thanks for the input but.. still not working.. do I have to be in cd /sys/firmware/efi/efivars/ before 4. (cattr -i ...) ?

My test:
Macbook Pro Early 2011
Mac OS Sierra 10.12.5
gfxcardstatus 2.4.3i - Steve Schow

If you forget a space between the commands and options, it will give problem.

If you are not accustomed to using the terminal on Linux, better not to go into the directory /sys/firmware/efi/efivars/

CD means change directory. Enter or leave directory.

I realized that there is a difference in chattr +i with quotes and chattr +i without quotes.


Alternative 1 - with quotes - without AMD kexts

Lock the integrated GPU in the boot and Mac OS. (gfxcardstatus can not switch to discrete gpu).

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


Alternative 2 - without quotes - without AMD kexts

Lock the Integrated gpu in Boot but do not lock in Mac OS. (gfxcardstatus can not switch to Integrated gpu) - Error: External Display

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


You are using without quotation marks "..." . For what you wrote.

0 - Boot in ArchLinux - with nomodeset


1 - Exit the root directory. Now you are in /.

cd /


2 - Verify efivars mounted with read and whrite (rw) with the "filter" grep. Grep shows only what you are looking for. You need to use the pipe | before the grep. The pipe key is above the Enter key on the US keyboard.

mount | grep efivars


3 - If efivars mounted as rw, you do not need umount the efivars.


4 - Check if gpu-power-prefs file exists and what its attribute with lsattr.

lsattr /sys/firmware/efi/efivars | grep gpu-power-prefs


5 - If file gpu-power-prefs exists, remove Immutable attribute.

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


6 - Remove file gpu-power-prefs

rm /sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9


7 - Create new file gpu-power-prefs. The letters and numbers (GUID/UUID) must be exactly the same.
gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9

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


8 - Add Immutable attribute file gpu-power-prefs with quotes " ... "

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


9 - Umount efivars

umount /sys/firmware/efi/efivars/

10 - Restart the system ArchLinux. Boot in Mac OS.

reboot
 
Last edited:
  • Like
Reactions: AppleMacFinder

Shug Ninx

macrumors newbie
May 22, 2017
3
3
Hello !

The people in this thread - already had success in resolving this EFI variable write permission issue. MBP 2011 is 8,1 / 8,2 / 8,3 so even if "MBP 6,2 and also 5,4" have this EFI writing issue - it doesn't affect us. Please try resetting PRAM / NVRAM / SMC and especially looking through the previous pages of this thread, it contains a lot of helpful notes that could help to fix your problem

Resetting PRAM/SMC didn't change anything, and I did read the entire thread for similar issues but found only two posts with no clear followup regarding success or failure after remounting /sys/firmware/efi/efivars. Other posts didn't help with this specific printf: write error: Invalid argument error, but I may have missed some.
[doublepost=1496083628][/doublepost]
Macbook Pro Early 2011 - Intel HD 3000 and AMD Radeon HD 6750M - Mac OS Sierra 10.12.5

Some people are not able to load Arch Linux correctly, so I decided to write this information.
I'm still testing.
[...]

Test: Single-User mode (Command + S) with red background screen and white stripes.


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

That worked for me !

This procedure only remains for 1 boot.

Seems to work after reboot or shutdown here, at least for now.

Thanks a lot !
 
  • Like
Reactions: AppleMacFinder

AppleMacFinder

macrumors 6502a
Original poster
Dec 7, 2009
796
152
Macbook Pro Early 2011 - Intel HD 3000 and AMD Radeon HD 6750M - Mac OS Sierra 10.12.5

Some people are not able to load Arch Linux correctly, so I decided to write this information.
I'm still testing.

This procedure only remains for 1 boot.

I had to clear NVRAM (Option + Command + P + R) and the gpu-power-prefs setting was cleared from efivars.

No problem, Now I know how to do it (efivars modification in ArchLinux).

But I'm having a temperature rise problem of 20 degrees Celsius. This I resolve after investigating gpu-policy.

In short, I researched some information (AppleMacFinder, FGuarani, gmux-scripts, gpu-switch) again and fell into a Wikileaks page with the nvram variables after searching gpu-policy and boot-args = "argc = 1" on Google.

I had tried without success the famous sudo nvram gpu-power-prefs=%01%00%00%00 .

Now I have discovered that there is a way to do this. And it is not listed later in nvram -p .

Format:

sudo nvram GUID:NVRAM_Variable=value

GUID - Standard Apple Macbook Pro Early 2011-> fa4ce28d-b62f-4c99-9cc3-6815686e30f9

NVRAM Variable -> gpu-power-prefs

Value for Integrated gpu - In this case Binary data Hexadecimal (%) -> %01%00%00%00

Test: Single-User mode (Command + S) with red background screen and white stripes.


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


After the reboot, the screen became normal again.


Setting NVRAM Variables from OS X - Wikileaks
Example: DriverOrder

sudo nvram 8BE4DF61-93CA-11D2-AA0D-00E098032B8C:DriverOrder=%00%50

https://wikileaks.org/ciav7p1/cms/page_26968084.html

http://www.insanelymac.com/forum/topic/291655-ozmosis/page-3

https://github.com/erikberglund/AppleNVRAM

https://github.com/gdbinit/firmware_vault

gmux-scripts - user Sprin commented on Dec 25, 2014
https://github.com/ah-/gmux-scripts/issues/1#issuecomment-68113930

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

nvram-dump
https://github.com/ah-/nvram-dump/blob/master/nvram-dump.m

dmpstore - Variables EFI

http://en.community.dell.com/techcenter/os-applications/f/4457/t/19589262

https://forums.macrumors.com/thread...o-bios-emulation.696523/page-42#post-20529412

http://www.sysadminshare.com/2012/01/efi-shell-commands.html

nsgr , thank you very very much for your research - these findings are really valuable!
As always, Wikileaks is very helpful ;)

I have a Raspberry Pi and can read and write the EFI bios . Would it possible to edit the bios directly turning off the GPU ?

Sadly MBP's EFI/BIOS is closed source - it is not like open source corebboot BIOS or stuff. So theoretically it is possible to remove some EFI/BIOS sections that are directly related to GPU activation, using a hex editor and preferably some reverse engineering tools like IDA (super expensive tool but which available at torrents) - however in practice it requires a lot of man-hours to do it correctly :p

Other questions have been professionally adressed by nsgr , thank you a lot :D
 
  • Like
Reactions: blueman2

blueman2

macrumors newbie
May 26, 2017
2
2
SFO
Macbook Pro Early 2011 - Intel HD 3000 and AMD Radeon HD 6750M - Mac OS Sierra 10.12.5
...
But I'm having a temperature rise problem of 20 degrees Celsius. This I resolve after investigating gpu-policy.

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

Thanks! I am dual booting OSX and Windows 7, and Windows was badly overheating even with almost no load. CPU-z showed that the CPU was always running at overdrive speed (3.3GHz on my 2.5GHz spec 2011 MBP). Does this allow Intel speedstep to work correctly?

Also, did you mean to say gpu-policy in the line above? I did not see where you are changing the policy anywhere.
 
Last edited:
  • Like
Reactions: AppleMacFinder
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.