Play games in Windows on Linux! PCI passthrough quick guide

Ive use to use bridged networking so the VM got it own local IP address from my router. I have a linux VM on NAT with virtio as well I use a lot that has a SMB share that the host can see fine as well.

Ping test but it should work bridged networking for sure. Windows can sometimes take a while to see a share but it does work.

If I follow everystep up to the end, and everything was fine until there, what could be the cause of having no reaction from the second monitor? I keep getting an black screen. I tried to switch both uefi and bios mode in virt-manager, but still a black screenā€¦ I only get a screen when I install a spice server, and when windows is installed, in the device manager I get a standard windows driver and not my amd driver.

Be careful with saying this. Not all i-series have Integrated Graphics. I have an i7-6850k, which has a ton of features, but no graphics. I knew what I was getting into when I bought it though. Itā€™s best to just have people look up a prospective CPU on the manufacturer site to see what it supports, or get some help in doing so. Intel is pretty upfront with which processors can do what.

1 Like

If you are buying enthusiast-class CPUs then I fully expect you to know. :wink:

1 Like

True, but the problem with that mindset is that it ignores the standard audience of who will be reading the guide. :wink:

1 Like

Just chiming in with a ā€œsuccess storyā€ (still some tuning to do and so on).
Intel X299 (Asrock Fatality professional) running openSUSE Tumbleweed (hopefully Lunduke wonā€™t come in the dead of night to slit my throat for not doing pure opensource gaming), passing through a 1080ti in the PCIe1 slot.
I use an rx550 for the host (slot 3), and also passthrough a PCIe USB controller and a soundcard.

Used guides on this forum to get my bearings. Thanks guys!
And @wendell is a hero, yes I donated, and /r/VFIO is also cool. Also used this old one for SUSE as a guiding line. Took about an evening, and Iā€™m no Linux superman by any stretch.

Edit: openSUSE has pretty good official documentation as well, whoā€™daā€™thunkā€¦:rofl:

Hello guys,

First thank you GrayBoltWolf for your great tutorial. I was basicly triing to get this working on debian 8 since I built my PC in 2015, and only got it working after watching your tutorial and of last year.
Unfortunately I am running a i7 4790K (basicly haswell) for wich there is a known issue of hdmi sound not working when booting with intel_iommu=on (Mobo analog and digital audio works). Tried booting with intel_iommu=igfx_off, intel_iommu=on wich restores sound and breaks iommu grouping. So whenever I want to watch a movie I have to reboot without iommu ā€¦
This is a little annoying because it defeate the purpose.

Iā€™m considering buying a ā€œaorus Z270 gaming 7ā€ (with i7-7700K) and was wondering if someone around here knew if this card gives proper grouping ??

Hello,

I was playing with a gygabite GA-H270M-DS3H that I recently got on hand and saw the same issue. I was able to resolve it by adding intel_iommu=igfx_off to the kernel command line in grub.
Got proper iommu grouping (X16 pci slot was in group 1 with the intel pcie root port and the x4 pcie was alone in a separate group)

Where you able to solve your problem ?

Hi,

Is there an update for kernel 4.10 on ubuntu for the acs patch?

someone said that the vnc and all graphic devices should be disabled, but why? we just attach another device thatā€™s all, so it wonā€™t be detected in devices by windows if we donā€™t?

For the moment Iā€™ve managed to get the same result on lspci -k without the acs patch and I have added to the xml of my already existing win10 vm this part
qemu:commandline
<qemu:env name=ā€œQEMU_PA_SAMPLESā€ value=ā€œ4096ā€ />
<qemu:env name=ā€œQEMU_AUDIO_DRVā€ value=ā€œpaā€ />
<qemu:arg value="-device" />
<qemu:arg value=ā€œioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1ā€ />
<qemu:arg value="-device" />
<qemu:arg value=ā€œvfio-pci,host=[GPU],bus=root.1,addr=00.0,multifunction=on,x-vga=onā€ />
<qemu:arg value="-device" />
<qemu:arg value=ā€œvfio-pci,host=[Audio],bus=root.1,addr=00.1ā€ />
<qemu:arg value="-cpu" />
<qemu:arg value=ā€œhostā€ />
</qemu:commandline>

from here

but apparently beside the sound, the vm doesnā€™t receive the gpu as a deviceā€¦ So what am I missing here?

my setup is i7-6700k, host on the integrated graphic, the gpu is a gtx 970 . So the gpu is loaded with vfio, itā€™s blacklisted, so beside of the acs patch, I donā€™t understand what is missing.
Is it because of the acs patch? because of my xml?
thanks in advance

I have this working Ubuntu 17.10, with the default ich6

apparmor causes issues with the sound as well, there is a way to edit ā€˜/etc/apparmor.d/abstractions/libvirt-qemuā€™ so that only the things you need that apparmor is blocking get through, instead of disabling it alltogether.

but for now all I did in addition to this guide to get sound is the following:

sudo nano /etc/libvirt/qemu.conf
add these 3 lines, replace mario with your host user name:

user = "mario"
nographics_allow_host_audio = 1
security_driver = "none"

The ACS patch is no longer necessary.

You do need to remove all the VNC and graphics adapters from the VM and for Nvidia have the proper qemu flags to spoof the VM and HV flags.

Will you do an updated video for this? I subbed your channel but there was no content for a really long time now :smiley:

I installed Windows 10, and I could not for the life of me figure out why Starcraft 2 and heroes of the storm was crashing. Then I found this thread https://www.reddit.com/r/VFIO/comments/4o0bjk/how_to_fix_the_unsupported_msrs_in_win10/

I am going to install windows 8.1 instead, apparently it resolves the issue.

What I REALLY want to install is windows 7, but it always just hangs at the starting windows logo. Really wish I could figure out why windows 7 wont install.

Have to have an EFI capable OS. Iirc windows 7 is BIOS only

I really want to, but there is only so much time and energy left after a 50+ hour a week job.

And I need some ideas for videos.

Just posting a followup. I have installed windows 8.1 and Starcraft 2 and heroes of the storm no longer crash like they did with windows 10.

hopefully this will save some people some time, maybe you can add a note to your main guide that says some applications will crash if you use win10. Just as that article on reddit says: https://www.reddit.com/r/VFIO/comments/4o0bjk/how_to_fix_the_unsupported_msrs_in_win10/

1 Like

Great Tutorial GrayWolf!

New to Linux here but got it to work in just days. :smiley:.
I got the first GPU, (GPU1) to passthrough in VM1 and I see the GPU listed on DevManager (DM). Install the Nvidia Driver just fine, play like a boss.
The second, VM2, just doesnā€™t show the card, GPU2, in the DM. It list a Standard Microsoft Display device. When I try to update it with the Nvidia driver I get a blackscreen and a reboot T_T.

OS for both VMs: Win 8.1 64. Each got its own qcow image. Iā€™m not even trying to boot both at the same time yet.

Specs: GA-Z77M-D3H, i5-3470, 16GB, 500GB.
GPU1: ASUS GTX750Ti x16 (Main) / GPU2: EVGA GTX 750 x4 (the one nearly at the end).
The Gpus HAVE DIFFERENT IDs except for the HDMI audio which is the same :S.
OS: Debian 9.2.1 64 bits Kernel: 4.9.0. and I DIDNā€™T recompile the kernel because IOMMU Groups seems fine. G1 have only 3 IDS (2 from GPU1 + 1 the root), and the G12 have only 2 IDS from the GPU2. Host is using the iGpu from MB.

Files & Outputs / Configs Iā€™ve applied:

etc-default-grub
(https://gist.github.com/Lego007/2512f0874fc8966f1d1d9d31544ba8a2)

etc/modules
https://gist.github.com/Lego007/dac765e0c231a8eb62cbbf7f0b03bd84

IOMMU Groups
(https://gist.github.com/Lego007/356c780ad03689d4157af3fb8a8a6e29)

lspci -k
https://gist.github.com/Lego007/3c8d227bb2424099083bb3c5d33f7d03

[1_GTX750TI] Working.
https://gist.github.com/Lego007/4d0b30ef0539c0eb404bb0a5d80e4ee5

[2_GTX750] No Gpu in DM. Blackscreen when installing nvidia drivers.
https://gist.github.com/Lego007/dc477a34517fbbf7296272c875e95158

Any help would be highly appreciated. Many thanks in advance! :smiley:

If you could paste your lspci -k and VM configs into a reply, Iā€™m not too thrilled about opening mega files from strangers. :wink:

A clearly worded, step-by-step, not morbidly outdated, PCI passthrough tutorial?! Thought such a thing didnā€™t exist. I love you so much, THANK YOU.
Quick question about the 2 gpu requirement: Is it possible to ā€œmixā€ Nvidia and AMD gpus for that?
I got a R9 380, a Ryzen 5 cpu (thus, no igpu), and the closest to other AMD gpu I have is actually ATi, Radeon HD 4890ā€¦ and itā€™s summer where I liveā€¦
If a GTX 650 Ti works, Iā€™d much rather use that. Couldnā€™t catch anything about this after a quick read on the OP, hence my question.

Cheers!

I Am sorry to inform @Lex-Logica that the Nvidia GTX 650 Ti wonā€™t work, the earliest Nvidia card that might work are the 700 series.