Help with Gpu Passthrough on KVM Debian!. Newbie here!

Hi everyone. I’m a bit new to Linux to be honest. I just followed this guide here, great tutorial btw.
https://forum.level1techs.com/t/play-games-in-windows-on-linux-pci-passthrough-quick-guide/108981/312

So, long story short, I can’t get the 2nd VM to work properly (every time I install the Nvidia drivers I get a blackscreen and need to reboot) and I’d like some advice about what might be the problem. Pd. I’m not using both at the same time.

My system:
MB: GA-Z77M-D3H / CPU: i5-3470 / RAM: 16gb /HD: 500gb Wd Green / PSU: Thermaltake 600W / Gpu1: ASUS GTX 750Ti / Gpu 2: EVGA GTX750 / OS: Debian 4.9.51-1 / Kernel: 4.9.0-4.

Outputs:

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_GTX750TI] 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 for your time!.

1 Like

Disclaimer: I have not done this myself yet, only watched the videos and threads.

Have you applied the KVM config to hide that it’s a virtual machine? Maybe I missed it in your links. The driver might be crashing even before it shows Error 43.

The option is in one of the threads, can’t remember which one right now.

I had an idea, can Kernel Virtual Machine run 2 different Virtual Machines at the same time. The reason I had this idea the original poster problem might be he is trying to run two different Virtual Machines at the same time.

You can run multiple VMs at once, not sure how that plays with passthrough though.

It is fine, I have run 4 gpus/5vms with gigabyte sniper mbo on sandy bridge. If you youtube quad gpu passthrough you’ll probably see my vid.

Yes I have my friend, in each of the VMs xml.
First, you need to change the 1st line to:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
and then add the
qemu:commandline
<qemu:arg value=’-cpu’/>
<qemu:arg value=‘host,hv_time,kvm=off,hv_vendor_id=null’/>
</qemu:commandline>
part at the end.

If I skip these steps, VM1 also gets that same error (blackscreen when trying to install nvidia drivers and needs to be rebooted).

Some people also suggest to eliminate this bit:

<hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
</hyperv>

and finally this line:

<timer name='hypervclock' present='yes'/>

But I’ve tried those and it makes no difference, VM1 is still able to install the Nvidia drivers without those tweaks and VM2 still ins’t able to. Thanks anyway bro :+1:.

In the OP: “Pd. I’m not using both at the same time”.

But I can actually, run both. No prob except the VM2 doesn’t have its video driver installed correctly. Thanks anyway bro :+1:.

Some virtualization software won’t allow you to run a Virtual Machine inside a virtual machine. I reread what the original poster posted, and I see that isn’t the case.

That’s kinda what I intend to do -in the long run-… 4 Vms each with its own gpu all up and running…
Of course that build should eat several watts more and would need 1000W PSU at least. So, I’ll need a gaming mobo, an i7, more Ram, that sort of PSU and 4 different GPUs, etc.
Did you get to install the video drivers just fine, no hassle?
Is this your vid btw? https://www.youtube.com/watch?v=UbLpm9h_lRo If so, 3 of those Gpus look just the same, how did you get those to work? Are you juusing KVMM or another thing like Limetech unRaid?
Thanks in advance. :+1:

Yes. That was 3y ago, gpus are gtx 560ti x 2, 770gtx and 8800gt, there are no problems with passing, only problem was cpu bottlenecking. So if you plan to run more than 2vms you need somethin better than i7 4c/8t.

That is all on debian with 3.18 kernel afair.

Hm… Though it is unlikely, have you tried swapping the GPUs for the VMs? Not sure what would cause it, but maybe the second GPU doesn’t bind properly at all? Try the second GPU in the first VM and see if that works.

Don’t think it will make much of a difference, but seeing is the GPU will bind at all might bring you further.

Thx man but I’ve already try that. In fact, that setup was how I started after giving up with Win 7 + a HD7750 Uefi. I guess its not bindind properly but I can’t figure out the reason yet.

Nice Setup!. How did you get to pass two identical gpus? Wasn’t that going to generate an issue with the repeated HD ids?
Something better huh… that would be either a Server or perhaps a Ryzen build… I dont know yet, but if I get pass this problem then -after some benchs/testing with the current build- we will see. 4Vms with an i7 would be great price/performance wise. Which guide/tutorial did you follow btw?
Thanks a lot! :+1:

You pass gpus by bus id, only “problem” when you have 2 and one is for host, but it is not really problem just different config with bus id not gpu id.

That is some old stuff, no tutorial, any tutorial nowdays is fine it is like 4 steps.

Yeah i7 4c/8t is weak for like 4 demanding games at same time, but 8c/16t not amd should do it fine.