You can permanently disable discrete graphics card following next steps:
UPDATE! Try to edit NVRAM variable from Single-User mode
The procedure described in the steps 1-3 worked for me until macOS Sierra, but with the upgrade to High Sierra, I started getting a pinkish/reddish screen and I was unable to enter Recovery mode to repeat step 3 as I had to do in previous upgrades. Searching in internet, I stepped into this GitHub issue explaining you may be able to replace steps 1 and 2 with the following command, that you can execute in Single-User mode (boot pressing cmd+s):
sudo nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00
1. Prepare a Bootable USB pendrive with a non GUI Linux
1.1 Download ArchLinux ISO
- You need a working computer for that and a spare CD/DVD/USB drive.
- Download the latest Arch Linux ISO image.
- Then you could either simply burn this ISO to CD/DVD (which later could be either inserted to MBP's SuperDrive or External DVD Drive connected to MBP by two USB cables) or create a bootable USB.
1.2 Creating the bootable USB with the .iso
- First, you need to identify the USB device.
Open /Applications/Utilities/Terminal in MacOS and list all storage devices:
diskutil list
Your USB device will appear as something like /dev/disk2 (external, physical)
. Verify that this is the device you want to erase by checking its name and size and then use its identifier for the commands below instead of /dev/diskX
.
A USB device is normally auto-mounted in macOS, and you have to unmount (not eject) it before block-writing to it with dd:
diskutil unmountDisk /dev/diskX
Now copy the ISO image file to the device. The dd command is similar to its Linux counterpart, but notice the 'r' before 'disk' for raw mode which makes the transfer much faster:
sudo dd if=path/to/arch.iso of=/dev/rdiskX bs=1m
After completion, macOS may complain that "The disk you inserted was not readable by this computer". Select 'Eject'. The USB device will be bootable.
2. Use Linux to change EFI vars
2.1 Boot to it
- Insert this CD/DVD/USB to Macbook Pro, hold Option key (alt) while booting.
- Choose "EFI boot" (that is your bootable installation media).
- When the menu shows, press "e" key to edit the GRUB options of the Arch Linux archiso x86_64 UEFI CD menu entry while it is selected at the main screen, add
nomodeset
to the end of this line and press Enter.
- If everything is done correctly, you will find yourself at the Linux console! (It takes some time so be patient and wait for the prompt)
2.2 Clear existing EFI vars
Looks like efivarfs filesystem is mounted by default! So you can already cd /sys/firmware/efi/efivars
and ls
to explore this directory and see if there is a gpu-power-prefs-...
variable (where ... is UUID of this variable).
If there is such a variable, it's better to remove it with rm.
rm gpu-power-prefs-…
If you are getting the "operation not permitted" message while attempting to rm
, it means that efivarfs has been mounted as read-only and you need to remount it with read-write permissions and try again:
cd /
umount /sys/firmware/efi/efivars/
mount -t efivarfs rw /sys/firmware/efi/efivars/
cd /sys/firmware/efi/efivars/
rm gpu-power-prefs-…
If this also fails (you still can’t erase the file), use chattr
command to disable file immutability and then erase the file:
chattr -i "gpu-power-prefs-…”
rm gpu-power-prefs-…
2.3 Create a new gpu-power-prefs-… file
printf "\x07\x00\x00\x00\x01\x00\x00\x00" > /sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9
2.4 Add immutability to the gpu-power-prefs-… file
This chattr
command is supposed to lock a file to make it accessible only by "superuser" - and so that, while booting, your EFI will have no chance to screw up your gpu-power-prefs-... variable under any circumstances
chattr +i "/sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9"
2.5 Unmount efivars and reboot
Change to the root directory to unmount efivars:
cd /
umount /sys/firmware/efi/efivars/
Guarantees that your EFI variables are flushed to efivarfs filesystem. Please unmount it safely before rebooting.
reboot
3 Remove AMD / NVIDIA kexts
Note: You might need to do this every time you update your OS, since it normally regenerates these kexts. You may want to favourite this answer for reference so it is accessible from another device when you need it.
After disabling the dGPU using Arch, normal boot would hang halfway but safe boot will work.
3.1 Move AMD / NVIDIA kext files to a backup directory
Remove all the AMD (or NVIDIA, depending on your card) kext files in the Terminal in Recovery Console. Trying to remove them in Single User just gives sandbox errors, so don’t do it in Single User Mode! (the one that you boot with cmd+s).
- If you have FileVault, unlock it first.
- Boot into Recovery (cmd+r) directly. If it fails, then repeat step 2 and retry (dGPU could get active again after booting into the os with AMD / NVIDIA kexts).
Start Terminal (This commands are for AMD. If you have NVIDIA, change accordingly)
diskutil cs list
(find Logical Volume UUID: last item)
diskutil coreStorage unlockVolume UUID
(UUID: from previous command)
cd /Volumes/Macintosh\ HD
mkdir AMD_Kexts
mv System/Library/Extensions/AMD*.* AMD_Kexts/
reboot
I found the procedure in this link, where you can read the attribution of the different sections and a discussion thread on the topic.
I tried it myself on an early 2011 MacBook Pro with a faulty discrete graphics card, that was unable to boot even with the overheating trick, and ended up with a fully functional computer!
Best Answer
Unfortunately, you cannot get the LCD panel model number from the command line as it's not stored in firmware as part of the monitor's EDID.
For example, I had to replace the the LCD of my 27" iMac due to an unfortunate incident involving a disobedient child and a fidget spinner. The model number for the panel was "LM270WQ1" where as the Apple PN# was "661-7169." Those numbers aren't present in any of the EDID data. See below
Using the
system_profiler
command:Using the
ioreg
command to get EDIDNeither have the actual panel info model because that's typically not put in by the display manufacturer. For this, you need to (unfortunately) disassemble the display and get the LCD panel model off the back. I recently replaced the LCD in a Mid-2007 MacBook (white) and it was imperative that I replace it with a compatible panel. I was inadvertently sent a panel for a later MacBook (2008) and while it physically fit and the LVDS connectors were compatible, the panel simply didn't work.