September 15, 2019

Install Ubuntu on MacBook Pro 2011 with Broken Discrete GPU

For TL;DR people, here are the steps:

  1. Prepare a Ubuntu Desktop 18.04 LTS Live USB
  2. Start your machine with USB plugged in and select EFI boot
  3. Hit e to edit Try Ubuntu without installing entry and add nomodeset to the kernel command line
  4. Verify this version of Ubuntu works with your broken machine
  5. Install Ubuntu normally and reboot and select EFI boot again (don’t boot into the installed Ubuntu yet and you can’t)
  6. Hit c for the grub command-line
    • Find the partition where Ubuntu is installed (assuming (hd2,gpt2), more details from Marco Miglierina )
    • grub> set root=(hd2,gpt2)
    • grub> ls -l (hd2,gpt2) to find the partition UUID
    • grub> linux /boot/vmlinuz-x.y.z-xx-generic .efi.signed root=UUID=PARTITION_UUID nomodeset radeon.modeset=0
    • grub> initrd /boot/initrd-x.y.z-xx-generic
    • grub> boot
  7. You should see the normal Ubuntu boot process
  8. Login to Ubuntu and update the default grub config
    • Append nomodeset radeon.modeset=0 to the GRUB_CMDLINE_LINUX_DEFAULT line in /etc/default/grub
    • sudo update-grub
  9. Start the normal Ubuntu reboot sequence without the Live USB

About more than a year ago, I post a software hack to walkaround the broken AMD Radeon discrete GPU. Many people had the same issue and there are various posts and even paid services to fix the issue. For example, an automated utility from realmacmods or a custom FPGA firmware from ComputeCode (Disclaimer: I am not affiliated or connected with any of the company listed here).

In general, I am happy with the mod but it has some caveats. After each system upgrade, I have to reapply the patch. In certain circumstance, some software like Adobe Photoshop will accidentally activate the malfunctioned dGPU. The machine won’t wake up from sleep. This is tedious and annoying so I bought a new 2018 MacBook Pro instead. Three days ago, I want to give it one last try before throwing it away. I am installing Ubuntu this time. It wasn’t a smooth journey mostly because of the broken dGPU but I got it work.

I start with Ubuntu Desktop 19.04 Live USB, which is the latest Ubuntu I can find. There are many posts on how to create a Ubuntu Live USB from the Live CD. Balena Etcher is a handy utility. The boot process is simple. You plug the Live USB in, hold Option key, and power on the machine. Depending on your configuration, you may see more drives but you should see two EFI boots. Selecting either one will take me to the grub menu. This grub screen should be familiar to anyone who has installed Ubuntu before.

In order to verify if this version of Ubuntu has all the necessary drivers to boot the machine, I start the live Ubuntu first before wiping out the OSX installation. Ubuntu 19.04 introduced one new boot option Try Ubuntu without installing (safe graphics). Please use it. I think the difference is one additional kernel flag nomodeset in the kernel command line. The live Ubuntu will boot and the graphics/sound/function keys are all working. This is a very good sign. Wifi isn’t enabled because the live Ubuntu doesn’t have Broadcom b43 wireless driver installed. It might work if you install it but I didn’t test that. I installed Ubuntu normally and, of course, it failed to boot.

It is weird that the Live Ubuntu is working fine but the installed one doesn’t. I guess there are some differences in the kernel configuration because the Live Ubuntu tends to be conservative. I started the EFI boot again and used the grub command-line to boot the installed Ubuntu manually. I also added additional kernel flags nomodeset radeon.modeset=0 to disable the dGPU this time. Marco Miglierina has a good tutorial on how to do the manual boot, I followed steps in his post Ubuntu installation on USB stick with pure EFI boot (Mac compatible). It booted, well, right before showing the Ubuntu Login.

I vaguely remembered Ubuntu 19.04 had some issues with my Dell box as well so I started over again with Ubuntu 18.04 LTS. Ubuntu 18.04 doesn’t have the safe graphics option so I had to add the kernel flag myself. The rest of the steps were pretty much the same as Ubuntu 19.04 and I booted into grub command-line again after installation. I did a manual grub boot from the installed Ubuntu with the additional kernel flags. It booted into the desktop this time. Yay!

Wifi is also working fine after I installed the Broadcom b43 wireless driver. To disable the AMD discrete GPU, nomodeset radeon.modeset=0 is also added to /etc/default/grub. The dGPU is still there and consumes power but it won’t be activated when the kernel boots. Trying to upgrade Ubuntu 18.04 to Ubuntu 19.04 failed the boot. I will test again when Ubuntu 19.10 comes out. Again, it is better to retire the old and broken MacBook Pro and get a new model anyways.

© 2015-2019 Jiawei Huang

Powered by Hugo & Kiss.