Play games in Windows on Linux! PCI passthrough quick guide

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.

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.

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.

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.

1 Like

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

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

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

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

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.

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

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!

try to blacklist nouveau drivers?

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

I'm only using one gpu, and switching between Windows and Linux.

Thanks, I'll try that.

You better don't try at all, you need 2x gpu to make passthrough, and if you blacklist nv drivers now you gonna have to use terminal only (if ubuntu in recovery mode) to unblock drivers so you can use gui again, maybe even in live with alt+f2 or something.

Is there anyway I could use only one GPU? bc I have a second one, I just thought I'd give a try with one.

So, are you talking one dedicated gpu or one gpu total?

If you set up your Linux host to connect to your iGPU, and blacklist drivers on your dGPU, you'll be able to do it.

I can confirm it's possible to use one GPU, but that's getting damn close to the bleeding edge of this technology. I'm working on a guide for that, but it's probably going to come out in March or later, since it's so difficult to reliably do.

That'd be cool, I'd definitely watch. I only have one GPU total. I was just thinking about switching between Windows virtual machine and Linux.

I've been having trouble with this because I'm at the point where I need the PC I'm testing this with to do actual work, so I'm constantly rebooting into another btrfs subvolume.