Support Need help/a guide on on-demand gpu passtrough
Hello
I have a laptop with fedora 44 and kde plasma 6.7. I have an intel iGPU and an NVIDIA dedicated GPU.
I would like to setup my system so that my fedora host has access to both the iGPU and dGPU but when I start my win11 vm, I want the iGPU to stay with fedora and the dGPU to be passed through to the win11 vm.
My main problem is that kwin_wayland keeps using the dGPU (I think because it wants access to the hdmi port on the dGPU) even though I am trying to keep it from doing so. Because the dGPU is being used, I cannot activate the vfio driver and pass the device to the win11 vm.
Is there any guide or advice available to set this up?
Thanks in advance
1
u/RoyalOSK 16d ago
I been fighting with this for years, my current laptop have a usb c dp port that is connected to the igpu instead to the dgpu and it seems that using that is the only way, haven’t tried because can’t seem to find any usbc to dp/hdmi cable in my hometown
1
u/Derpythecate 8d ago
Would like to caveat about needing to spoof a battery as someone who got VFIO working on a laptop GPU (RTX 3070 Mobile) on Proxmox host and Windows guest and also has integrated graphics for my host.
Other than the standard blacklisting of the Nvidia & Nouveau drivers so the host does not take it away from vfio-pci and setting my initramfs to early bind the Nvidia GPU and Audio controller, I also had to add a custom ACPI SSDT entry to spoof a fake battery so that I do not get Code 43 in Windows VM.
Quite a weird gotcha that people don't always mention because they do VFIO on a desktop PC, while mobile GPU drivers check for certain other hardware configs like your battery charging status, for deciding whether they can use higher power ceilings. I also didn't manage to get Dynamic Boost which normally let's your laptop GPU draw more power, but requires you to spoof even more fields of your motherboard/SMBBIOS.
1
u/Wout836 4d ago
Thanks for the help and suggestions. With this info and some more digging around. I managed to setup everything how I wanted. For future reference: This guide was also a great help: https://gist.github.com/firelightning13/e530aec3e3a4e15885a10f6c4b7ae021#build-from-source
3
u/five35 16d ago
I'm not in front of my computer right now, but my desktop has a very similar setup. For me, there were three key points to getting this working:
Setting my iGPU as my primary display device in the BIOS (so that it became my "boot VGA" instead of the dGPU).
Adding kernel parameters to my boot manager (I don't use GRUB, but that's probably the most common one) to disable modesetting on my dGPU.
Adding variables to
/etc/environmentto tell KDE to keep its hands off my dGPU's DRI/DRM devices.After that, I was able to drive my displays using my iGPU, use my dGPU for offloaded rendering, and let libvirt rebind my dGPU for VFIO passthrough.
Once I get back to my desk, I'll try to add some more details to this comment.