Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 4 tasks
Saviq opened this issue Feb 23, 2024 · 4 comments
Open
1 of 4 tasks

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

Saviq opened this issue Feb 23, 2024 · 4 comments
Labels
bug triaged Triage into JIRA to plan it in

Comments

@Saviq
Copy link
Collaborator

Saviq commented Feb 23, 2024

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.:

mge::RenderingPlatform::RenderingPlatform(EGLDisplay dpy)
: dpy{dpy},
ctx{std::make_unique<BasicEGLContext>(dpy)}
{
// XWayland eglstream has always been kinda flaky, now it's somehow worse.
// Disable it until we've had a chance to look at what's wrong.
// setenv(mir_xwayland_option, "-eglstream", 1);
}

@Saviq Saviq added bug triaged Triage into JIRA to plan it in labels Feb 23, 2024
@Saviq
Copy link
Collaborator Author

Saviq commented Feb 23, 2024

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
Copy link
Contributor

RAOF commented Feb 27, 2024

Problems with NVIDIA on gbm-kms so far:

  • gbm_create_surface fails if you pass flags != 0 (at least USE_SCANOUT is necessary for other drivers 🤦‍♀️, and technically we should pass USE_RENDERING | USE_SCANOUT )
  • gbm_surface_has_free_buffers is broken (probably?), spuriously returning false; commenting out the check gets GBMSurface-backed output on NVIDIA.
  • eglQueryDmaBufModifiersEXT returns EGL_BAD_PARAMETER (spuriously? Or are we doing something wrong?)

@morphis
Copy link

morphis commented Feb 27, 2024

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.

@RAOF RAOF changed the title Failed to initialize glamor, falling back to sw with Xwayland on Nvidia Tracking bug for issues with gbm-kms platform on NVIDIA Mar 8, 2024
@Conan-Kudo
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triaged Triage into JIRA to plan it in
Projects
None yet
Development

No branches or pull requests

4 participants