User Tools

Site Tools


public:gpu-passthrough

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
public:gpu-passthrough [2015/11/13 01:24] squirespublic:gpu-passthrough [2015/11/13 20:29] (current) – [References] admin
Line 1: Line 1:
 ====== GPU Passthrough ====== ====== GPU Passthrough ======
  
-GPU passthrough refers to configurations where a graphics card is reserved for use by a virtual machine. Making use of VT-d, IOMMU, and related technologies, the graphics card can be used at native performance.+GPU passthrough refers to configurations where a graphics card is reserved for use by a virtual machine. Making use of IOMMU, the graphics card can be used at native performance.
  
 This page first describes the process in general and then my specific system configurations. This page first describes the process in general and then my specific system configurations.
Line 13: Line 13:
 ==== VT-d ==== ==== VT-d ====
  
-The CPU, motherboard, and BIOS **must** support VT-d. Check [[http://ark.intel.com/|ARK]] for CPU support. Note that K (unlocked multiplier) CPUs historically did not have VT-d support, but Haswell Refresh and Skylake do.+The CPU, motherboard, and BIOS **must** support VT-d. Check [[http://ark.intel.com/|ARK]] for CPU support. Note that K series (unlocked multiplier) CPUs historically did not have VT-d support, but Haswell Refresh and Skylake do.
  
 +==== IOMMU Groups and ACS ====
 +
 +The guest graphics card needs proper IOMMU isolation from other devices on the PCIe bus. It should be alone in its own IOMMU group. This ensures no DMA transfers will occur between devices without being translated by the IOMMU.
 +
 +If you have a Xeon E5 processor, it will probably support ACS. Your PCIe devices will be isolated in their own IOMMU groups. Some socket 2011 CPUs also support ACS (according to the datasheets).
 +
 +If your processor doesn't support ACS, but your chipset is affected by the root port isolation quirk, then your graphics cards might still be isolated. You can use <q>find /sys/kernel/iommu_groups/ -type l</q> or the iommu_groups.sh script to view what devices are in each group.
 +
 +++++ iommu_groups.sh |
 +<code>
 +#!/bin/sh
 + 
 +# List the devices in each IOMMU group, from AW at
 +# https://bbs.archlinux.org/viewtopic.php?id=162768&p=29
 + 
 +BASE="/sys/kernel/iommu_groups"
 + 
 +for i in $(find $BASE -maxdepth 1 -mindepth 1 -type d); do
 +        GROUP=$(basename $i)
 +        echo "### Group $GROUP ###"
 +        for j in $(find $i/devices -type l); do
 +                DEV=$(basename $j)
 +                echo -n "    "
 +                lspci -s $DEV
 +        done
 +done
 +</code>
 +++++
 +
 +If your guest graphics card is not isolated, you can try moving it to a different slot on your motherboard to see if that slot has better isolation. Some slots are connected to the processor PCI lanes, which only have isolation if your processor supports ACS. Other slots are connected to the PCH PCI lanes, which may have isolation on root ports.
 +
 +If you don't have isolation on any PCI slot and you don't need the devices that share the guest graphics card's IOMMU group, you can bind the extra device to either of the vfio-pci or pci-stub drivers.
 +
 +As a last resort, you can try using the ACS override kernel patch. However, this does not create isolation. It merely hides the fact that isolation doesn't exist. Devices in the same real IOMMU group could still perform DMA transfers within another's address space.
 ==== Graphics Cards ==== ==== Graphics Cards ====
  
Line 22: Line 56:
  
 ^ Host Device ^ Guest Device ^ Guest Device UEFI-enabled ^ Result                                ^ ^ Host Device ^ Guest Device ^ Guest Device UEFI-enabled ^ Result                                ^
-| GPU         | GPU          | Yes or No                 | OK                                    +| GPU         | GPU          | Yes or No                 | OK                                   
-| GPU         | IGP          | Yes or No                 | Invalid                               +| GPU         | IGP          | Yes or No                 | Invalid                              
-| IGP         | GPU          | No                        | Requires VGA arbitration kernel patch | +| IGP         | GPU          | No                        | Requires VGA arbitration kernel patch; DRI will be disabled 
-| IGP         | GPU          | Yes                       | Use OVMF firmware                     |+| IGP         | GPU          | Yes                       | Use OVMF firmware; can still use DRI |
  
 Virtualization is fully supported by NVIDIA Quadro cards. GeForce cards will work, but require that the virtualization be hidden from NVIDIA drivers. Virtualization is fully supported by NVIDIA Quadro cards. GeForce cards will work, but require that the virtualization be hidden from NVIDIA drivers.
 +
 +GeForce 600 series cards probably did not ship with a UEFI firmware, but one can be flashed onto them. Check the manufacturer's site for an update, or use [[http://www.win-raid.com/t892f16-AMD-and-Nvidia-GOP-update-No-requests-DIY.html|GOPupd]].
  
 ====== Xeon E3-1275 ====== ====== Xeon E3-1275 ======
Line 129: Line 165:
   * Use the i914.enable_hd_vgaarb patch (and lose DRI).   * Use the i914.enable_hd_vgaarb patch (and lose DRI).
   * Use a guest GPU that supports UEFI and use the OVMF boot firmware to start the virtual machine. (OVMF can initialize the GPU using legacy-free UEFI, keeping DRI and bypassing VGA and the need for arbitration.)   * Use a guest GPU that supports UEFI and use the OVMF boot firmware to start the virtual machine. (OVMF can initialize the GPU using legacy-free UEFI, keeping DRI and bypassing VGA and the need for arbitration.)
- 
-===== References ===== 
- 
-[[https://wiki.debian.org/VGAPassthrough|Debian Wiki: VGAPassthrough]] 
  
 ====== Core i5-4690K ====== ====== Core i5-4690K ======
Line 139: Line 171:
  
 ===== Kernel ===== ===== Kernel =====
 +
 +====== References ======
 +
 +[[http://vfio.blogspot.com/|VFIO tips and tricks]]
 +
 +[[https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF|ArchWiki: PCI passthrough via OVMF]]
 +
 +[[https://www.reddit.com/r/linux_gaming/comments/3lnpg6/gpu_passthrough_revisited_an_updated_guide_on_how/|GPU Passthrough Revisited - An Updated Guide On How To Game In A Virtual Machine]]
 +
 +[[http://www.se7ensins.com/forums/threads/how-to-setup-a-gaming-virtual-machine-with-gpu-passthrough-qemu-kvm-libvirt-and-vfio.1371980/|How to setup a gaming virtual machine with GPU passthrough (QEMU, KVM, libvirt, and VFIO)]]
 +
 +[[http://ubuntuforums.org/showthread.php?t=2266916|Windows Gaming VM - KVM / UEFI Version - HowTo]]
 +
 +[[https://wiki.debian.org/VGAPassthrough|Debian Wiki: VGAPassthrough]]
  
  
  
  
public/gpu-passthrough.1447377896.txt.gz · Last modified: 2015/11/13 01:24 by squires

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki