I happen to have the exact same computer as you. What I devised is to add a few lines to grub to disable the discrete graphics at the efi level:
$ cat /etc/grub.d/10_linux
# Use ELILO's generic "efifb" when it's known to be available.
# FIXME: We need an interface to select vesafb in case efifb can't be used.
if [ "x$GRUB_GFXPAYLOAD_LINUX" = x ]; then
echo " load_video" | sed "s/^/$submenu_indentation/"
else
if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then
echo " load_video" | sed "s/^/$submenu_indentation/"
fi
fi
if ([ "$ubuntu_recovery" = 0 ] || [ x$type != xrecovery ]) && \
([ "x$GRUB_GFXPAYLOAD_LINUX" != x ] || [ "$gfxpayload_dynamic" = 1 ]); then
echo " gfxmode \$linux_gfx_mode" | sed "s/^/$submenu_indentation/"
fi
echo " outb 0x728 1" | sed "s/^/$submenu_indentation/"
echo " outb 0x710 2" | sed "s/^/$submenu_indentation/"
echo " outb 0x740 2" | sed "s/^/$submenu_indentation/"
echo " outb 0x750 0" | sed "s/^/$submenu_indentation/"
echo " insmod gzio" | sed "s/^/$submenu_indentation/"
echo " if [ x\$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi" | sed "s/^/$submenu_indentation/"
I just added the outb lines in between the insmod gzio
and linux_gfx_mode
. For reference:
outb 0x728 1 # Switch select
outb 0x710 2 # Switch display
outb 0x740 2 # Switch DDC
outb 0x750 0 # Power down discrete graphics
This disables the graphics at the pcie-link level, such that it vanishes from the system. Unlike macOS, the IronLake Intel HD Graphics can drive the external display output, but without audio.
What you described as the mac disabling igpu unless booting macOS holds true for any mac made after 2010, or any mac with a Sandy Bridge chip or later. (2010=nehalem, 1st gen 45nm.) The apple_set_os.efi trick does not work before 2011 (pre-2011, at the time, anything booted with efi would behave exactly like macOS, efi didn't check the OS, just that it was booted natively, enabling the integrated graphics. And the only way to boot an OS with igpu disabled was to legacy boot, which we are not doing) I tried running it, and it prints that the apple_set_os protocol was not found. I run 16.04.3 stable and it is such a nice experience once you can use the computer without crashes.
About the nvidia proprietary drivers: I did some opengl testing with dolphin-emu and DRI_PRIME=1 booting without outb 0x750, therefore disabling the dGPU's connection to the lvds display, but leaving it available headless for rendering. Nouveau and proprietary have nearly the same performance. (in fact, the majority of edge cases here were won by nouveau) The NV50/Tesla architecture is perhaps the best supported by nouveau. Therefore, I would actually recommend staying on nouveau.
Lastly, to enable intel graphics on boot permanently (as long as nvram variables are not erased) you can do this from linux:
mount -t efivarfs rw /sys/firmware/efi/efivars/ # make sure efi is mounted
sudo bash -c 'printf "\x07\x00\x00\x00\x01\x00\x00\x00" > /sys/firmware/efi/efivars/gpu-power-prefs-fa4ce28d-b62f-4c99-9cc3-6815686e30f9'
You can also accomplish the exact same thing from macOS as well:
sudo nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00