Rachel's Yard

| A New Continuation
Tags GPU Passthrough

July 2016: This guide should still work with Ubuntu 16.04 and Debian 8

My Xeon-D system is certainly nice. However, why don't I just code on my (beautiful) 4K display and with my (LOUD) mechanical keyboard? Coding on Windows is not exactly very forgiving (font rendering, scaling, git, etc). Therefore, I want to install something different than Windows on the machine...

-Well, here are my attempts:

  1. ESXi 6.0 with Mac Unlocker 2.0.7, Mac OS X with PCI-E Passthrough, cannot boot (bootloop)
  2. Linux Mint, couldn't get nVidia drivers to work (Maybe the ASpeed GPU is interfering)
  3. Ubuntu Mate, couldn't get nVidia drivers to work (Maybe the ASpeed GPU is interfering

OK, that took me 24 hours. FAILED. So browsing the Interweb had gave me some new ideas...

So here's the deal:

Standard Disclaimer: Your Mileage May Vary. I'm Not Responsible for ANY Damage (mental and/or physical).

  1. Install Ubuntu, I'm using 15.04 Server. You should also update your kernel to v4.0.0. It will get rid of the "xHCI xhci_drop_endpoint called with disabled ep" errors when you are using USB passthrough.
  2. sudo apt-get install qemu-kvm
  3. in /etc/default/grub,
  • 1
    GRUB_CMDLINE_LINUX_DEFAULT="nomodeset intel_iommu=on pcie_acs_override=downstream pci=assign-busses igb.max_vfs=2"

  • Notice: "pci=assign-busses igb.max_vfs=2" were for my i350 SR-IOV. You can ignore them if you do not have SR-IOV in mind.

  1. In etc/modprobe.d/local.conf (new file):
  • 1
    options vfio-pci ids=1002:ffffffff:ffffffff:ffffffff:00030000:ffff00ff,1002:ffffffff:ffffffff:ffffffff:00040300:ffffffff,10de:ffffffff:ffffffff:ffffffff:00030000:ffff00ff,10de:ffffffff:ffffffff:ffffffff:00040300:ffffffff
  1. Reboot
  2. Create a "vfio-group" file to map vfio group. In my case, my nVidia GTX 970 is in group 24, and my SR-IOV VF is group 28. run "./vfio-group 24" to create vfio group for your GPU
  3. Obtain a copy of SeaBIOS. I'm putting it under /vm. OVMF is fine if you would like but SeaBIOS is fine with VFIO.
  4. Start the VM; taskset is for CPU affinity. Adjust the parameters accordingly.
  5. Because nVidia is a bitch. If you are running a virtual machine and want to use GPU passthrough in Windows, a nasty Code 43 Error will pop up. What you can do is pass "kvm=off" in the -cpu parameter (eg. -cpu host,kvm=off) and use an older driver. I have a GTX 970, so I have to use a "later" driver. I'm using 347.88 driver.
  6. Since I'm using virtio-scsi driver, which is supposedly superior to virtio-blk. You need the latest virtio-win ISO for the driver, which can be obtained here.
  7. I have a Dell USB Soundbar attached under my monitor. If you passthrough the soundbar to the VM and found that the sound is choppy, make sure that you change the frequency in Properties to 48000 Hz (DVD Quality). The default is 44100 Hz (CD Quality), which gives static when you play sound.

Bam, I got output on my monitor, and I can use my mouse and keyboard with USB passthrough.

Credits:

1
Weightless Theme
Rocking Basscss
RSS