<p dir="ltr">So I've made some progress. I pci stubbed all of my graphics devices and I was able to succesfully bind my 580 and boot into Seabios. I attempted to bind Nouveau to each of my other cards but it failed and crashes my system. Clearly the drivers were fighting each other there.</p>
<p dir="ltr">Oddly enough, the NVIDIA drivers actually worked fine with the VM. I'm currently successfully running the VM on card 2 and Arch on the other 2 cards. I did this by booting with all cards pci stubbed, using a standard vfio bind script to bind card 2, starting the VM, and then binding card 1 and 3 using an nvidia bind script (same script but replaces "vfio-pci" with "nvidia"). Unfortunately this setup doesn't stand up to a restart of the VM, it gives an error that it "Cannot read device rom" when I try to boot the VM again. Clearly the nvidia driver is claiming some part of the guest card and blocking access to its bios.</p>
<p dir="ltr">As a next step I'm considering trying this arbiter patch: <a href="https://lkml.org/lkml/2014/5/25/94">https://lkml.org/lkml/2014/5/25/94</a></p>
<p dir="ltr">I noticed it's fairly old though, has that functionality already been implemented into the kernel? Is there a way that I can check if it has on my own? Are there any other nvidia specifc patches? I've seen ones for significantly older drivers but I'm using the most up to date ones currently. Thanks.</p>
<div class="gmail_quote">On Feb 8, 2016 11:50 PM, "Ben J" <<a href="mailto:btpprograms@gmail.com">btpprograms@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Switching over to Nouveau did the trick, at least for this issue. I was able to start the VM without hanging and had a different error which I fixed by passing it a ROM file for my GPU. I'm still not getting an output from the passed card though. Any ideas on how I would fix the arbiter issue then? Obviously I'd prefer to keep using the normal nvidia driver on linux if possible, although I suppose I could pass the other card to a Linux VM if all else fails. Thanks for the help so far, I'll continue working on this tomorrow.</p>
<div class="gmail_quote">On Feb 8, 2016 11:19 PM, "Alex Williamson" <<a href="mailto:alex.williamson@redhat.com" target="_blank">alex.williamson@redhat.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, 8 Feb 2016 22:42:48 -0500<br>
Ben J <<a href="mailto:btpprograms@gmail.com" target="_blank">btpprograms@gmail.com</a>> wrote:<br>
<br>
> Hi, I've been working to get VGA passthrough working for a Windows 7 VM for<br>
> the past few days. My setup is as follows:<br>
><br>
> Processor: I7-3960X<br>
> Graphics: 2 NVIDIA GTX 580's and one NVIDIA GT 420<br>
> Monitors: 1 Monitor hooked up to the 420, 1 monitor hooked up to both 580's<br>
> Motherboard: ASUS Rampage IV Extreme<br>
> OS: Arch Linux<br>
> Kernel: Standard, 4.4.1<br>
><br>
> My end goal is to bind one 580 to the VM and the other to Arch. The 420 is<br>
> just to allow X to start initially since I haven't found a way to disable<br>
> only one 580(They have the same vendor and model ID) at a time. I was<br>
> initially following this guide<br>
> <<a href="https://www.reddit.com/r/pcmasterrace/comments/3lno0t/gpu_passthrough_revisited_an_updated_guide_on_how/" rel="noreferrer" target="_blank">https://www.reddit.com/r/pcmasterrace/comments/3lno0t/gpu_passthrough_revisited_an_updated_guide_on_how/</a>>.<br>
> My guest card was in its own IOMMU group and I'm not using integrated<br>
> graphics so from what I understand I don't need the patched kernel. My<br>
> cards bound to vfio-pci fine, but I got stuck when I realized that the GTX<br>
> 580 doesn't support UEFI booting. I changed over to booting with Seabios<br>
> but any time I've enabled "x-vga=on" QEMU just hangs. The QEMU monitor<br>
> window freezes, there is no video output to my other monitor, and the only<br>
> way to get out of the window is to force close it in htop. It uses 0% cpu<br>
> during this. The only log put out into dmesg is "kvm: zapping shadow pages<br>
> for mmio generation wraparound" which looks fairly unrelated from my<br>
> searches.<br>
><br>
> I've tested the following things:<br>
> Enabling vga cirrus and x-vga - Opens an empty, black graphical window,<br>
> still hangs<br>
> Enabling vga cirrus and no x-vga - Boots as expected, but obviously no<br>
> passthrough<br>
> Passing in a ROM for the graphics card - Hangs<br>
> Enabling unsafe interrupts - Hangs<br>
> Using linux-vfio kernel from AUR - Hangs<br>
> Lowering RAM (based on this post<br>
> <<a href="https://bugzilla.kernel.org/show_bug.cgi?id=107561" rel="noreferrer" target="_blank">https://bugzilla.kernel.org/show_bug.cgi?id=107561</a>>) - Hangs<br>
><br>
> Here are my boot options, booting using rEFInd:<br>
> "root=UUID=4accaa3c-6d16-40e9-bb95-e78d160962a5 ro intel_iommu=on<br>
> vfio_iommu_type1.allow_unsafe_interrupts=1 pci-stub.ids=10de:1080,10de:0e09"<br>
><br>
> The two pci-stub ID's are for the GTX 580 and its audio card, it disables<br>
> both 580's.<br>
><br>
> Here is my QEMU startup script:<br>
><br>
> qemu-system-x86_64 -enable-kvm -m 1024 -cpu host,kvm=off \<br>
> -smp 4,sockets=1,cores=4,threads=1 \<br>
> -bios /usr/share/qemu/bios.bin  -vga none \<br>
> -device vfio-pci,host=02:00.0,multifunction=on,x-vga=on \<br>
> -device vfio-pci,host=02:00.1 \<br>
> -drive file=/mnt/LinuxStorage/VMs/VGAWin7.qcow2,id=disk,format=qcow2,if=virtio \<br>
> -boot menu=on \<br>
><br>
> At this point I don't know of any log files to look at so I'm essentially<br>
> taking shots in the dark. Are there any other logs that could be useful?<br>
> Has anyone else experienced issues like this? I've done a lot of searching<br>
> around and haven't come across anyone who has had this kind of hang without<br>
> an error message. Any ideas would be appreciated, thanks.<br>
<br>
Possibly a VGA arbiter deadlock with the host graphics not allowing the<br>
the assigned graphics a chance to access VGA space.  What happens if<br>
you pci-stub all the NVIDIA devices (pci-stub.ids=10de:ffffffff)?  X<br>
obviously won't start on the host, but you should be able to login from<br>
another system (VGA text mode on the 420 will get really dicey once the<br>
VM starts, but the goal is just to test if the driver with X running on<br>
the 420 is the problem).  There used to be a problem with this using<br>
the nvidia.ko driver and a workaround was to hack on the wrapper script<br>
to prevent it from permanently grabbing the VGA arbiter resources.<br>
That seems to be fixed for most folks, but perhaps it still exits with<br>
the older driver you might be using with a 4-series card.  Using<br>
nouveau in the host may also avoid it.  5-series cards seem to cause<br>
folks quite a bit of trouble when trying to assign them.  Good luck,<br>
<br>
Alex<br>
</blockquote></div>
</blockquote></div>