You are not logged in.

#1 2015-05-14 02:06:16

rb3
Member
Registered: 2012-09-17
Posts: 9

Is KVM VGA Passthrough Possible on Macbook Pro Mid 2014?

I've been using Arch on and off for a couple years on different hardware, and this time I'm trying to get it to work semi-flawlessly on my mid 2014 Macbook Pro. My Linux skills are meager, so I need some help understanding if VGA passthrough is possible on this machine, and if it is, how to set it up. I have hope that it might work after reading this blog and the Arch forums. An outline of my current setup follows. I will also document progress and research for anyone who might want to try this in the future.

Here are the specifications for this machine:

 Processor: 2.5 GHz Intel Core i7
 Memory: 16 GB 1600 MHz DDR3
 Graphics: Intel Iris Pro 1536 MB, Nvidia GT 750M 2 GB

I have successfully dual-booted Mac OS X Yosemite and Arch with EFI on a BTRFS partition using this blog and the wiki as starting points. Somlo's research also helped. All the basic functionality works (networking, WiFi, etc.), and I am able to boot the physical Arch partition as a Virtualbox VM with the help of the wiki. However, I'm having trouble with getting the integrated Intel graphics to work. The following command:

 lspci | grep VGA

prints the Nvidia card specifications, and nothing about the Intel graphics.

It looks like someone had to apply a "grub gmux" patch to GRUB to disable the Nvidia card at boot. I feel uncomfortable installing anything other than the official Arch packages, so I have to know if installing a patched grub is still necessary, and if installing it would still allow me to use VGA passthrough in KVM.

My ambitious to-do list looks like this:

 1. Dual-boot Mac OS X and Arch with btrfs. -done
 2. Setup the physical Arch partition to boot in Virtualbox. -done
 3. Get Intel graphics to work on Arch ideally with OpenGL support. -done
 4. Get Enlightenment working as the desktop environment on Arch. -done
 5. Get Qemu+KVM to boot off the physical Mac OS X partition. -tbd
 6. Enable VGA passthrough for Mac OS X from Qemu+KVM. -tbd
 7. Install Windows as a VM in Qemu+KVM. -tbd
 8. Enable VGA passthrough for Windows from Qemu+KVM. -tbd
 9. Work and do research on Mac OS X from Arch, play hardcore 3D games on WIndows from Arch, play around with Arch, and live happily ever after. -tbd

Can anyone help me with this? Thanks in advance for any hints/input.

Edit:
The Ubuntu forums has something about getting the two graphics cards to be recognised by using REFIND instead of GRUB. I was able to set up REFIND to boot using the efi-stub, but:

$ lspci
00:00.0 Host bridge: Intel Corporation Crystal Well DRAM Controller (rev 08)
00:01.0 PCI bridge: Intel Corporation Crystal Well PCI Express x16 Controller (rev 08)
00:01.1 PCI bridge: Intel Corporation Crystal Well PCI Express x8 Controller (rev 08)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d5)
00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d5)
00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 (rev d5)
00:1c.4 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #5 (rev d5)
00:1f.0 ISA bridge: Intel Corporation HM87 Express LPC Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)
01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GT 750M Mac Edition] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GK107 HDMI Audio Controller (rev a1)
03:00.0 Network controller: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter (rev 03)
04:00.0 Multimedia controller: Broadcom Corporation 720p FaceTime HD Camera
05:00.0 SATA controller: Samsung Electronics Co Ltd Apple PCIe SSD (rev 01)
06:00.0 PCI bridge: Intel Corporation Device 156d
07:00.0 PCI bridge: Intel Corporation Device 156d
07:03.0 PCI bridge: Intel Corporation Device 156d
07:04.0 PCI bridge: Intel Corporation Device 156d
07:05.0 PCI bridge: Intel Corporation Device 156d
07:06.0 PCI bridge: Intel Corporation Device 156d
08:00.0 System peripheral: Intel Corporation Device 156c

...still only showed the Nvidia card. Fortunately, this very helpful discussion led me to this on-going project. I patched the kernel according the instructions in the said project's README, and Arch is now able to see the two graphics cards and an extra Intel audio controller.

$ lspci
 .
 .
 .
00:02.0 VGA compatible controller: Intel Corporation Crystal Well Integrated Graphics Controller (rev 08)[/bold]
00:03.0 Audio device: Intel Corporation Crystal Well HD Audio Controller (rev 08)
 .
 .
 .
01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GT 750M Mac Edition] (rev a1)
 .
 .
 .

Also, I was able to fire up Enlightenment using the Intel graphics card and 0xbb's `gpu-switch` script. After using some post-installation tips, the computer started getting hot. I followed this thread to get it back to normal.

Edit:
So I finally got some time to experiment on this. I ended up installing Gnome 3 after trying out Enlightenment, KDE Plasma 5, and Cinnamon. I thought Gnome 3 and Cinnamon had the best Hi-DPI support of those four. Cinnamon's look was too much trouble for me to configure, so I ended up choosing Gnome 3.

To achieve the graphics card passthrough, I tried setting up and starting a VM in `virt-manager`, but starting the VM would cause Arch to freeze. Finally, I tried following the instructions on the wiki, this thread, and the Arch forums. I haven't yet tried booting the Windows installer, but the following are the steps I took so far:

1. Uninstall all 'nvidia' drivers from my system.
2. Blacklist the 'nouveau' driver.
3. Add 'pci-stub' to the modules array in mkinitcpio.conf.
4. Recreate the 'initramfs'.
5. Add 'intel_iommu=on pci-stub.ids=10de:0fe9,10de:0e1b,8086:156c' to the refind.conf 'options' line. 
        - These three IDs are ones for the Nvidia graphics, Nvidia sound, and the "Intel Corporation Device" (probably the HDMI port, or something related to the 
          ethernet card), which belong to the same "IOMMU group". What was curious was that a Gigabit ethernet controller would appear in the IOMMU group iff I had 
          an ethernet cable connected to my thunderbolt port. I don't know if I have to add the ID for this, but so far there are no complaints about it in `dmesg`.
6. Install 'ovmf-svn' from the AUR.
6. Follow the "Binding a device to vfio-pci" section documented at https://bbs.archlinux.org/viewtopic.php?id=162768.
7. Follow the "Testing if its working out" section documented at https://bbs.archlinux.org/viewtopic.php?id=162768.

The test at step 7 is failing -- I get a 'vfio-pci 0000:01:00.0: Invalid ROM contents' complaint in `dmesg`, and I see a prompt in the QEMU window. I'm supposed to be getting a black QEMU window, and a prompt on an external monitor which I haven't connected yet.  It seems that I need to pass a ROM file for the Nvidia GT 750M card to qemu/KVM. Apparently, one can download the 750m rom files directly from Lenovo's website on the support page, but all I see is this. I will continue hunting around for a ROM file for this graphics card.

Edit:
So I finally found a way to extract the ROM from my graphics card, but I am still seeing the QEMU prompt in step 7 after passing it to the command line. I tried attaching a monitor to my HDMI port, but nothing is displayed on the monitor. It seems that my ROM does not support UEFI, according to the script described in this blog, so that might have something to do with it.

Next on the to-do list is to try to figure out how to create an EFI-compatible version of my ROM file.

Last edited by rb3 (2015-06-24 03:05:03)

Offline

#2 2017-08-15 13:45:29

chpio
Member
Registered: 2017-08-15
Posts: 1

Re: Is KVM VGA Passthrough Possible on Macbook Pro Mid 2014?

Have you been able to succeed?
I can not find an EFI compatible vga bios rom for the 750m either.

Offline

#3 2017-08-15 15:10:55

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: Is KVM VGA Passthrough Possible on Macbook Pro Mid 2014?

Please do not necrobump 2 year old threads, and the OP hasn't been online since that same time period, so it's unlikely that they would suddenly reappear. Try to do your own research if you intend to drive this further.

https://wiki.archlinux.org/index.php/Co … bumping.22

Closing.

Offline

Board footer

Powered by FluxBB