Taken from StackExchange
Thanks to LangLangC
For temperature and other improvements see https://gist.github.com/cdleon/d16e7743e6f056fedbebc329333d79df
Shutdown, unplug everything except power and hold
leftShift + Ctrl + Option + Power
I holded for 5 seconds, but holding just for an instant should work
Command + Option + p + r
Until you hear the startup chime two times.
if you are on high sierra 10.13.6+ you might need to use
Command + r
instead
Command + r + s
csrutil disable
nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00
nvram boot-args="-v"
reboot
Command + s
It might look as if it hanged, but press enter and you should see the shell (root#)
/sbin/mount -uw /
mkdir -p /System/Library/Extensions-off
mv /System/Library/Extensions/AMDRadeonX3000.kext /System/Library/Extensions-off/
touch /System/Library/Extensions/
reboot
It will show a bunch of text in the screen (don't be alarmed, let it finish) and then it will restart again In second restart it will show text in the screen again and then it will show normal login screen Your computer now should work properly (dGPU off and iGPU on, shown as i in gfxCardStatus
If an update that contains changes to the AMD drivers is about to take place it is advisable to move back the AMDRadeonX3000.kext to its default location before the update process. Otherwise the updater writes at least another kext of a different version to its default location or at worst you end up with an undefined state of partially non-matching drivers.
After any system update the folder /System/Library/Extensions has to be checked for the offending kext. Its presence there will lead to e.g. a boot hang on Yosemite and Sierra, an overheating boot-loop in High Sierra.
In macOS Sequoia it turned out to be a lot more difficult, since you can't mount any drive as writeable in Single User Mode, and macOS Safe Mode does not allow writing to
/System/
, and SIP (System Integrity Protection; aka.csrutil
) plus the Signed System Volume (SSV;csrutil authenticated-root
) protections remain enabled by default. Read about how to disable these protections. Furthermore, if Sequoia fails to boot, then it will revert the system disk to an earlier APFS snapshot, which will overwrite and thus eliminate any files you may have added to root/
or/System/
dirs.I got it working (disabled the dedicated AMD GPU, and successfully booted into macOS Sequoia in normal mode) after a fair amount of attempts. I'll try to document the key factors here, so you may have success in replicating it if you're in the same situation.
NB: Display brightness controls are disabled (touch bar, system bar, display system settings). I gave up trying to get the brightness controls to work on the internal display in macOS in normal mode, even though they work when booting into safe mode. It seems as macOS in normal mode loads
AMDRadeonX4000.kext
and associated kexts in normal mode in macOS even though I have removed them from/Volumes/Macintosh\ HD/System/Library/Extensions/
. Got some indications I you would need to "rebuild the kernel collections if you want to exclude (remove) AMD kexts that are part of the Boot Kext Collection (BKC) from loading in normal mode on macOS Sequoia", but this step seemed fairly involved. So instead I downloaded the app "Brightness Slider" from the App Store and am using that to control the display brightness using a translucent black overlay in software, which works fairly well, but likely won't conserve battery life as much.In Recovery mode (boot computer by holding
CMD + R
), remember that/System
refers to the System folder of the minimal recovery OS, not the System folder of your main macOS installation. So in recovery mode then when you want to make modifications to your macOS installation don't go via root/
but via/Volume/<name of your main SSD drive partition>/
.Recommend storing:
nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00
inside a
.sh
script file callednvram_disable_gpu.sh
stored in your user folder (so it won't be overwritten by system snapshots on potential failed reboot). So you can easily run it again as need be without having to type it out, and just run it from root/
with this:sh /Volumes/Macintosh\ HD/Users/<username>/nvram_disable_gpu.sh
Ensure you have all the permissions needed (in Recovery mode):
Modern macOS uses a signed system volume (SSV), so you must mount the correct partition with write access to make changes to the System folder (otherwise you'll get
Read-only file system
errors):mount -uw /Volumes/Macintosh\ HD/
I moved all of the AMD kexts away from the Extensions folder. Note that this is NOT under
/System/Library/Extensions/
since that is under root, but actually under your hard drive (mine is named Macintosh HD) in the/Volumes/
dir:I might just have needed to move the specific "4000" kexts for my AMD Radeon card, mentioned in my previous post. But since that didn't work at first, I moved all of them. After that, the NVRAM settings seem to have done the trick.
Then:
kmutil rebuild
to explicitly rebuild the kext (kernel extension) collection in modern versions of macOS, including Sequoia. The olderkextcache -i /Volumes/Macintosh\ HD/
ortouch /Volumes/Macintosh\ HD/System/Library/Extensions/
commands are deprecated and no longer manages the new kext collection system introduced since macOS Big Sur. Since the cache is now managed by new tools and is more tightly integrated with system security.macOS Sequoia (and Sonoma) has apparently moved to (esp. in case of errors during boot) booting from a system snapshot, so you need to persist any changes you make to your system in Recovery mode to a snapshot.
See the preexisting snapshots:
I recommend moving the kext files and creating a blessed system snapshot afterwards (in recovery mode). The usual way has been with:
But the newer way (since
bless
may be deprecated) is instead to do:-s creates the snapshot:
-r sets the snapshot as the one to use as root on the next boot and onwards:
Not sure that it makes a difference. Either way seems to work.
Verify that a new snapshot was added, by listing the snapshots again and see if theres a new one at the bottom:
There should be an additional
com.apple.bless....
snapshot listed at the end and it's XID should say it will root to (boot from) it.So when Sequoia tries to reboot with this new snapshot, you will have moved the mentioned kext files away from
/Volumes/Macintosh\ HD/System/Library/Extensions/
and they should no longer cause the boot failure / reboot loop.This enables booting into macOS Sequoia in normal mode, but causes brightness controls to be disabled (not visible in system preferences -> Displays, greyed out in top task bar, and the brightness control on the touch bar does nothing).
Try setting:
pmset -g
to inspect power management variablespmset -a gpuswitch 0
to force using integrated GPU onlyOther nvram variables to try setting:
nvram gpu-policy=%01
to force using integrated GPU only, might be related/corresponding to the nvramgpu-power-prefs
variable, but setting the latter won't set the former.nvram GfxMode=4
sets the Mac to use the integrated GPU (iGPU) at boot and powers down the discrete GPU (dGPU; e.g. the AMD Radeon card) completely. But it didn't seem to do anything, so I just removed/nullified it withnvram GfxMode=
.nvram boot-args="agc=-1"
sets the Apple Graphics Controller on Macs with dual GPUs. Model-dependent, may not have an effect on newer Macs.nvram boot-args="agc=-1" -v"
to combine setting the agc boot arg as well as -v which gives verbose mode boot. I think this might have been key to finally getting it all to work.nvram -p
to see nvram variables and what they are set to.Notes that may be of help:
sleep (
pmset sleepnow
) and displaysleep (displaysleep 1
minute) and waking up from them seems to work without crashing and rebooting.AppleBacklight.kext
is a kernel extension (kext) in macOS that controls the display backlight. It manages the backlight's brightness, usually by adjusting a PWM signal (pulse-width modulation). This kext is crucial for enabling users to adjust screen brightness using the brightness keys or slider in system settings.In macOS Sequoia in Safe Mode (hold SHIFT to startup/boot the machine) - where all the display brightness/backlight controls work natively, even with a defective GPU - then these are the relevant loaded kernel extensions (kexts) and drivers, seen by running
kextstat | grep -i -E 'mux|amd|graphics|backlight'
(they are also loaded in normal mode):AppleBacklight (180.12)
is weird in macos safe mode, since it appears inkextstat
as loaded at first, but then apparently unloads after 2-5 minutes, disappearing from the list. Yet, adjusting display brightness / backlight continues to work (in safe mode), regardless.In normal mode - where display brightness/backlight controls are disabled / fails - these additional kexts and drivers are loaded:
To restore the display brightness / backlight functionality I did try:
AppleMuxControl.kext
andAppleMuxControl2.kext
with an oldAppleMuxControl.kext
that worked in macOS Sierra.Potential workarounds not tried (I gave up before attempting this):
/Volumes/Macintosh\ HD/System/Library/Extensions
in Recovery Mode is not enough in Sequoia. The system will still load the kext from its sealed kernel collection unless you properly rebuild the collection, update the system seal, and bless the new snapshot—a process that is not straightforward and is intentionally restricted by Apple to protect system integrity" said perplexity.ai when I inquired how to prevent Sequoia from loadingAMDRadeonX4000.kext
even though I had removed it from the Extensions folder. But "rebuilding the kernel collection is only relevant for third-party kexts ad requires specific permissions and reduced security settings. You cannot rebuild or modify the kernel collection to exclude essential system kexts likecom.apple.kext.AMDRadeonX4000
on modern macOS." according to perplexity.ai. The system kexts (like AMDRadeonX4000) are a part of the Boot Kext Collection (BKC) or System Kext Collection (SKC) which are managed by Apple and cannot be modified by users. Even if you try to rebuild the kext collections withkmutil
, the system will not allow you to remove or exclude essential Apple kexts".Verified dead ends:
gSwitch
/gfxCardStatus
apps didn't work, since they only disable the GPU switching after booting into macOS, but the faulty GPU prevented macOS to load because macOS tries to exercise it during boot. After the more fundamental NVRAM solution enabled macOS booting up correctly, these apps didn't help to re-enable display brightness / backlight, either (they just failed, since they couldn't detect the GPU in the system any longer, due to the NVRAM fix preventing macOS from loading the GPU). If anything, you might have the best luck with steveschow fork of gfxCardStatus which contains some interesting links.Learnings from perplexity.ai about other potential dead ends (not verified):
kmutil
is not a viable tool for preventing Apple’s own graphics/display kexts from loading in normal mode on macOS Sequoia. Its scope is limited to auxiliary (third-party) kext management, and the system’s security model blocks modification or exclusion of Apple’s built-in kexts through this method"