VM GPU Passthrough

Hey @HikariKnight , I had a quick question before I got started with this whole rigamarole. As discussed in another thread, single GPU Passthrough is not supported (or at the very least not easy to do), so it is recommended to have 2 GPUs available, whether that be two dGPUs or one iGPU and one dGPU. Am I able to set up a VM with the latter, then easily change it to the former later? I ask because I am missing a power cable for my second dGPU (should have one by EOD) but I was looking to get started with setting everything up now
126 Replies
HikariKnight
HikariKnight2mo ago
one igpu (for the host) and one dgpu (for the VM) is enough i have read some people have success with passing through the igpu but the chances of that being in an IOMMU group with something else that shouldnt be passed through is higher. you will need a working VM before starting as you will know stuff is working then.
HikariKnight
HikariKnight2mo ago
you can check your iommu groups with this https://github.com/HikariKnight/ls-iommu
GitHub
GitHub - HikariKnight/ls-iommu: A tool to list devices in iommu gro...
A tool to list devices in iommu groups, useful for setting up VFIO - HikariKnight/ls-iommu
HikariKnight
HikariKnight2mo ago
also setting up singlegpu passthrough once you run the ujust to enable the vfio modules is the same as on a normal linux distro, it is just that it relies on scripts to accurately kill your display manager, clean up your session then unbind and rebind the gpu. that mess we do not help setting up 😅 plus youre prone to crashing your system a few times while setting it up, having ssh up with a journalctl -xe --follow and a dmesg --follow is advised if you try set it up. for dual gpu you just run the ujust, make sure the card is is in its own IOMMU group and then just add a rpm-ostree karg to permanently bind the card to the vfio driver (until you remove the karg either through rpm-ostree or temporarily remove it during boot in grub)
RoboRev
RoboRev2mo ago
If I set it up with iGPU for host and dGPU for VM, will I still be able to use the dGPU for the host when I am not using the VM?
HikariKnight
HikariKnight2mo ago
no you would be able to maybe do it dynamic loading but at that point youre in the same area as single gpu passthrough since it does something very similar
RoboRev
RoboRev2mo ago
that settles it then. 2 dGPU solution is the way I want to go because I want to game on linux and use windows vm exclusively for adobe software. So first thing's first from what I am gathering, is make a working VM
HikariKnight
HikariKnight2mo ago
the biggest lynchpin after having 2gpus is ideally having a motherboard that supports bifurcation meaning you can split the x16 lanes of the first PCIe slot to x8 and send the other x8 to the 2nd or 3rd PCIe 16 slot otherwise the 2nd gpu will run on usually x2 or x4 lanes and be severely bandwidth limited x8 is a nice middleground since it does not affect performance much (single digit or less) and a lot of mid range cards these days even are x8 lane cards anyway 🙃
RoboRev
RoboRev2mo ago
hmm I should look into what the 2080 Super is in that regard...
HikariKnight
HikariKnight2mo ago
most likely x16 but the difference between x16 and x8 mode is usually not that high because gpus tend to not be able to maximize the bandwidth on PCIe x16 slots (unless its a new card in an ancient slot) personally i would use the stronger card for gaming and the weaker card for the VM, especially since your 2nd gpu will be a 900 series gpu which support might vanish for at nvidias whim here
RoboRev
RoboRev2mo ago
that was my plan 🙂 just out of curiosity, do you think there would be a noticeable decrease in power if I skip bifucation on the x16 slot and leave the 970 with x4?
HikariKnight
HikariKnight2mo ago
the gpu would lose half its bandwidth but you should still be able to use it for tasks that are not graphically demanding i forgot what you were planning to use the passthrough for, i vaguely remember photoshop
RoboRev
RoboRev2mo ago
yeah it will be exclusive Adobe software. Photoshop, Illustrator, After Effects (<- thats the big one) mostly JUST AE. I am using this experience to learn new alternative software for photoshop and illustrator on linux, there just isnt really a good alternative to AE
HikariKnight
HikariKnight2mo ago
idk how demanding aftereffects is, i would say give it a shot and see how it works, knowing there is a possibility to be bandwidth limited if you have a motherboard that cant bifurcate the lanes for reference the gpu performance in a VM should be within 1-2% of what you get on metal (non-vm) if you have enough lanes for the gpu
HikariKnight
HikariKnight2mo ago
@ROG
ROG STRIX Z370-E GAMING | Motherboards | ROG Global
ASUS ROG Z370 ATX gaming motherboard with advanced cooling, Aura Sync, SupremeFX, dual M.2, Intel LAN, onboard Wi-Fi and USB 3.1 for 8th Gen Coffee Lake.
RoboRev
RoboRev2mo ago
I will look into bifucation later, am I able to turn that on later and and have it work without issue?
Want results from more Discord servers?
Add your server