Skip to content

Instantly share code, notes, and snippets.

@cdleon
Last active June 19, 2025 16:59
Show Gist options
  • Save cdleon/d1eff7246a25193304284ecec40445b0 to your computer and use it in GitHub Desktop.
Save cdleon/d1eff7246a25193304284ecec40445b0 to your computer and use it in GitHub Desktop.

Works for macOS Sierra and High Sierra (Improved version)

Taken from StackExchange

Thanks to LangLangC

For temperature and other improvements see https://gist.github.com/cdleon/d16e7743e6f056fedbebc329333d79df

This method leaves brightness control enabled

Reset SMC

Shutdown, unplug everything except power and hold

leftShift + Ctrl + Option + Power 

I holded for 5 seconds, but holding just for an instant should work

Reset NVRAM: Power up and hold

Command + Option + p + r

Until you hear the startup chime two times.

Shutdown computer

Power up and boot into Single User Recovery by holding

if you are on high sierra 10.13.6+ you might need to use Command + r instead

Command + r + s

Disable SIP (This takes a bit to complete so wait for it)

csrutil disable

Disable Discrete GPU on boot by running

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

Enable verbose boot mode (This will show text everytime you boot up, shutdown or restart your mac)

nvram boot-args="-v"

Reboot

reboot

Boot into Single User-mode by holding

Command + s

It might look as if it hanged, but press enter and you should see the shell (root#)

Mount root partition writeable

/sbin/mount -uw /

Make a kext-backup directory

mkdir -p /System/Library/Extensions-off

Move ONLY ONE offending kext out of the way

mv /System/Library/Extensions/AMDRadeonX3000.kext  /System/Library/Extensions-off/

Inform the system to update its kextcache:

touch /System/Library/Extensions/

Reboot

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

BIG CAVEAT FOR APPLE UPDATES

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.

@redbar0n
Copy link

redbar0n commented Jun 10, 2025

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 called nvram_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):

csrutil status
csrutil disable
csrutil authenticated-root disable

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:

cd /Volumes/Macintosh\ HD/Users/<username>/System/Library/
mkdir Extensions-off/
mv Extensions/AMD* Extensions-off/

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 older kextcache -i /Volumes/Macintosh\ HD/ or touch /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.

After making changes, the system volume must be "blessed" to create a new signed snapshot that the Mac can boot from. This is necessary because, starting with macOS Catalina, the system volume is read-only and uses cryptographically signed snapshots for integrity and security. The bless command is used in Terminal to set the modified snapshot as the bootable system volume. This process tells the Mac to use your modified system as the startup disk. After blessing, you reboot the Mac, and it will boot from your new, altered system snapshot. Without this step, your changes won’t be recognized at boot, or the system may refuse to start due to integrity violations.

See the preexisting snapshots:

diskutil apfs listSnapshots /Volumes/Macintosh\ HD/

I recommend moving the kext files and creating a blessed system snapshot afterwards (in recovery mode). The usual way has been with:

bless --folder /Volumes/Macintosh\ HD/System/Library/CoreServices --bootefi --create-snapshot

But the newer way (since bless may be deprecated) is instead to do:

-s creates the snapshot:

/Volumes/Macintosh\ HD/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_systemsnapshot -s "NoGPUKext" -v /Volumes/Macintosh\ HD/

-r sets the snapshot as the one to use as root on the next boot and onwards:

/Volumes/Macintosh\ HD/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_systemsnapshot -r "NoGPUKext" -v /Volumes/Macintosh\ HD/

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:

diskutil apfs listSnapshots /Volumes/Macintosh\ HD/

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 variables
pmset -a gpuswitch 0 to force using integrated GPU only

Other nvram variables to try setting:

nvram gpu-policy=%01 to force using integrated GPU only, might be related/corresponding to the nvram gpu-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 with nvram 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):

IOGraphicsFamily (599)
AppleGraphicsDeviceControl (8.1.10)
AppleIntelCFLGraphicsFramebuffer (23.0.0)
AppleBacklightExpert (180.12)
AGDCBacklightControl (8.1.10)
AMDSupport (7.0.0)
AMD9500Controller (7.0.0)
AppleGraphicsControl (8.1.10)
AppleMuxControl2 (8.1.10)
AppleGraphicsDevicePolicy (8.1.10)
AMDFramebuffer (7.0.0)

AppleBacklight (180.12) is weird in macos safe mode, since it appears in kextstat 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:

AppleIntelKBLGraphics (23.0.0)
AMDRadeonX4000HWServices (7.0.0)
AMDRadeonServiceManager (7.0.0)
AMDRadeonX4000 (7.0.0)
AMDRadeonX4100HWLibs (1.0)

To restore the display brightness / backlight functionality I did try:

  • Replace AppleMuxControl.kext and AppleMuxControl2.kext with an old AppleMuxControl.kext that worked in macOS Sierra.

Potential workarounds not tried (I gave up before attempting this):

  • WhateverGreen since it "Fixes the PWM* backlight control of the built-in display that is directly wired to AMD Radeon RX 5000 series graphic cards". See their AMD Radeon FAQ. Radeon Pro 560X is found in the 2018 15-inch MacBook Pro. But the Radeon RX 5000 Series (Pro 5000M) is found in the 16-inch MacBook Pro (2019+) and 27-inch iMacs (2020+). * "The acronym PWM stands for Pulse Width Modulation, and it is a method used to control the brightness of a backlight, particularly in LCD displays. It works by rapidly switching the backlight on and off at a frequency that the human eye perceives as a steady, dimmed light.". WhateverGreen is based on Lilu which is "An open source kernel extension bringing a platform for arbitrary kext, library, and program patching throughout the system for macOS."
  • https://doslabelectronics.com/Demux - dosdude1's most recent fix (after he gave us the gpudisable NVRAM fix), which allegedly restores display backlight control and fixes potential sleep mode issues. But it is for older Macbooks, and even though it has steps for macOS > High Sierra (macOS 10.13), it says "Backlight control is not yet available for macOS Big Sur" (macOS 11). So it's doubtful if it works on even later macOS versions such as Sequoia (macOS 15).
  • Luis Puerto's guide is similar to the current gist you are reading, but has some interesting nuances maybe worth trying.
  • "Removing a kext from /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 loading AMDRadeonX4000.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 like com.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 with kmutil, 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"
  • "At this time, there is no confirmed, community-verified evidence that OCLP root patches restore display backlight functionality on the 2018 MacBook Pro in normal mode on macOS Sequoia. If this feature is critical, you should monitor OCLP’s official documentation and community forums for updates, as support for T2 Macs may improve in future releases."
  • On older models, users have manipulated NVRAM variables or replaced specific kernel extensions (like AppleMuxControl.kext) to force iGPU-only operation and restore backlight control. However, these methods are not confirmed to work on T2 Macs or in recent macOS versions like Sequoia, and may cause boot failures or loss of external display support.

@redbar0n
Copy link

Link to another gist thread with some more fixes like creating a rescue thumb drive that you can use every time you are having trouble booting macOS: blackgate/mbp2011-disable-amd-gpu.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment