8 ms·
VirGL – A virtual 3D GPU for use inside QEMU virtual machines
- slimsag 3y agoVery interesting; is there anything similar for Vulkan? Does this also work with Vulkan?
- shmerl 3y agoIt's called Venus: https://docs.mesa3d.org/drivers/venus.html https://docs.mesa3d.org/drivers/venus.html But not sure how far along it is. virt-manager doesn't seem to be aware of it yet.
- modeless 3y agoChromeOS uses it for Steam support which is generally available now, as well as for Android apps, so it must work reasonably well: https://chromeos.dev/en/posts/improving-vulkan-availability-with-venus https://chromeos.dev/en/posts/improving-vulkan-availability-...
- deleted 3y ago[deleted]
- koprulusector 3y agoVulkan doesn’t come into play here. Vulkan is a graphics API. This project is hardware GPU virtualization in QEMU / libvirt.
- sph 3y agoThat's incorrect, the goal of VirGL is pass the GL commands themselves (Gallium intermediate representation of them, actually), from the guest to the host, so they are executed on the host accelerated Mesa stack. It is not about virtualising the GPU hardware itself. 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.
- gregschlom 3y agoGfxstream, used by the android emulator and others.
- jsomedon 3y agouh, this doesn't look like what those gpu passthrough things like vfio do, is it a different thing? Or I am more interested in, can this do what vfio do, run games in almost native performance in windows guest vm?
- hueho 3y ago> run games in almost native performance in windows guest vm? 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.
- madushan1000 3y agoVirgl just sends opengl commands to the host. And it also has to copy some buffers back and forth. So it won't be as fast as vfio. But, there is a new feature called VirtGPU DRM native contexts which eliminates some of this overhead and run at near native speeds. Unfortunately it's only implemented for adreno/msm GPUs for now.I think there is work on the way for Intel and AMD GPUs.
- w-ll 3y agoIts virtual... but passthrough, I would like to see something thats virtual but runs on pure cpu x86 or arm, do not care how slow.
- zamadatix 3y agoSee LLVMpipe a little ways up the list in the left hand pane. It should do exactly what you're looking for. 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".
- exDM69 3y agoYes, llvmpipe or lavapipe is awesome. It is fully Vulkan 1.3 compliant and the performance is more than adequate for GUI apps, simple 3d apps or running your gfx tests in a CI environment without a GPU.
- w-ll 3y agowow llvmpipe looks like what i need. I still need to figure a way to lie to some other bits that probe the hardware but this is going to be helpful But thanks exDM69, zamadatix, fayalalebrun
- fayalalebrun 3y agoDoesn't using a software gl driver like llvmpipe do the trick?
- kevingadd 3y agoOn Windows, there's a pure software implementation of Direct3D 11 called WARP https://learn.microsoft.com/en-us/windows/win32/direct3darticles/directx-warp https://learn.microsoft.com/en-us/windows/win32/direct3darti...
- rzzzt 3y ago
- jchw 3y agoI've always found it interesting, and a bit unfortunate, that it seems like things like apitrace are generally pretty reliable, but tools like VirGL seem to often have trouble with typical programs. It seems like the problem of accurately serializing what is being done to the GPU using an API is possible, but in practice there is clearly a lot more to it than that. (Of course, in case of remoting, you do not have the benefit of observing the interactions with a known-good driver and with direct memory mapping/etc. So, that probably answers the "why" right there.) 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.
- jimmySixDOF 3y agoThere is a project I am following to embed a Linux machine into mobile VR applications using virtio-gpu & his latest effort gets 200fps. "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=iZ-yMEaXADglaz7FLAV6tw&s=19 https://twitter.com/anjin_games/status/1371870094490537987?t...
- bilegeek 3y agoNote also: it just got an experimental Windows driver! [1]https://github.com/virtio-win/kvm-guest-drivers-windows/pull/943 https://github.com/virtio-win/kvm-guest-drivers-windows/pull...
- circuit10 3y agoWhat’s the performance like on this?
- londons_explore 3y ago> disables preemption systemwide 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...
- vGPU 3y agoI believe he’s referring to GPU preemption. I don’t think it’s even possible to disable cpu preemption on windows. On nix you can.
- hollerith 3y agoFor decades no one used "nix" to mean Unix and Unix-like OSes (they used "*nix" and occasionally "Lunix") then a package manager named Nix became important and now people confusingly start using "nix" to mean Unix and Unix-like.
- vGPU 3y agoInteresting info. It seemed like a reasonable common one to me over the past decade on the web.
- Modified3019 3y agoI can’t really blame you, it’s a perfectly reasonable concatenation imo. Pretty sure I’ve at least rarely seen it over the years as well. 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.
- sneak 3y agoI've never been able to get this to work under UTM on an ARM Mac; if anyone knows the magic qemu and VM settings, please drop me an email (email in profile). 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.
- gary17the 3y agoVirGL is definitely an interesting project, but all one has to do to get GPU passthrough working (from a Linux QEMU host to any guest OS) is: 1.) research a cheap, secondary GPU that is natively supported by the guest OS, 2.) plug such a secondary GPU into a PCIe slot on the host and hook it up to the primary monitor with a secondary cable (D-Sub vs. DVI, etc.), 3.) setup Linux to ignore the secondary GPU at boot and configure a QEMU VM for the GPU passthrough. The whole process takes perhaps [edit: "a few"] hours and as works flawlessly, with no stability issues [edit: "at least with Asus motherboards"]. (Switching across the two GPU cables can be accomplished in software by using Display Data Channel /DDC/ utilities and switching keyboard/mouse can be accomplished by using evdev /event device/ passthrough.) More information: https://github.com/kholia/OSX-KVM/blob/master/notes.md#gpu-passthrough-notes https://github.com/kholia/OSX-KVM/blob/master/notes.md#gpu-p...
- denkmoon 3y agoExcept that requires IOMMU which is not always available nor is it always reliable on consumer motherboards.
- gary17the 3y agoGood point, but I believe that was a serious problem 10 years ago, while these days virtually any decent motherboard properly supports IOMMU, consumer-grade boards included - e.g. any Asus motherboard should work perfectly.
- RealStickman_ 3y agoThey might support IOMMU, but the default groups can be very annoying to work with so you have to use a patched kernel as well that "ignores" the actual groups.
- arghwhat 3y agoIOMMU is a integrated CPU feature, so consumer motherboards do not affect reliability - they just make the setting available. IOMMU is also required for various modern security features, and M$ requires it for certification nowadays to protect against DMA vulnerabilities (heard of thunderbolt?).
- jagrsw 3y agoI tried to use it 1.5years ago when playing CSGO inside a VM. It worked, but the delay (between mouse movements and changes on the screen) was quickly raising to something like 0.5-1s. It required some host daemon to be cooperating with qemu back then (virgldeamonsthsth).
- throwaway698585 3y agoVirGL is a poor solution to the pressing problem of virtualized graphics. It only really exists because the hardware makers AMD/Intel/Nvidia in their infinite greed refuse to support VFIO on all GPU's like how IOMMU is supported on nearly all CPU's.
- Topfi 3y agoCorrect me if I am wrong on this, but to me, it would seem that something like VirGL would still serve a purpose with wider spreader full SR-IOV support on consumer GPUs, as VirGL could find application in many scenarios where a GPU vendor's drivers are not compatible with the guest. 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.
- throwaway698585 3y ago>Correct me if I am wrong on this, but to me, it would seem that something like VirGL would still serve a purpose with wider spreader full SR-IOV support on consumer GPUs, as VirGL could find application in many scenarios where a GPU vendor's drivers are not compatible with the guest. 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
- arbruijn 3y agoThere's also virgl_test_server which runs the virgl protocol over a socket. 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
- amelius 3y agoI'm wondering if this approach could mean we'd one day be able to have CUDA running on non-Nvidia GPUs.
- h2odragon 3y ago> Out of scope: Passing through GPUs or subsets of GPU capabilities. Perhaps, but that should probably be a different project. They want a different focus here.
- bhouston 3y agoHow does Mesa3D get funding? It seems to be doing a fair bit.
- 0xcde4c3db 3y agoIt's been a while since I've really looked, but I seem to remember that the major contributors are either employed by various hardware/software vendors (Google, Valve, Intel, AMD, VMWare) or do contract/consulting work on the Linux graphics stack (LunarG), not unlike the Linux kernel.
- fredgrott 3y agoFor context, 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....
- dusted 3y agoVery interesting! 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.