Resolved Disable a failed AMD GPU on a 2011 MacBook Pro [GRUB solution]

Discussion in 'MacBook Pro' started by brainshutdown, Nov 11, 2017.

  1. nate922 macrumors newbie

    Joined:
    Aug 2, 2010
    #101
    Mate that is awesome. the kext unload/load works and it instantly lowers the GPU to 0.

    It's strange that sometimes the kext is not working on wake as the logs show that's it's running like it should:

    2017-11-26 14:17:17.002457+0000 0x424dd Default 0x0 0 kernel: (AMDGPUWakeHandler) Waking up

    2017-11-26 14:17:17.002459+0000 0x424dd Default 0x0 0 kernel: (AMDGPUWakeHandler) Disabling GPU
     
  2. brainshutdown thread starter macrumors regular

    Joined:
    Jul 16, 2012
    #102
    In the linux source code for the "apple-gmux" they use the "gmux_index_write8" function for the retina models and the "gmux_pio_write8" for non retinas, and the index one is a bit more complex. They do some sort of waiting between outb instructions, and that's probably why it sometimes work, and sometimes won't. You can copy the waiting functions and give it a try.
     
  3. nsgr, Nov 26, 2017
    Last edited: Nov 26, 2017

    nsgr macrumors 6502

    Joined:
    May 22, 2017
    #103
    HighSierra 10.13.1 - Macbook Pro 15" Early 2011

    No, GMUX is enable. Even then I tried again with the addition of outb "0x714 0xFF" in GRUB but it did not work.

    The problem is that AMD kexts are not loaded on boot (AMD6000Controller.kext, AMDLegacySupport.kext and AMDLegacyFrameBuffer.kext).



    No GRUB on boot - AMD GPU and Intel GPU recognized:
    Code:
    system_profiler SPDisplaysDataType | grep gMux
          gMux Version: 1.9.23
          gMux Version: 1.9.23
    
    With GRUB on boot - Only Intel GPU recognized:
    Code:
    system_profiler SPDisplaysDataType | grep gMux
          gMux Version: 1.9.23
    

    Test 1 - Safe Mode (SHIFT key press at boot) with AMD Kexts in /System/Library/Extensions

    1 - Primary GPU is Intel

    2 - Mac OS recognizes the AMD GPU (device id 0x6741) and loads the respective AMD kexts (AMD6000Controller.kext, AMDLegacySupport.kext and AMDLegacyFrameBuffer.kext).

    3 - Load three Backlight kexts.
    Code:
    kextstat | grep AMD
    com.apple.kext.AMDLegacySupport (1.5.8)
    com.apple.kext.AMD6000Controller (1.5.8)
    com.apple.kext.AMDLegacyFramebuffer (1.5.8)
    
    kextstat | grep -i backlight
    com.apple.driver.AppleBacklightExpert (1.1.0)
    com.apple.driver.AppleBacklight (170.10.1)
    com.apple.driver.AGDCBacklightControl (3.16.19)
    

    4 - System Preferences -> Displays -> Brightness slider and F1 and F2 keys works.


    Test 2 - Safe Mode (SHIFT key press at boot) with AMD Kexts moved out /System/Library/Extensions

    1 - Primary GPU is Intel

    2 - Mac OS recognizes the AMD GPU (device id 0x6741) and not loads the respective AMD kexts (AMD6000Controller.kext, AMDLegacySupport.kext and AMDLegacyFrameBuffer.kext). The kexts AMD moved out /System/Library/Extensions.

    3 - Load two Backlight kexts. Load manually the kext AppleBacklight.kext do not resolve the Brightness problem.
    Code:
    kextstat | grep -i backlight
    com.apple.driver.AppleBacklightExpert (1.1.0)
    com.apple.driver.AGDCBacklightControl (3.16.19)
    
    4 - System Preferences -> Displays -> Brightness slider disapear and F1 and F2 keys do not work.

    5 - Load kexts AMD manually (kextload -r : alternative kexts repository - loads dependent kexts)
    Code:
    sudo kextload -r /AMDExtensions/ /AMDExtensions/AMD6000Controller.kext
    kextstat | grep AMD
    com.apple.kext.AMDLegacySupport (1.5.8)
    com.apple.kext.AMD6000Controller (1.5.8)
    
    6 - System Preferences -> Displays -> Brightness slider disapear and F1 and F2 keys do not work.


    Test 3: Boot normal (no press key at boot - no GRUB) with AMD Kexts moved out /System/Library/Extensions

    1 - Primary GPU is Intel - because force Intel GPU power prefs with nvram.

    2 - Mac OS recognizes the AMD GPU (device id 0x6741) and not loads the respective AMD kexts (AMD6000Controller.kext, AMDLegacySupport.kext and AMDLegacyFrameBuffer.kext). The kexts AMD moved out /System/Library/Extensions.

    3 - Load two Backlight kexts. Load manually the kext AppleBacklight.kext do not resolve the Brightness problem.
    Code:
    kextstat | grep -i backlight
    com.apple.driver.AppleBacklightExpert (1.1.0)
    com.apple.driver.AGDCBacklightControl (3.16.19)
    
    4 - System Preferences -> Displays -> Brightness slider disapear and F1 and F2 keys do not work.

    5 - Load kexts AMD manually (kextload -r : alternative kexts repository - loads dependent kexts)
    Code:
    sudo kextload -r /AMDExtensions/ /AMDExtensions/AMD6000Controller.kext
    kextstat | grep AMD
    com.apple.kext.AMDLegacySupport (1.5.8)
    com.apple.kext.AMD6000Controller (1.5.8)
    
    6 - System Preferences -> Displays -> Brightness slider disapear and F1 and F2 keys do not work.


    Conclusion: The Brightness problem is only solved (in my tests) when these kexts are loaded during boot on HighSierra 10.13.1 - MacBook Pro 15" Early 2011:

    AMD6000Controller.kext
    AMDLegacySupport.kext
    AMDLegacyFrameBuffer.kext
     

    Attached Files:

  4. brainshutdown, Nov 26, 2017
    Last edited: Nov 26, 2017

    brainshutdown thread starter macrumors regular

    Joined:
    Jul 16, 2012
    #104
    @nsgr On my MBP Early 2011(8,2) using Sierra:
    Code:
    > kextstat | grep -i backlight
    com.apple.driver.AppleBacklightExpert (1.1.0)
    > kextstat | grep -i mux
    com.apple.driver.AppleMuxControl (3.14.49)
    
    In macOS Sierra the AppleMuxControl is at /System/Library/Extensions/AppleGraphicsControl.kext/Contents/PlugIns/AppleMuxControl.kext

    Hope it gives you some insights.
     
  5. nsgr macrumors 6502

    Joined:
    May 22, 2017
    #105
    Boot GRUB with out command (HighSierra 10.13.1 - MacBook Pro Early 2011 -
    MacBookPro8,2):

    Code:
    kextstat | grep -i backlight
    com.apple.driver.AppleBacklightExpert (1.1.0)
    com.apple.driver.AppleBacklight (170.10.1)
    com.apple.driver.AGDCBacklightControl (3.16.19)
    


    After 5 minutes, the system unload automatically AppleBacklight.kext.

    Code:
    kextstat | grep -i backlight
    com.apple.driver.AppleBacklightExpert (1.1.0)
    com.apple.driver.AGDCBacklightControl
    

    Code:
    kextstat | grep -i mux
    com.apple.driver.AppleMuxControl (3.16.19)
    
    I think Apple has changed the way of using Brightness.

    Even brightness.c does not work on HighSierra 10.13.1.

    System brightness setting is not updated (macOS 10.13.1)
    https://github.com/nriley/brightness/issues/21

    I'm going to install Sierra 10.12 again. Let's see what happens when you delete Container disk1 (APFS Container) with system partition (Encrypted FileVault) and Recovery partition.
     
  6. nsgr macrumors 6502

    Joined:
    May 22, 2017
    #106
    Sierra 10.12.6 installed.

    GRUB outb command + F1 and F2 key or System Preferences -> Displays -> Brightness slider show up and works correctly.
     
  7. lpuerto, Dec 3, 2017
    Last edited: Dec 3, 2017

    lpuerto macrumors newbie

    lpuerto

    Joined:
    Mar 4, 2014
    Location:
    Joensuu
    #107
    Thanks you all for your work and your time so solve this problem. I'm on a macbook pro late 2011 with high sierra whose dGPU decided to say chao on Saturday night and thanks to this fix I'm back on business.

    do you think there is anyway we can fix the issue of the brightness?

    PS/ Is there any way we can load the kext just for a while to handle the brightness??
    --- Post Merged, Dec 3, 2017 ---
    Seems that there was problem with brightness even in betas.

    https://forums.developer.apple.com/thread/80705
    https://forums.developer.apple.com/thread/82500

    I just updated like a month ago to high sierra, from El Capitan... It's not the first time this happened to me, the previous time I was covered by apple care and I have my logic board changed... 3 years ago.

    Since I installed High Sierra I've noticed that on my MacBook Pro's console there was an error [ERROR] - Unknown CGXDisplayDevice: 0x41dc9d00 that didn't appeared before. (See the attached image). I've contacted Apple about the issue and they took some data from my computer, but they didn't reach me back...

    I'm wondering if all of this is connected. And if High Sierra have triggered this behavior.
     

    Attached Files:

  8. brainshutdown thread starter macrumors regular

    Joined:
    Jul 16, 2012
    #108
    @lpuerto Yes, the behaviour you describe is only present in High Sierra as far as I know. Everything works fine in Sierra and El Capitan and some even reported it working fine on Mavericks. The best solution for now is to "downgrade" to Sierra.
     
  9. lpuerto macrumors newbie

    lpuerto

    Joined:
    Mar 4, 2014
    Location:
    Joensuu
    #109
    Hey!! first of all thank you all to work so hard in this solution. I just passed form to be in really bad mood last sunday to see the bright side after I fix my computer with this.

    Downgrade to Sierra isn't a really a solution for me. I've already transformed all my photo libraries and so to the new formats, and the problems aren't that big. The brightness is just a problem if I try to work at night and without lights... and about hibernation is just fine.

    Anyhow, it would be great to be able to fix those issues in the future.

    I was talking with Apple about a possible solution to the problem and they are willing to help. Problem is, there is difficult to find spare parts for this computers. They are considered vintage. In other words, really old, and it's true, they have mor than 6 years and in technology it's a lot. Anyhow, they are really fine machines, and even if I buy an new machine in the near future I believe there is a lot of life in this machines. So, solutions are welcomed!
     
  10. QiuChuck, Dec 22, 2017
    Last edited: Dec 23, 2017

    QiuChuck macrumors newbie

    Joined:
    Dec 22, 2017
    #110
    Thanks for all the work you did and for making my 2011 17" MBP work again.
    I managed to get it working, but the even with the AMDGPUWakeHandler kext in place, the screen just does not come back after I close and open the lid (Puting it in sleep mode)
    Any ideas why?
    This is my only problem now.
    I'm on HighSierra

    EDIT: also it seems that now it hangs on shutdown and never actualy does it :(

    EDIT2: Fixed the shutdown problem. I accidentally put the Wake kext in /System/Library/Extensions

    Moved it to the correct location but the Sleep problem is still there. Screen stays black when waking the MBP
     
  11. robvas macrumors 68030

    Joined:
    Mar 29, 2009
    Location:
    USA
    #111
  12. brainshutdown, Dec 23, 2017
    Last edited: Dec 23, 2017

    brainshutdown thread starter macrumors regular

    Joined:
    Jul 16, 2012
    #112
    @QiuChuck Your problem is this:
    The best thing you can do is "downgrade" to Sierra.
    --- Post Merged, Dec 23, 2017 ---
    I would think twice before removing the resistor. If the nvram gets reseted for some reason your MBP won't boot anymore.
     
  13. mindwalkr, Dec 23, 2017
    Last edited: Dec 23, 2017

    mindwalkr macrumors newbie

    Joined:
    Dec 19, 2017
    #113
    I have the same problem. My Macbook Pro 8.2 Late 2011 with an SSD instead of an HDD, also hangs on shutdown - I am left with a black screen and all I can do is to move the mouse pointer around. I checked if I made the same mistake as you, but alas I can't find the Wake kext mistakenly in that folder

    If I boot without GRUB, then I am able to Shutdown correctly.

    With GRUB, I am only able to shutdown before I login into the OS. If, however, when booting with GRUB, I remove the outb lines, then I am able to Shutdown correctly after logging into the OS

    Has anyone else experienced this problem and got any pointers ?
     
  14. nsgr macrumors 6502

    Joined:
    May 22, 2017
    #114
    The "Mantra" for restart or shutdown MacBook Pro:

    Open Terminal:

    Restart Macbook Pro:
    Code:
    sudo shutdown -r now
    
    Halt / Shutdown MacBook Pro:
    Code:
    sudo shutdown -h now
    
     
  15. QiuChuck macrumors newbie

    Joined:
    Dec 22, 2017
    #115
    Yep, I downgraded to Sierra and everything works just fine now.
    Even brightness is back up and working.
    I can safely say that Sierra is the last OS that works well with this fix, for the Early 2011 17" MBP at least.
    You can update to HighSierra but brightness WILL NOT work as well as SLEEP.
    Thanks A TON for all the research and HELP!

    Merry Christmas and a HAPPY NEW YEAR!

    Cheers!
     
  16. jackin6 macrumors newbie

    Joined:
    Dec 29, 2017
    #116
    Quick question in regards to this - if I implemented the EFI fix initially (change power prefs in NVRAM, remove AMD Kexts) and then decided to switch to GRUB fix (reset nvram, change power prefs in NVRAM, install custom GRUB bootloader), will I have trouble inserting these custom Kexts? Last thing I want is a kernel panic on boot after all the effort I've been through to get it working.
     
  17. Schmye Bubbula macrumors member

    Schmye Bubbula

    Joined:
    Jul 24, 2009
    #117
    Is there a signed kext available yet from anybody? This is a must!
     
  18. QiuChuck macrumors newbie

    Joined:
    Dec 22, 2017
    #118
    I have the one posted in the 1st post and it works. Would there be any differences? Is that one not signed?
     
  19. Schmye Bubbula macrumors member

    Schmye Bubbula

    Joined:
    Jul 24, 2009
    #119
    ^ Are you able to run the kext with SIP enabled? Having a signed kext is a must because, e.g., if you're doing this for an unwary friend's computer, it is untenable to disable their security.
     
  20. QiuChuck macrumors newbie

    Joined:
    Dec 22, 2017
    #120
    Umm....I don’t think I’ve enabled SIP back :)
    Should I?

    After disabling and following the steps I just left it as is.
     
  21. jackin6 macrumors newbie

    Joined:
    Dec 29, 2017
    #121
    Adding the AMDWakeHandler kext puts my mac into a Kernel panic :( that said, it boots just fine from a USB bootloader.
     
  22. QiuChuck macrumors newbie

    Joined:
    Dec 22, 2017
    #122
    Lol ok, I read about it and now I see, that by disabling SIP is the only way AMDGPUWakeHandler can work. And a signed one is required to enable back SIP.

    But Apple does not let anyone sign kext. I signed up for it and waiting for their reply. Tough I'm sure I know the answer already :)
     
  23. jangoux macrumors newbie

    jangoux

    Joined:
    Jan 5, 2018
    Location:
    Dentro do estúdio
    #123
    First, thanks for the solution! it made my Macbook workable again. But I have one issue with Grub. For some reason just the first menu item appears when I boot (I have two different OSX boot partitions + the Recovery one). Here is my grub.cfg:

    Code:
    if loadfont /boot/grub/font.pf2 ; then
        set gfxmode=auto
        insmod efi_gop
        insmod efi_uga
        insmod gfxterm
        terminal_output gfxterm
    fi
    
    set menu_color_normal=white/black
    set menu_color_highlight=black/light-gray
    
    set timeout=10
    
    menuentry "macOS" {
        insmod hfsplus
        outb 0x728 1
        outb 0x710 2
        outb 0x740 2
        outb 0x750 0
        search --no-floppy --fs-uuid --set=root b296e8fd7fe7da5e
        chainloader /System/Library/CoreServices/boot.efi
    }
    
    
    menuentry "macOS new” {
        insmod hfsplus
        outb 0x728 1
        outb 0x710 2
        outb 0x740 2
        outb 0x750 0
        search --no-floppy --fs-uuid --set=root aa82986e041282fd
        chainloader /System/Library/CoreServices/boot.efi
    }
    
    menuentry “Recovery” {
        insmod hfsplus
        outb 0x728 1
        outb 0x710 2
        outb 0x740 2
        outb 0x750 0
        search --no-floppy --fs-uuid --set=root d5ca3db4a78f4dcf
        chainloader /System/Library/CoreServices/boot.efi
    }
    What's wrong with it ?
     
  24. brainshutdown thread starter macrumors regular

    Joined:
    Jul 16, 2012
    #124
    I see two problems there.

    If you look carefully the end quote character in "macOS new” and both in “Recovery” are the wrong ones. You should change them to "macOS new" and "Recovery" respectively.

    Also the recovery partition won't boot that way. You should use one of the macOS partitions with the "-r" flag like this:
    Code:
    menuentry "Recovery" {
        insmod hfsplus
        outb 0x728 1
        outb 0x710 2
        outb 0x740 2
        outb 0x750 0
        search --no-floppy --fs-uuid --set=root aa82986e041282fd
        chainloader /System/Library/CoreServices/boot.efi -r
    }
    
    --- Post Merged, Jan 6, 2018 ---
    Unless you have SIP enabled you won't have any trouble inserting the kext.
    --- Post Merged, Jan 6, 2018 ---
    Did the step 4 work without any error?
     
  25. lastscenen, Jan 8, 2018
    Last edited: Jan 8, 2018

    lastscenen macrumors newbie

    Joined:
    Jan 8, 2018
    #125
    this method, can install windows ? how?
    or just use bootcamp ?
    if can install windows it will perfect.
     

Share This Page