Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save satmandu/2379f1c32b8c5e2bba80bf4239390716 to your computer and use it in GitHub Desktop.
Save satmandu/2379f1c32b8c5e2bba80bf4239390716 to your computer and use it in GitHub Desktop.
Getting a MacBookPro6,2 working with integrated graphics only with ubuntu.

FYI you can use the techniques mentioned here to get ubuntu working on your MBP 6,2 using only the integrated GPU:

http://forums.fedoraforum.org/showpost.php?p=1664873&postcount=10

Here are the steps I took, adapted from there:

edit /etc/default/grub and add the following line:

GRUB_PRELOAD_MODULES="iorw"

I also changed this line in the same file:

GRUB_CMDLINE_LINUX_DEFAULT="i915.modeset=1 nouveau.modeset=1"

Change this in /etc/grub.d/10_linux:

cat << 'EOF'
function gfxmode {
        set gfxpayload="${1}"
EOF
if [ "$vt_handoff" = 1 ]; then

to this:

cat << 'EOF'
function gfxmode {
        set gfxpayload="${1}"
EOF
echo " outb 0x728 1"
echo " outb 0x710 2"
echo " outb 0x740 2"
echo " outb 0x750 0"
if [ "$vt_handoff" = 1 ]; then

Here's what those do btw:

 outb 0x728 1 # Switch select
 outb 0x710 2 # Switch display
 outb 0x740 2 # Switch DDC
 outb 0x750 0 # Power down discrete graphics

Also you need to run this to update grub, and then reboot:

sudo update-grub
sudo /sbin/shutdown -r now

This is literally ALL I needed to do. I had installed 10.12.4 previously, which updated the EFI firmware, so I also reset my NVRAM with the command-option-P-R trick after rebooting to make sure there weren't any EFI variables left over which might be screwing with the framebuffer and GPU settings at boot.

I am also running a daily build clean install of Ubuntu 17.10 Artful Aardvark, which I think may have fixed some issues I was having with an upgrade to Zesty (Ubuntu 17.04) but you may be fine installing Zesty.

As it stands, the intel internal GPU is automatically detected, and the nvidia gpu is just never used.

(This is probably also using the internal apple_gmux driver functionality to see what is available when linux starts, so that maybe helps too.)

@satmandu
Copy link
Author

For Fedora here are updated instructions from July 2017 as per /u/waylanddesign which are mentioned here:

https://www.reddit.com/r/linux_on_mac/comments/6b0mgj/discrete_gpu_switching_question/

First install the grub2-efi modules:

dnf install grub2-efi-modules
cp -r /usr/lib/grub/x86_64-efi /boot/efi/EFI/fedora

Using your favorite text editor, open /etc/default/grub as a superuser and edit the following lines:

# Add "i915.modeset=1 nouveau.modeset=1" to the end of this line
GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet i915.modeset=1 nouveau.modeset=1"

# Add this line at the end of the file
GRUB_PRELOAD_MODULES="iorw"

Then open /etc/grub.d/10_linux in a text editor as superuser, and add the following lines under the lines that say 'echo "set gfxpayload". There are two of them right next to one another.

echo "    set gfxpayload=..."
# New commands here
echo "    outb 0x728 1"
echo "    outb 0x710 2"
echo "    outb 0x740 2"
echo "    outb 0x750 0"

Make sure the "echo" command lines up with the "echo" on the line above it, and "outb" lines up with the "set" command as well. For some reason it makes a difference for me, but I haven't tested it enough to know if it will on other systems.
Finally, update grub and reboot.

grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
reboot

@jeth318
Copy link

jeth318 commented May 29, 2022

5 years later, this hack saved my ass with 22.04 on my Macbook pro (6,2). Thank you, sir.

@satmandu
Copy link
Author

Glad to be of service. :)

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