First time for me trying to setup GPU passthrough on a desktop system, but it seems to not be working as it should.
I mostly followed this tutorial:
With these two exceptions: I only passed through the GPU with video and audio device, no NVMe; And I didn’t apply any Error Code 43 mitigations, since my second card that I am passing through is an RTX 4000 Ada which shouldn’t need it.
But when trying to start the VM, it just does nothing for a few minutes and then crashes Virtual Machine Manager. When restarting it, it just says “QEMU/KVM: Connecting…”
In case it has any relevance:
I am running an AMD Ryzen Threadripper PRO 5955WX on an ASUS WRX80E (Version 2) with 256GB RAM and two GPUs: an RTX 3090 (currently used for the host system) and an RTX 4000 Ada which I am trying to hand to my Windows 11 VM.
The RTX 4000 Ada is in its own IOMMU group, so there should be no problems from that side.
Yes, the GPU is still bound to the nvidia driver and when you try to start a VM it crashes because it can not attach the PCI device. That is definitely a problem. In this case of the tutorial you linked the person is using custom scripts to attach and detach the GPU on demand, but as it seems that is not working correctly. If you want to follow this setup I leave it upon you to debug these scripts.
The other method is to attach the vfio-pci driver on boot. This means the GPU will be unavailable to the host, but can be attached freely to VMs at will.
Have you placed the scripts in the according directories that correspond to the name of your VM? Because the win10 folder in qemu.d is a placeholder that needs the name of your VM? Have you done that?
So I won’t be able to investigate this as much as I had hoped, because I can not execute the bind_vfio.sh at all. I have removed the unused variables from the script and when I run it my Gnome desktop environment completely freezes and I have to reboot the machine. I have a separate Intel GPU that the screen is attached to but it seems Gnome really does not like attaching and detaching GPU’s on the fly.
What OS are you on, maybe we can get vfio-pci loaded on boot at least?
i’m on Pop!_OS. I already did some basic setup for it now, to the point where my VM can be started, but all I get is a black screen… just trying to find out what causes that
I edited /etc/modules-load.d/vfio.conf and /etc/modprobe.d/nvidia.conf to attach my second GPU to VFIO and to ensure VFIO is loaded before the Nvidia driver.
I now have this output for sudo lspci -nnk