# Improving heat management after macbookpro 2011 discrete GPU fix, also a script to automate part of the fix process > Taken from [StackExchange](https://apple.stackexchange.com/questions/267581/gpu-problem-boot-hangs-on-grey-screen/295805#295805) > Thanks to [LangLangC](https://apple.stackexchange.com/users/251859/langlangc) ### Improved thermal and power management #### Open Terminal.app #### Create login hook folder for thermal and power management ```shell sudo mkdir -p /Library/LoginHook ``` #### Create login hook file ```shell sudo nano /Library/LoginHook/LoadX3000.sh ``` #### Add folowing contents when nano opens ```shell #!/bin/bash kextload /System/Library/Extensions-off/AMDRadeonX3000.kext pmset -a force gpuswitch 0 # undocumented/experimental exit 0 ``` > Use `ctrl + o` to save and `ctrl + x` exit #### Make it executable ```shell sudo chmod a+x /Library/LoginHook/LoadX3000.sh ``` #### Register login hook ```shell sudo defaults write com.apple.loginwindow LoginHook /Library/LoginHook/LoadX3000.sh ``` #### Reboot normally #### Check that proper kexts exist ```shell kextstat | grep AMD ``` #### The command above should display ```shell ... com.apple.kext.AMDLegacySupport (1.5.1) ... ... com.apple.kext.AMD6000Controller (1.5.1) ... ... com.apple.kext.AMDSupport (1.5.1) ... ... com.apple.kext.AMDLegacyFramebuffer (1.5.1) ... And this ... com.apple.AMDRadeonX3000 (1.5.1) ... should also appear on the list ``` #### Reboot normally #### Boot into single user recovery by pressing on boot ```shell Command + r + s ``` #### Modify NVRAM ```shell nvram boot-args="-v agc=0" ``` #### Reboot ```shell reboot ``` ### Script ot make part of the process automatic #### Open terminal #### Create script ```shell sudo nano /force-iGPU-boot.sh ``` #### Add contents ```shell #/bin/sh sudo nvram boot-args="-v" sudo nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00 exit 0 ``` #### Make exectuable ```shell sudo chmod a+x /force-iGPU-boot.sh ``` #### When booting into single user mode (`Cmd + r or CMD + r + s`) use ```shell sh /force-iGPU-boot.sh ```