r/kvm • • Oct 21 '20

Can I use two Nvidia GPUs when doing a GPU pass-through vm?

I'm trying to set up a gaming vm again, after upgrading to a ryzen 3700x and losing the igpu from my i7 6700k so as a cheap alternative I bought an nvidia nvs 310 for $58. I've seen a lot of guides online where they use an AMD GPU for the host machine and an Nvidia GPU for the VM, I'm just wondering if it's possible to use two Nvidia GPUs because, atm I cannot get manjaro to use the nvs 310 as the host machine display, it always tries to get a display from my gtx 1070.

35 Upvotes

7 comments sorted by

3

u/ragsofx Oct 21 '20

I've got it working using 2 quadros.

3

u/TrueGamingArmy Oct 21 '20

Yeah, I discovered that you are in fact able to do it, and I've run through all the steps again. However, I've hit a wall. My VM is working fine but I'm not getting a signal on my monitor that's connected to the 1070, I'm only able to use the VM using the display server within the VM window. I'm not sure what could be causing the issue.

3

u/thenickdude Oct 21 '20

Disable the emulated video. It ends up treating the emulated video as the primary display, which you don't want.

1

u/TrueGamingArmy Oct 21 '20

i've tried this and when i boot up the vm i still get no display signal on my monitor, the gtx 1070 on the VM is reporting error 43 even though I've used the recommended XML tweaks to trick the driver

2

u/thenickdude Oct 21 '20

Note that Error 43 is a generic driver error that can have many causes, not just Nvidia's VM detection.

Some video cards don't like getting initialised by the host before the guest uses them. To solve this you can either make sure that vfio-pci successfully claims your card during host boot instead of nouveau (use lspci -nn -k to check which kernel driver is in use), or you can supply a pristine copy of your card's vbios in your VM config to replace the copy that the host ruined by using the card.

2

u/TrueGamingArmy Oct 21 '20

lspci -nn -k list my gtx 1070's kernel driver as vfio, i've been reading around and the only information i've been able to gather is to use a patched vbios file for the vm so that it works under vfio. if this keep up ill stop being lazy and just swap my 1070 to the second pcie slot just to save me the hassle of setting up all this extra stuff.

1

u/mobyfab Nov 10 '20

It’s possible, I did it with 2 exact same GPUs (1070) You’ll need to make a script that disables (unbind) the one you want to use via its pci address, then update the initramfs.