VirGL – A virtual 3D GPU for use inside QEMU virtual machines
docs.mesa3d.org
docs.mesa3d.org
[1]https://github.com/virtio-win/kvm-guest-drivers-windows/pull...
I guess that means not usable day-to-day. One infinite loop in any app and the whole OS will freeze forever. I didn't even know any modern OS could operate only with cooperative multitasking. Windows 3.1 in 1992 and PowerPC Mac OS until 2002 were the last mainstream OS's to use it...
That said, he is correct that now “nix” is going to likely be popularly associated (especially with tech types that love excessive things) with the Nix language, package manager, and NixOS, which has really been gaining steam. Especially these past few years.
It was what I first thought of as well, given I use them.
What I meant was "contraction".
Saying that, I do agree that vendors should enable support in customer GPUs and feel that their focus on protecting server sales is going to turn out misguided in the long term. Intel especially disappointed in this area, as they in the past did allow such functionality on their GPUs, but have recently removed that.
AMDs mainstream CPUs supporting server features such as ECC also have proven that such restrictions aren't necessary, and allowing this type of capability on mainstream platforms in no way harms enterprise sales.
That being said, any effort focused on GPU virtualization or drivers impresses me immensly and I very much appreciate the work done on VirGL.
Pretty much every guest OS (windows, Linux, BSD) has drivers that would work with a native PCIe VF GPU device. MacOS still has AMD drivers but only up to RDNA 2. I can't think of any guest that would support a GL device but not have a native driver.
>Saying that, I do agree that vendors should enable support in customer GPUs and feel that their focus on protecting server sales is going to turn out misguided in the long term. Intel especially disappointed in this area, as they in the past did allow such functionality on their GPUs, but have recently removed that.
Intel supports SRIOV/SIOV on consumer CPU iGPU's (Xe, 11th, 12th, and 13th gen) but not dGPU's (A770, A750..) which is very frustrating. Indeed 'enterprise features' such as ECC or IOMMU on consumer chips have not affected server sales.
>That being said, any effort focused on GPU virtualization or drivers impresses me immensly and I very much appreciate the work done on VirGL.
agreed
GVT-g high-level design
https://projectacrn.github.io/1.6/developer-guides/hld/hld-A...
https://www.intel.com/content/www/us/en/developer/articles/t...
As long as 1 GL context on the guest side == 1 GL context on the host side then it _should_ at least be as safe as letting your web browser access your GPU but certainly not as safe as using an IOMMU to segregate a whole GPU solely for your VM.
And those are accidentally caused leaks. As soon as someone starts storing actually sensitive data in graphics memory, I'm sure lots of methods to deliberately cause leaks will be found.
The Arch wiki has a great guide here - https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVM...
It does get a little tricky if your GPUs are identical, but I've done this for years and maintain a guide for doing this (as well as the ACS-override patched kernel RPMs) for Fedora.
- Writeup - https://some-natalie.dev/blog/fedora-acs-override/
- Code + RPMs - https://github.com/some-natalie/fedora-acs-override
As far as concerns around stability with ACS override, I tend to only enable the override for the specific GPU (or other hardware) that I'm passing through and haven't encountered any stability problems or memory leaks that'd interrupt desktop or light server usage. I also used to run this for a bunch of white-box GPU hardware for a customer at a former job and it worked well for exploratory AI/ML workloads before investing in the big Nvidia DGX boxes. YMMV, of course!
Your guest GPU ROM must support UEFI"Problem isn't really HW support, its that the software side is super glitchy and its not all that easy to configure and in most cases requires a 2nd GPU if you still want basic host functions.
Where as VirGL is much easier to get working and doesn't require specific HW support as far as I'm aware.
https://events19.linuxfoundation.cn/wp-content/uploads/2017/...
The reset bug being that you can pass through the card fine, once. But if you try to pass it through again (or the card experiences an issue and needs to reset), they get caught in some kind of bad state and won’t work until power is removed and restored. Which requires a reboot or a only slightly less disruptive dance with system power states.
For vega and 5000 series gpu’s, there’s https://github.com/gnif/vendor-reset
Incidentally, nvidia gpus are so good at resetting, they’ve probably done so without you noticing. If the screen ever goes black for a fraction of a second and returns in normal usage, it was probably because it reset itself.
The lower 6000 series lower than the 6800’s for example may or may not have the issue. It seems most “reference” cards are fine, but custom vendor cards often but not always have issues. My reference 6700 works fine, but a sapphire 6700 probably won’t.
And the 7000 series is also fucky in a new way somehow. Gnif knows far more about this than me, and has basically thrown up his hands at how AMD doesn’t care. He’s made occasional posts about it on https://forum.level1techs.com/
Gnif is also responsible for Looking glass: https://github.com/gnif/LookingGlass
When it comes to splitting a gpu into virtual ones with SR-IOV/MxGPU, that’s not really a thing with AMD. Whereas Nvidia will happily give you what you want if you shovel some money into their gaping maw, AMD won’t even give business customers the time if day if you aren’t worth billions. They very deliberately do not want the unwashed masses to use MxGPU. See: https://www.reddit.com/r/VFIO/comments/eqvn9z/amd_mxgpu_or_s... for a summary of the years of hopelessness on this functionality.
Let's just say I'm very aware of AMD's issues in this area :P
Also looking glass is pretty great though it's use of the Desktop Duplication API seemed to carry with it a huge performance hit. Or rather did the last time I used it (it's been a while)
"VR Linux is now testing with working GPU acceleration via the kernel over virtio-gpu. This is a major step forward following on from the Shadertoy device that we made a few months ago. Now we can make OpenGLES Linux programs that are accelerated by the Quest's Adreno GPU."
[1] Thread: https://twitter.com/anjin_games/status/1371870094490537987?t...
IOMMU is also required for various modern security features, and M$ requires it for certification nowadays to protect against DMA vulnerabilities (heard of thunderbolt?).
Just because your CPU supports IOMMU, that does not mean GPU passthrough is going to work properly or that groups are setup properly or....
But forwarding real GPUs limits the number of VMs and can cause stability issues if unlucky - PCIe device bugs, especially reset bugs, are not unusual. Had problems with e.g. a forwarded rx580 that would require a hard reboot of the host to fix...
Things like Intel GVT-g and VirGL are better solutions, when they can be used.
Interesting, thanks for the link!
> Had problems with e.g. a forwarded rx580
I've been forwarding Sapphire Radeon RX 580 Pulse to both Windows and macOS for literally years and, except for the specific problem of host sleep/wake, had no problems whatsoever. Perhaps try an Asus motherboard?
> Things like Intel GVT-g and VirGL are better solutions, when they can be used.
Sure, when software solutions are available and stable (and there's no need for near-native GPU performance), they are definitely easier to work with. However, as of today, GPU passthrough is probably the only solution available for a daily driver.
Does not work with the lower 6000 (below 6800) and 7000 series that can also have reset issues.
I tried this on my ASRock X370 Taichi a while back. Turns out that there is a bug in older bios versions and the whole thing just freezes when starting the QEMU VM. Then there is an intermediate bios version with which I actually managed to get it working. Unforunately I later upgraded my CPU and had to install a new bios and this again completely breaks the IOMMU groups. Probably spend a few days to get everything running, including downgrading from a non-downgradeable bios version.
And even when it was working it was a pain to use. Want to use the passthrough GPU in Linux? Now I have to dual-boot QEMU VMs or disable the passthrough, reboot, then enable it again, reboot one more...
I really want proper GPU virtualisation...
I've been forwarding an AMD GPU to both Windows and macOS for literally years across multiple Asus motherboards and, except for the specific problem of host sleep/wake, had no problems whatsoever, even considering I work under GPU-passthrough VMs whole-day, every-day. Perhaps try a recent Asus motherboard?
> have to dual-boot QEMU VMs or disable the passthrough
Yes, you would have to buy as many cheap, secondary GPUs as the number of virtual machines that you want to run in parallel.
> I really want proper GPU virtualisation...
Sure, I don't blame you - my point was that the only truly usable GPU virtualization solution available today is GPU passthrough and that GPU passthrough is much easier to setup than it is commonly perceived.
I also have an AM4 ASUS board (is that recent enough?) and earlier this year, ASUS decided to completely remove any mention of this board from their site, as if it never existed. So no bios updates for me I guess? No idea if it is up to date or not or if my CPU is even supported...
> Yes, you would have to buy as many cheap, secondary GPUs as the number of virtual machines that you want to run in parallel.
Except that cheap GPUs are... cheap and not very powerful, so depending on what I want to do I would have to buy a bunch of expensive and powerful GPUs (or go back to rebooting VMs to switch). And there are only so many PCIe slots on my board (2x8 and 1x4, the latter of which is already in use by a non-GPU card). Running them in an x1 slot also doesn't sound like a great idea.
I have tried to run it but gave up in the end after breaking bios updates and not wanting to spend even more money on another fast GPU.
No, I never tried GPU passthrough with an AMD CPU, Intel only.
Maybe your board was only disappeared on some locales? Maybe see if you can find it on asus.cn or one of their other regional sites (translation service required, but you can probably muddle through)
I haven't seen that in a long time, amd640 super7 chipsets got disappeared, but back then you could still get the bios updates via ftp, the boards just dropped off the website.
And if I don't want to or can't afford to buy new hardware?
> Sure, I don't blame you - my point was that the only truly usable GPU virtualization solution available today is GPU passthrough and that GPU passthrough is much easier to setup than it is commonly perceived.
Okay, but for the poster you're replying to it is not available on their hardware.
Where can I find an unused PCIe slot on my laptop?
Also it is not very rational to buy 2 GPUs and use only one at a time.
Having said that virgl is pretty darn sweet!
Unused PCIe slots in a laptop is hard, haven't tried but I imagine Thunderbolt could work for this purpose.
This can be used for OpenGL inside containers, by bind mount-ing the socket into the container (/tmp/.virgl_test).
Also useful for debugging with rr, even with the nvidia driver you use OpenGL over virgl with the environment vars __GLX_VENDOR_LIBRARY_NAME=mesa LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=virpipe
It would be nice to have fullscreen, full res 3d accelerated VM guests finally. I've never been able to get this to work as smoothly as I think it should.
It's been a while, though. Maybe this works really well... I'm curious to hear if anyone has more recent experience messing with these things.
But not sure how far along it is. virt-manager doesn't seem to be aware of it yet.
So it makes sense to one day do the same for Vulkan, which is much lower level and might be able to extract more performance.
Perhaps, but that should probably be a different project. They want a different focus here.
It required some host daemon to be cooperating with qemu back then (virgldeamonsthsth).
Now we need to make a translator for the DOS version of 3Dfx Glide 1 & 2 and drivers for Windows 95, 98 and 2000 ^_^
I'm getting on with the 3DFx one this weekend if all goes well.
The recent moves of Apple hypervisor being able to use Rosetta on intel cpu code it its already translated(Qemu does cpu intel translation) means that one can use Qemu to simulate x86 64 on Apple Silicon....
It's worth noting the terminology "passthrough" means something else in this particular context and VirGL is not considered a passthrough solution (as noted in the "out of scope" section). VirGL is a form of paravirtualization often called "API remoting".
But thanks exDM69, zamadatix, fayalalebrun
No, vfio is still the most recommended option.
This is essentially something like VirtualBox or VMWare 3D acceleration - the host is still the "owner" of the GPU, and has to juggle receiving OpenGL commands from the guest and sending the render results back to it, with lots of overhead. But easier for users than setting up passthrough or using proprietary GPU virtualization solutions.
People pointed out that there is a similar project for Vulkan, already being used in production for ChromeOS, called Venus. Should be the one to watch nowadays.