3 ms·
Is there a good article that explains why is so hard to properly do 3D acceleration in a VM? And why is it so hard to do GPU passthrough? And if there's any hop
by oridecon 10y ago
Is there a good article that explains why is so hard to properly do 3D acceleration in a VM? And why is it so hard to do GPU passthrough? And if there's any hope this might improve significantly, let's say 70~90% of native GPU performance. I understand you need compatible hardware and NVIDIA makes it harder just to sell cards that are more expensive. Maybe you have some insight.
Off-topic: You go in one of those Linux boards and they all say it's so easy to do it. I mean, yes, I can follow instructions and make it work but it's so cumbersome for every day usage if you want to use a Windows guest. Death by a thousand paper cuts. I don't have the time or patience to use weird setups in my work desktop anymore. To think about it, I did some pretty crazy stuff a few years ago, I'm surprised I wasn't even fired back then. The Linux equivalent of betting your income on a Hackintosh.
Kinda like anything Linux related. Don't get me wrong, all my servers are using some variation of it, but when it comes to UX (I'm not talking about GUI) and desktop stuff (not only games but anything GPU related) I wish some things were more mature.
- pizza234 10y agoI've extensively tried and finally succesfully setup a VGA passthrough, so I'll chime in. > why is so hard to properly do 3D acceleration in a VM? I don't have a precisely informed answer to this, but I think it's simply because GPUs do not support/accelerate virtualization in hardware. > And why is it so hard to do GPU passthrough? Now the interesting bit! The core problem is that VGA passthrough requires an extensive collaboration of software and hardware parts, I believe significantly more than CPU virtualization. As a matter of fact, the term "GPU passthrough" is inappropriate/imprecise - you pass an entire card (hence, "VGA passthrough"). I'll enumerate a few critical examples: - in real world, you can't reliably transfer ownership of the VGA from the driver to VFIO¹; this means that if you want a stable VGA passthrough, you need to lock it at boot time, and renounce using it on the host - the software matured only very recently. around an year ago, QEMU had a bug which prevented Windows 7 (without a hack) to perform an installation; until Yakkety, the precompiled UEFI firmware had a bug which prevented Windows 10 to perform an installation; locking devices is something that has been introduced (I think, not sure) no early than an year ago in the kernel - there are many tweaks on the host which can radically affect the guest performance (eg. if you don't disable nested paging on [some] AMD systems, you will get CPU speed down to 30% of native; this will destroy the GPU performance) - nVidia blocks VGA passthrough on consumer machines (it can be worked around easily), and it blatantly lies about it - IOMMUs associated with their support in the BIOS may be buggy - not all the IOMMUs support the conditions required to make VGA passthrough work out of the box - even if all the factors apply, you may still have a system which severely underperforms without any understandable reason. There isn't a central, comprehensive, up to date, documentation, this is true. All of this factors are not really domain of the hypervisor; of course they could be integrated, but not in a consistent, safe way. Now the good part! If you have a proper system (both in HW and SW), VGA passthrough rocks; I get almost native performance (I can't distinguish native from virtual), it's perfectly stable (doesn't crash and I can execute it multiple times a day), and I launch it in a single command. As a matter of fact, I've entirely removed Windows from my disk (modern/high end motherboards support BIOS updating directly from a USB memory). I think it's important to clarify that the problems of VGA passthrough are radically different from the ones of Hackintosh. Mac O/S is not designed to run on hypervisors unless certain conditions are met (the absence of such conditions being defined as "Hackintosh"), and hypervisors can't officially support conditions other than those. In other words, Hackintosh is something that is not supposed to exist. VGA passthough on the other hand is something that is supposed to exist and work, it's just very much dependent on the hardware support, and both HW and SW just very recently matured. What people I think get wrong is that they think VGA passthrough as a function of the software. When the HW support is not there, like in your experience, you will die of a thousand paper cuts. If one thinks VGA passthrough as a matter of hardware instead, then it will work wonderfully. So if you really want to get rid of that nasty Windows partition (oh yeah!) you should start with the correct HW, then the SW will work butter smooth. ¹=on large scale. of course, there will be systems where one can.