NVIDIA / egl-wayland

The EGLStream-based Wayland external platform
MIT License
293 stars 47 forks source link

issues with boxes and 3D accel #105

Open ryzendew opened 6 months ago

ryzendew commented 6 months ago

Boxes.logs.txt can't use EGL and opengl in boxes

kbrenneman commented 6 months ago

Can you be more specific about what you're trying to run, and what it's doing?

A VM is going to provide its own virtualized graphics device, so nothing running in the VM is going to see the NVIDIA GPU.

erik-kz commented 6 months ago

The "3D acceleration" switch in boxes tells QEMU to create a virtio-gpu device in the guest system. The virtio-gpu DRM driver pipes commands back to the host system using a custom protocol where they're translated to OpenGL calls by the virglrenderer library. I believe the term they use for this is "paravirtualization", it's an interesting approach.

Anyway, based on the logs, it looks like QEMU is failing to initialize EGL on the host system in this case.

Strangely, if I try it on my system, EGL does get initialized successfully. I see "gl_version 46 - core profile enabled" in my log. However the window itself remains blank. So something definitely seems wrong in both cases, but it's odd that the symptoms are different.

ryzendew commented 6 months ago

Boxes has given up trying to fix the issue pretty much it’s nothing to do on their end and this only happens on Nvidia

ryzendew commented 6 months ago

Can you be more specific about what you're trying to run, and what it's doing?

A VM is going to provide its own virtualized graphics device, so nothing running in the VM is going to see the NVIDIA GPU.

It uses the Nvidia GPU to accelerate the VM using open GL and this issue is only an Nvidia issue. There’s no issue on Amd. And it’s not anything wrong on boxes end this also happens in other applications like virt.

kbrenneman commented 6 months ago

@RyzenDew - What distro, which version of the driver, which version of EGL-Wayland, and which compositor are you using?

Messages from KHR_EGL_debug would probably be useful, too, since the Boxes log file doesn't even include the EGL error code. I wrote up a library that can do that for an unmodified program here: https://gitlab.freedesktop.org/kbrenneman/gl-debug-preload

erik-kz commented 6 months ago

As of commit 1f086ef642 ("ui/egl: print EGL error, helping debugging") I think QEMU will print the EGL error code if eglInitialize fails. So you could also use a git build of QEMU.

ryzendew commented 6 months ago

@RyzenDew - What distro, which version of the driver, which version of EGL-Wayland, and which compositor are you using?

Messages from KHR_EGL_debug would probably be useful, too, since the Boxes log file doesn't even include the EGL error code. I wrote up a library that can do that for an unmodified program here: https://gitlab.freedesktop.org/kbrenneman/gl-debug-preload

gnome-boxes flatpak Arch linux 550.54.14 and i will try and get logs