- Since 2013 and kernel version 3.9, it is now possible to passthrough a physical GPU to the QEMU VM.
- This thread is aimed to provide a short reference on how to make it all work and a place to discuss problems about making it work.
- Please note, there was an archlinux bbs thread with 200+ pages, which you've probably found by using some web search engine. But the archlinux BBS is dedicated to providing support for arch distribution only. And the OP-post(and all derived guides and wiki pages) are now outdated.
- This thread is one of the group of threads about GPU passthrough. There are threads for:
- Arch <==LINK
- Ubuntu <==LINK
- Debian <==LINK
- Gentoo <==LINK
- Most of these forums have a "$distribution-only rule", and if your distro doesn't have a thread for you - feel free to create it.
- The main working component is a kernel module called vfio-pci, written by Alex Williamson. He has a pretty good and in-depth guide written on his blog(URL).
- Below is a short compilation of code snippets and instructions to make it work quickly.
- Known issues:
- I haven't personally observed anyone doing this on a laptop. There was people who tried, but failed.
- First of all, your CPU should have IOMMU support.
- Most AMD platforms have a BIOS/UEFI setup option, some intel platforms need to be checked on ark.intel.com(LINK). For example, there's i7-4770K, which doesn't support Intel VT-d, but i7-4770 does.
- Intel CPUs and chipsets sometimes have bad IOMMU groups, this can be worked around by ACS override patch(https://lkml.org/lkml/2013/5/30/513). Read about IOMMU grouping and ACS in detail on aw's blog.
- AMD FX CPUs generally show good support, however there are (mostly ASUS) motherboards present with the broken ACPI IVRS table. If your table is broken - you will be warned about this in dmesg when loading the amd_iommu kernel module. You might have a chance to fix it by kernel command line parameters, but i haven't observed anyone successfully doing that.
- AMD FM2 socket APUs and CPUs aren't used often, but the issues are:
- Broken VGA(needs testing)
- Broken hugepages.
- General instability.
- Some HD7XXX-series cards have problems with UEFI support, even if there's a driver in the ROM, it may be broken. It is possible to try and combine as originally described there(http://www.insanelymac.com/forum/topic/299614-asus-eah6450-video-bios-uefi-gop-upgrade-and-gop-uefi-binary-in-efi-for-many-ati-cards/). Please note that the EFIRom tool is a part of EDK2-tools.
- Some cards had device reset problems, as you couldn't launch a VM twice. This issue was resolved previously(http://vfio.blogspot.ru/2015/04/progress-on-amd-front.html) and the patch should be in fresh upstream QEMU and kernel.
- The Code 43 problem.(https://awilliam.github.io/presentations/KVM-Forum-2014/#/5/2) Most nvidia drivers set the card offline when the VM is detected. This is mostly related to KVM CPUID signature and Hyper-V enlightenments.
- If you've been struck with Code 43 error, you can try disabling those features:
- QEMU Commandline:
- -cpu ...,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time
- Add those options to enable Hyper-V. Delete them and add kvm=off to hide the KVM signature and Hyper-V features.
- Those lines enable the Hyper-V. Remove them to disable.
- <relaxed state='on'/>
- <vapic state='on'/>
- <spinlocks state='on' retries='8191'/>
- <clock ...>
- <timer name='hypervclock' present='yes'/>
- CPUID signature hiding:
- <hidden state='on'/>
- The Hyper-V enlightenment doesn't give a huge performance boost, so don't worry much about it. Usually performance hit is neglected by the use of new drivers for the GPU.
a guest Aug 6th, 2015 518 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data