canonical / mir

The Mir compositor
GNU General Public License v2.0
620 stars 99 forks source link

Tracking bug for issues with gbm-kms platform on NVIDIA #3252

Open Saviq opened 6 months ago

Saviq commented 6 months ago

NVIDIA is (slowly!) becoming more usable on gbm-kms, which is interesting to us for superior XWayland support.

There are still a few bugs (as of the NIDIA 545 drivers - currently the most recent drivers available in 24.04) that we either need to wait for fixes for or work around. Those are:

Original bug:

[2024-02-23 08:59:11.472038] <information> xwayland: Starting XWayland                                                                                                        
(WW) Option "-listen" for file descriptors is deprecated                                                                                                                      
Please use "-listenfd" instead.                                                                                                                                               
(WW) Option "-listen" for file descriptors is deprecated                                                                                                                      
Please use "-listenfd" instead.                                                                                                                                               
eglInitialize() failed                                                                                                                                                        
EGL setup failed, disabling glamor                                                                                                                                            
Failed to initialize glamor, falling back to sw

Saviq: Have a try with MIR_XWAYLAND_OPTION=-eglstream

morphis: the above solves the eglInitialize part, Failed to initialize glamor, falling back to sw is still in there

Ref.:

https://github.com/canonical/mir/blob/d0a68ae3de28ce59923c13e2e89ddea9a9dfdc8b/src/platforms/eglstream-kms/server/platform.cpp#L176-L183

Saviq commented 6 months ago

RAOF: One of the reasons this was never a priority is that passing -eglstream there will (might) get you accelerated rendering for the X server, it won't get you acceleration for X11 clients. Saviq: Wonder if GBM is the right direction here, then? RAOF: Yes; that has 3D accel plumbed through to clients. RAOF: And might even work!

RAOF commented 6 months ago

Problems with NVIDIA on gbm-kms so far:

morphis commented 6 months ago

I was actually able to figure out the problem why Xwayland fails to successfully run eglInitialize on Mir running with --platform-rendering-libs mir:egl-generic, my installation was missing libnvidia-egl-gbm1. That makes Xwayland successfully initialize glamor: (II) GLX: Initialized glamor GL provider for screen 0.

However X11 clients still fail to use OpenGL ES, e.g. glmark-es2 reports

Error: eglGetDisplay() failed with error: 0x3000
Error: eglGetDisplay() failed with error: 0x3000
Error: main: Could not initialize canvas

when forcing the NVIDIA EGL driver via __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json.

Conan-Kudo commented 5 months ago

FYI, Xwayland no longer has EGLStreams support: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386