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.

tmanx

macrumors newbie
Nov 1, 2017
22
3
After waking from sleep, the temperature of the 'GPU Diode' on the macs fan control gets hot again, and the overall temperature also seems to rise.
I also hope that someone will solve the final problem of this.

So it sounds like the grub solution also has an overheating issue (and power draw/battery drain)? Is that understanding correct? Is there an explanation for this @brainshutdown ?
 

Swapnilsagarwal

macrumors newbie
Jul 13, 2010
11
2
For High Sierra, I believe this menu entry will work:

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

This defaults back to booting macOS on my machine, and the hack still works.
If you you want to remove from the EFI partition, then try this:

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

I came across this link for compiling a file and running it at every suspend/resume/freeze/thaw entry. I haven't been able to compile the file.

https://ubuntuforums.org/showthread.php?t=1695746&page=27&p=10695119#post10695119

People are reporting much less DCin power usage and cooler running machines.
Have you tested this? what are your view points on this?
 

brainshutdown

macrumors regular
Jul 16, 2012
124
110
It takes quite a long time to power up and boot into Grub.
I wait almost 20 seconds on a white screen and then enter the Grub Menu.
Is there any way to shorten boot time?

SSD or HDD? Mine (with an SSD) takes about 2 to 3 seconds to boot into grub.
You can try to move some of the modules to reduce the amount of files in the EFI partition.
For this you need to mount the EFI partition
Code:
cd /Volumes
sudo mkdir efi
sudo mount -t msdos /dev/disk0s1 /Volumes/efi

Open the folder
Code:
open /Volumes/efi/boot/grub

Edit the grub.cfg and add this at the beginning of the file:
Code:
insmod iorw

Then go to the "x86_64-efi" folder and remove everything except hfsplus.mod and iorw.mod.

And after returning from Sleep, the overall temperature rises,
Is there any solution for this?

That's odd. The temperatures in mine are ok. Here are my temps after waking up from sleep:

Idle for 5 minutes:
JNCPD57.png


Watching a 1080p 60fps video on youtube for 5 minutes:
xqI0n8K.png

[doublepost=1509661448][/doublepost]
I came across this link for compiling a file and running it at every suspend/resume/freeze/thaw entry. I haven't been able to compile the file.

https://ubuntuforums.org/showthread.php?t=1695746&page=27&p=10695119#post10695119

People are reporting much less DCin power usage and cooler running machines.
Have you tested this? what are your view points on this?
Yes, that code only works on linux. On macOS you don't have the "sys/io.h" header file. I even tried to recreate the outb function using assembler but didn't succeed. I believe macOS only allows hardware I/O operations to take place on kexts.
[doublepost=1509663875][/doublepost]
I'll probably move the kexts back after the successful implementation of grub in single user mode. This is both because I've read about permissions and cache issues using finder - and I want to make sure they end up back in the right place! - I think the code below will do this:

mv /AMD_Kexts/AMD*.* /System/Library/Extensions/
touch /System/Library/Extensions/
reboot

Could I just do that in terminal instead (minus sudo)?

Yes, you can use terminal instead. Finder also has "Paste Item Exactly" for that kind of stuff.
This article explains how it works: http://osxdaily.com/2014/08/28/move-files-with-permissions-paste-item-exactly-mac/
 
Last edited:

nasmai

macrumors newbie
Nov 2, 2017
7
1
SSD or HDD? Mine (with an SSD) takes about 2 to 3 seconds to boot into grub.
You can try to move some of the modules to reduce the amount of files in the EFI partition.
For this you need to mount the EFI partition

Thanks...
I installed macOS on the ssd drive. however, I use 1tb hdd as backup storage in the place where odd is removed. Is this a problem?


That's odd. The temperatures in mine are ok. Here are my temps after waking up from sleep:
idle...

CwAbOYB.jpg


after waking from sleep,

LBb8vTx.jpg


It looks like the dGPU has warmed up again.
 

brainshutdown

macrumors regular
Jul 16, 2012
124
110
Thanks...
I installed macOS on the ssd drive. however, I use 1tb hdd as backup storage in the place where odd is removed. Is this a problem?

Not a problem if the EFI partition is on the SSD.

idle...

CwAbOYB.jpg


after waking from sleep,

LBb8vTx.jpg


It looks like the dGPU has warmed up again.

That happens with mine too, but the temperatures are ok, nothing to worry about.
 

tmanx

macrumors newbie
Nov 1, 2017
22
3
ok, thanks... anyway this is the best solution i've had, and i can use my mbp2011 more easily. thank you for your efforts.

Just trying to check my numbers are OK? There's no read at all from the GPU Die Digital - which I thought was the dedicated GPU? What does that mean?

Just opened

wake.png


After playing 4 videos simultaneously for a minute or so

quicktime.png
 

nasmai

macrumors newbie
Nov 2, 2017
7
1
Just trying to check my numbers are OK? There's no read at all from the GPU Die Digital - which I thought was the dedicated GPU? What does that mean?
I think the temp is okay.
If the solution worked properly, only the iGPU should be activated.
Therefore, it is correct that dGPU is not displayed.
 

Schmye Bubbula

macrumors member
Jul 24, 2009
40
1
brainshutdown and nasmai (and anyone else), I just had a thought. It may not be sleep per se that makes things run hotter (or at least increase battery drain) under the grub method; rather, it might be the GPU getting reset that's the culprit (which I think occurs coming out of sleep). Resetting the GPU may be making it rev-up.

Anybody experiencing more heat awakening from sleep please try observing any temperature difference after resetting the GPU by doing a "sleep display": ctrl-shift-⏏ (that's the optical disk eject key in the upper-right keyboard, and that's not the same as reducing the brightness all the way).

Alternatively, you can do it in Terminal:
Code:
open -a SleepDisplay
...or in AppleScript:
Code:
do shell script "open -a SleepDisplay"
 

AdamRealMacMods

macrumors newbie
Jul 9, 2016
7
0
Can someone do me a big favor and upload the com.apple.driver.AppleBacklight (170.10.1) from High Sierra?

Troubleshooting a backlight issue wherein the backlight works fine on Sierra, but is not controllable in High Sierra. I am hopeful the answer is in the particular Display ID being absent in the High Sierra kext.
 

Schmye Bubbula

macrumors member
Jul 24, 2009
40
1
^ Many, many thanks, brainshutdown!... By gum, I think we've now reached the best of all possible worlds!

Grandma requests that someone build a binary for her and post a download link. If they all don't bake the same for different versions of macOS, then she needs one each for El Capitan, Sierra, and High Sierra.
 

Schmye Bubbula

macrumors member
Jul 24, 2009
40
1
^ Could the unhappy dilemma of running at least slightly hotter after sleep vs. running insecurely be avoided? Can SleepWatcher be set-up to do the same thing as the AMDGPUWakeHandler kext without running SIP or other security disabled?

Or does anyone have a kext-enabled Apple Developer account that could sign the kext for us and provide a download link for distribution here? (Or is that something that would be a liability or asking too much of an individual Apple developer?—I don't know how these things work.)

Just seeking a turnkey solution here, folks.
 

brainshutdown

macrumors regular
Jul 16, 2012
124
110
The kext performs low-level I/O which is only possible in kexts.

A kernel extension (or kext) is a dynamically loaded bundle of executable code that runs in kernel space. You can create a kext to perform low-level tasks that cannot be performed in user space. Kexts typically belong to one of three categories:
  • Low-level device drivers
  • Network filters
  • File systems
Source
 
  • Like
Reactions: Schmye Bubbula

tmanx

macrumors newbie
Nov 1, 2017
22
3
's a
@tmanx The temperatures are ok.
@Schmye Bubbula The "sleep display" makes no difference.

Anyway, for anyone interested I've created a simple kext that disables the GPU after waking from sleep.
You can find it here:
https://github.com/blackgate/AMDGPUWakeHandler

Thanks very much @brainshutdown and @nasmai.

This Kext looks fantastic. I've only gotten around to applying the fix in post #106 - so haven't attempted the Grub approach yet. Currently, I have moved all AMD Kexts to an AMD_Kexts folder. However - from looking briefly at the Github page for AMD GPU Wake Handler, would applying the wake handler Kext solve the issue of the Mac now not knowing what to do with the dedicated GPU - and can it be applied with FGuarini's approach in post 106? That seems to have solved the issue - temps are ok - so this Kext seems to (hopefully) be the final action to close the loop?

Thanks a lot again @brainshutdown
 

brainshutdown

macrumors regular
Jul 16, 2012
124
110
@tmanx
I don't know if it will work with the #106 fix.
I have tried booting without grub and with the AMD kexts in place, and it causes a kernel panic.
Haven't really tried moving the kexts to check if it still kernel panics, but if you have moved the kexts and don't have any AMD kext loaded, you can try to load the kext manually as described in the github repository to see if it works.
 

aantoxa

macrumors newbie
May 14, 2011
2
0
Hi Guys,

Thanks to this thread I managed to fix my MacBook Pro 2011.
It worked well for a while until recently the battery got discharged. Then I plugged in the charger and booted it and it failed to logon a few times (resulting in reboot). After an NVRAM reset I managed to logon. However the graphics seems to work much worse than before.
Google chrome renders pages very slow in squares from bottom to top. Mouse pointer leaves some grey background colour on it way.
SMC reset does not seem to work anymore (On Shift+Control+Option+Power I here some sound supposedly indicating that this key combination does not work).

Any thoughts or ideas would be much appreciated.

Thanks
 

tmanx

macrumors newbie
Nov 1, 2017
22
3
@tmanx
I don't know if it will work with the #106 fix.
I have tried booting without grub and with the AMD kexts in place, and it causes a kernel panic.
Haven't really tried moving the kexts to check if it still kernel panics, but if you have moved the kexts and don't have any AMD kext loaded, you can try to load the kext manually as described in the github repository to see if it works.

@brainshutdown
Thanks for that. I'll see what I can do. I'm still trying to figure out how to build the kext. I'm on El Capitan and can't seem to find Xcode for that. I think there's a version for Mavericks? (which is the mac that has failed).

I haven't run the grub solution partly due to time and partly as I'm not sure what the new workflow is (i.e. does the mac boot up and down as normal - or are we then booting in a very different way via grub)? As mentioned - it's my young daughter's - and want to understand how it'll affect her user experience.

cheers
 

E.Amrol

macrumors newbie
Oct 2, 2017
4
0
I’m happy to say that my MacBook Pro is back up and running thanks to this thread! I used most of the steps in MikeyN’s guide, along with some steps from another guide found on asyncro.com. It took a few tries, but after adjusting a few things for my set up (MBP 15” Early 2011 running Yosemite), everything is working perfectly and I have a fully functioning MacBook Pro (aside, of course, from video out to an external monitor).



Below are the steps I took for Early 2011 15” MacBook Pro running Yosemite 10.10.5:



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’)

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


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

My issue came back again and this time your steps work for me. Can you guide on step 11, after type it, how to proceed? Normally just enter, for this time after complete type what to do? Exit by control X? What you mean with make it executable?
 

brainshutdown

macrumors regular
Jul 16, 2012
124
110
@brainshutdown
Thanks for that. I'll see what I can do. I'm still trying to figure out how to build the kext. I'm on El Capitan and can't seem to find Xcode for that. I think there's a version for Mavericks? (which is the mac that has failed).
For mavericks I believe you need Xcode 5.
You can find the old versions of Xcode here:
https://developer.apple.com/download/more/

I haven't run the grub solution partly due to time and partly as I'm not sure what the new workflow is (i.e. does the mac boot up and down as normal - or are we then booting in a very different way via grub)? As mentioned - it's my young daughter's - and want to understand how it'll affect her user experience.
After following all the steps up until step 4, It boots into grub (it's just a bootloader) which presents you a menu(with just macOS), then you just need to press enter to boot macOS. Basically what changes in terms of usability is that you need to press enter when you turn on your mac.
 
Last edited:
  • Like
Reactions: tmanx

therif

macrumors newbie
Aug 24, 2006
20
2
Dear,

So I've done the fix and tried to read all the posts in this thread but can't find a solution to my problem.

I've done the 100% working solution, and I know the Intel Graphics are in use because the screen is not distorted anymore.

The mac now starts up and loads like 50% of the profile and then the fans starts running very load for like 15 seconds, then reboot.
I've restarted the computer in single-user mode and I did an fsck -fy and it found some errors and fixed them.
Restarted again: same issue.

Then I saw that I could restart in rescue mode(turning off computer then turning on again)

I then get a screen where I can see my profile with forgot password etc. but I can't access the menu's except the wifi menu. The keyboard doesn't work at all. I can't do anything.

I then restarted again, but same issue: boots 50%, then fans run loud, then reboots.

I don't want to do a nvram or pram reset as I will have to do the fix again, unless you guys tell me I have to re-do the solution of course.

Please, I have all my Logic Pro files on it and I've got no backup or other mac.

Thanks a lot for your help!!!!
therif
 

tmanx

macrumors newbie
Nov 1, 2017
22
3
Dear,

So I've done the fix and tried to read all the posts in this thread but can't find a solution to my problem.

I've done the 100% working solution, and I know the Intel Graphics are in use because the screen is not distorted anymore.

The mac now starts up and loads like 50% of the profile and then the fans starts running very load for like 15 seconds, then reboot.
I've restarted the computer in single-user mode and I did an fsck -fy and it found some errors and fixed them.
Restarted again: same issue.

Then I saw that I could restart in rescue mode(turning off computer then turning on again)

I then get a screen where I can see my profile with forgot password etc. but I can't access the menu's except the wifi menu. The keyboard doesn't work at all. I can't do anything.

I then restarted again, but same issue: boots 50%, then fans run loud, then reboots.

I don't want to do a nvram or pram reset as I will have to do the fix again, unless you guys tell me I have to re-do the solution of course.

Please, I have all my Logic Pro files on it and I've got no backup or other mac.

Thanks a lot for your help!!!!
therif

Hi @therif - which fix have you applied?
 

therif

macrumors newbie
Aug 24, 2006
20
2
Hi @therif - which fix have you applied?

Thank you for your reply.

I have created an Arch linux livecd and followed the steps(in an extremely distorted screen)
- boot it in nomodeset
removed the gpu-power-prefs...with rm. went smooth, no 'operation permitted' as when checking it again the file wasn't there anymore.
then

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

then i didn't do the: chattr -i "/sys/firmware/efi/efivars/"
but I did
printf "\x07\x00\x00\x00\x01\x00\x00\x00" > /sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9

followed by

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

unmounted and rebooted. since then, no distorted screen anymore

After that I saw after one time that the boot stopped and rebooted, i rebooted with cmd+s and did a fsck -fy and the tool found some errors and fixed it.

rebooted again, but the mac is still stuck at the same place

Gonna try post #947 and see if it works
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.