5

I have virt-manager on a Fedora Workstation 26 host.

I have set up a Virtual Machine with Windows 11 Educational.

I have a Spice display server, with Listen Type set to “None”, and OpenGL set on with my NVIDIA graphics card.

I use proprietary NVIDIA drivers.

I also use virtio video with 3D acceleration set on.

However when I start the virtual machine, I get the following error:

Error starting domain: internal error: process exited while connecting to monitor: 2022-07-08T13:45:11.588270Z qemu-system-x86_64: egl: eglInitialize failed
2022-07-08T13:45:11.588413Z qemu-system-x86_64: Failed to initialize EGL render node for SPICE GL

Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper callback(asyncjob, args, kwargs) File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb callback(args, kwargs) File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn ret = fn(self, *args, kwargs) File "/usr/share/virt-manager/virtManager/object/domain.py", line 1384, in startup self._backend.create() File "/usr/lib64/python3.10/site-packages/libvirt.py", line 1353, in create raise libvirtError('virDomainCreate() failed') libvirt.libvirtError: internal error: process exited while connecting to monitor: 2022-07-08T13:45:11.588270Z qemu-system-x86_64: egl: eglInitialize failed 2022-07-08T13:45:11.588413Z qemu-system-x86_64: Failed to initialize EGL render node for SPICE GL

How can I have my VM work with 3D acceleration on NVIDIA graphics card?

2 Answers2

6

As stated here and here, virtio-gpu works currently only with Linux guests, but in the future it aims to be available for Windows Guests too. However, if you want it to work out of the box, it seems that nouveau driver is better than NVIDIA driver (I can't find the sources for that, but I've read it somewhere during my research on the web, plus I'me currently facing difficulties to achieve that with nvidia driver and I found this post about it virtion-gpu and NVIDIA drivers) If you want 3D acceleration for Windows guests you have two choices :

  1. Use PCI pass-through, but you'll need two graphics card
  2. Use vGPU from NVIDIA

You'll find what you need on arch linux wiki for the instructions.

[UPDATE]

Unfortunately, since the last post, there is no new update for Windows guest 3D acceleration. But I've stumbled upon a video showcasing the use of virtio-gpu : Venus, for Linux guests 3D acceleration, https://www.youtube.com/watch?v=HmyQqrS09eo&t=137s I didn't test it my self, but it seems really promising, with bare-metal performance for games played inside a linux VM. Here are some more information from mesa website https://docs.mesa3d.org/drivers/venus.html.

So one may think that, when https://github.com/virtio-win/kvm-guest-drivers-windows/pull/943 is mature for windows guests, then maybe we will be able to run 3D app smoothly inside Windows VM on Linux host.

Xalares
  • 61
0

The two options of PCI pass-through and vGPU are hard for normal desktops/laptops that have a single consumer card CPU. The remaining option is using virtio-gpu which needs egl-headless driver section as noted here which only works with qemu:///session after recent libvirt updates.

Once setup it works well for Linux guests OOTB, but the performance is much slower compared to the host NVIDIA card. Even so this is fine for desktop effects and all, though not useful for games or other high demand 3D applications.

The problem for windows guests is that the driver in this PR https://github.com/virtio-win/kvm-guest-drivers-windows/pull/943 no longer works. The vGPU is not officially supported on consumer cards and the unofficial unlock patches are mostly outdated and don't work for recent kernels (can also be risky). So I guess the practical way for Windows guests is PCI pass-through where you need at least two graphics cards (e.g. integrated card and discrete card), but the one passed through will no longer be available in the host.

sumwale
  • 101