I did this on my 15" MBP 2011 with a failed dGPU after a failed NVRAM reset rendered my initial hack useless to boot into MAc OS, and the screen boots into black after grub.
If you have an Ubuntu USB installer/booter (mine's 18.4.20), boot into it, and when grub appears, type 'e' and edit the grub menu.
menuentry "Try Ubuntu without installing" {
set gfxpayload=keep
outb 0x728 1
outb 0x710 2
outb 0x740 2
outb 0x750 0
linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash i915.lvds_channel_mode=2 i915.modeset=1 i915.lvds_use_ssc=0 ---
initrd /casper/initrd
}
In this case, you can skip adding [nomodeset], the computer should boot into iGPU with a clean, undistorted screen, since [nomodeset] lets me boot into a green colored screen.
Do either of the two.
1) Install Ubuntu if your starting over, don't worry about partitioning and let Ubuntu erase everything (since you are using a blank drive) and do not include 3rd party drivers.
Reboot into the USB, and enter the same codes previously.
2) Assuming you're just going to edit the installed grub (and you haven't edited it before), reboot (pressing alt to boot into the USB). When the GUI comes up, open Files app> Other Locations >Computer> Boot> Grub, and look for the grub.cfg file.
Open a Terminal and type:
sudo chmod 777
Then drag the grub.cfg file into the terminal window. Press enter. This changes the file's permission to R/W.
Open the grub.cfg file, and look for the [menuentry 'ubuntu'] line. Below this is the [load_video] line. After this line, add
outb 0x728 1
outb 0x710 2
outb 0x740 2
outb 0x750 0
A few lines below that is the Linux kernel line. After 'quiet splash' add
i915.lvds_channel_mode=2 i915.modeset=1 i915.lvds_use_ssc=0
Which should give you something like this
This allows you to edit the grub to turn of the dGPU and switch into the iGPU.
Save the file, and do this in Terminal:
sudo chmod 444
then drag the grub file into the terminal window. If you haven't closed terminal yet, just issue the last sudo chmod command by pressing the up key and change 777 to 444, and this changes the file's permissions back to read-only.
This assumes you didn't reboot to test if it works.
Reboot the computer. Ideally, if you did things right, it should boot directly into Ubuntu, bypassing the grub entry altogether. You can still access the grub menu by pressing option/alt.
In my case, I did add [nomodeset] after quiet splash without adding the [outb] operands the first time around since I was basically shooting in the dark, trying everything I can just to be able to boot up into a desktop to install Ubuntu. The key (at least in this case) is editing the grub.cfg file of your install to include the outb and i915.lvds operands.
nomodeset
to the end ofGRUB_LINUX_CMDLINE_DEFAULT
in/etc/default/grub
and then runsudo update-grub
. However, some people have noted that this decreases graphics performance (low resolution, less sharp image).