Return to Level1Techs.com

Play games in Windows on Linux! PCI passthrough quick guide

iommu
vfio
passthrough

#142

just got around to doing this on suse... yast makes this friggin easy. like everything can be done from a gui.

i do have an actual question though, anyone messed with isolcpu with libvirt? libvirt doesnt seem to like working with those cpus even if i do the pinning in the xml. only solution ive found so far is to manually set the affinity of each of the vcpu processes after the vm starts.


#143

You need to enable the ACS override in your kernel parameters

pcie_acs_override=downstream


#144

So I ran everything and got to where we hook the GPU into the VM kernel. I'm not thinking it did, this was the output for the next step:

01:00.0 VGA compatible controller: NVIDIA Corporation Device 1be1 (rev a1)
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 11bc
Kernel driver in use: nvidia
Kernel modules: nvidiafb, nouveau, nvidia_367, nvidia_367_drm
01:00.1 Audio device: NVIDIA Corporation Device 10f0 (rev a1)
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 11bc
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel


#145

You either didn't load the vfio module or didn't add the boot parameter.


#146

Well it's not booting me to the Tux logo either. I followed the direction to a T, but I'm also on Mint. I did discover a typo but it didn't fix anything after changing it.


#147

I'm a bit late to the party, but for a more detailed guide it might be worth your time reading (or contributing to) this guide a few members from this forum and I put together over at the experimental wiki:

https://tekwiki.beylix.co.uk/index.php/VGA_Passthrough_with_UEFI%2BVirt-Manager


#148

This guide is written for Debian, not Ubuntu.


#149

Make sure that your host graphics card is set as the primary display device in the BIOS. If you don't have an option for this on the BIOS, the primary graphics adapter will most likely be set by the physical PCIE slot the card is installed in. Usually the first PCIE slot close to the CPU slot is used as the primary.

Also when I tested this on Ubuntu I had to blacklist the graphics driver as well in /etc/modprobe.d/blacklist.conf for the passthrough to work. I am assuming Mint will be the same.
Just to note, Ubuntu had older versions of virt manager and OVMF than what was used in this guide. They are prone to bugs, so you might want to watch out for that. But it wouldn't hurt to try.


#150

I gave up on it. As much as I want to use Linux as my primary OS I just don't have the desire to dual boot and getting it to work properly on this laptop is too much work and I just don't have the time to commit to getting it to work.


#151

I forgot you were doing this on a laptop. As I said before, there is no solution for PCI passthrough on a laptop, it will never work. Desktop only.


#152

Mostly true, but it should work on a Razer Blade Stealth + Core because then there is both onboard for the host and pcie graphics hardware for the guest.


Unfortunately, that isn't what Yockanookany has so this observation is just for the benefit of anybody shopping for a laptop and wanting to follow your excellent instructions.


#153

Doesn't work on laptops, there's more to it than just 2 graphics controllers.


#154

Hi everyone

Your step by step tutorial is great. I had tried and failed several times to configure something like this. I'm sooooo close i can feel it. I start the VM to install it and everithing looks good but i'm stuck on "Starting Windows" Black screen before i get to install and use the VFIO iso....
Please help.
If I can get it to work, i'll be able to get back to you with info on making this tutorial on Linux Mint 18, since it's what I did ;-)
Gratefuly.

OliverD


#155

That's not really a laptop. You are passing an isolated GPU which is what this tutorial is. Saying eGPU counts is cheating. :P


#156

Great tutorial (This should finally get me off windows only!), but i'm having problems installing the nvidia drivers for my passed 760 on the virtual machine; when I reboot it (through force or not) it always comes back on with the generic windows graphics driver.

If it helps, i'm using my 4690Ks "GPU" for debian, with the Haswell desktop graphics driver, virtual machine is running Windows 10 Pro.

EDIT :
If anyone else has this problem, it seems NVidia started doing something to their drivers since 337.88 that messes with VMs.

https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#.22Error_43_:_Driver_failed_to_load.22_on_Nvidia_GPUs_passed_to_Windows_VMs


#157

Agreed, and I don't happen to know whether the CPU or mobo could do it. What I should have said is that computer might be capable or if not, the most interesting laptop for passthrough, to me, would be one like that running Linux on the go and able to play games at home on Windows.


#158

I'm sure it can. Just have to see what your IOMMU groups look like and if your CPU supports VT-d.


#159

I have trouble setting the GPU to VFIO-PCI. It always stays at Nouveau.

01:00.0 VGA compatible controller: NVIDIA Corporation GM206 [GeForce GTX 960] (rev a1)
	Subsystem: Device 196e:1138
	Kernel driver in use: nouveau
	Kernel modules: nvidiafb, nouveau

Help would be v appreciated!


#160

try to blacklist nouveau drivers?


#161

Okay, What's your other GPU? If you're using two Nvidia devices, it's going to get muy complicado.