Skip to content

Glamor egl merge and split#2143

Open
stefan11111 wants to merge 13 commits intoX11Libre:masterfrom
stefan11111:glamor-egl-merge-and-split
Open

Glamor egl merge and split#2143
stefan11111 wants to merge 13 commits intoX11Libre:masterfrom
stefan11111:glamor-egl-merge-and-split

Conversation

@stefan11111
Copy link
Copy Markdown
Contributor

Pull all generic glamor stuff into dix, and all the xf86 stuff into hw/xfree86
Now Xfbdev uses this too.
Perhaps Xvfb can use this too? https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/235

@stefan11111 stefan11111 force-pushed the glamor-egl-merge-and-split branch 22 times, most recently from e562d10 to 6cde4b9 Compare March 20, 2026 00:45
@stefan11111 stefan11111 force-pushed the glamor-egl-merge-and-split branch 3 times, most recently from 109d913 to 138e363 Compare April 2, 2026 18:10
@stefan11111
Copy link
Copy Markdown
Contributor Author

@metux Is this pr fine as-is, or do you have a commit in mind where I should split this?

@stefan11111
Copy link
Copy Markdown
Contributor Author

Split the first 2 commits related to libdrm into #2154

@stefan11111
Copy link
Copy Markdown
Contributor Author

@algrid

For some reason, I only got this on email, but I can't see it on github:

>  
-    void* saved_free_screen;
+    char *glvnd_vendor; /* glvnd vendor library or driver name */
+    int fd; /* /dev/dri/cardxx */
+    int dmabuf_forced; /* If glamor should not use dynamic logic and only listen to the config below */

Where dmabuf_forced is used? I can only find a place where it's set to true, but no usage.

It is checked in glamor_egl_init_internal, where the dynamic dmabuf logic is:

-        if (strstr((const char *)renderer, "Intel"))
+        if (glamor_egl_conf->dmabuf_forced)
+            glamor_egl->dmabuf_capable = glamor_egl_conf->dmabuf_capable;
+        else if (!renderer)
+            glamor_egl->dmabuf_capable = FALSE;
+        else if (strstr((const char *)renderer, "Intel"))
            glamor_egl->dmabuf_capable = TRUE;
        else if (strstr((const char *)renderer, "zink"))
            glamor_egl->dmabuf_capable = TRUE;
        else if (strstr((const char *)renderer, "NVIDIA"))
            glamor_egl->dmabuf_capable = TRUE;
        else if (strstr((const char *)renderer, "radeonsi"))
            glamor_egl->dmabuf_capable = TRUE;
        else
-            glamor_egl->dmabuf_capable = (glamor_egl->dmabuf_capable == TRUE);
+            glamor_egl->dmabuf_capable = FALSE;

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Merge Conflict found

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
@cepelinas9000
Copy link
Copy Markdown
Contributor

We need some some backports of this pr to pr/25.1 and maybe to pr/25.0, I noticed having nvidia & amd gpus on same system. I have failing nvidia on glamor:

... log snippet ...
[2026-04-09 14:41:20] (EE) glamor: eglInitialize() failed on EGL_PLATFORM_GBM_KHR
[2026-04-09 14:41:20] (EE) glamor: eglInitialize() failed on EGL_PLATFORM_GBM_MESA
[2026-04-09 14:41:20] (II) glamor: eglInitialize() succeeded on EGL_PLATFORM_DEVICE_EXT
[2026-04-09 14:41:20] (II) glamor: Using OpenGL 3.1 context.
[2026-04-09 14:41:20] (II) glamor dri X acceleration enabled on NVIDIA GeForce RTX 3090/PCIe/SSE2

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Don't require `EGL_KHR_no_config_context` , nvidia 390 drivers
don't support it.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
…GLDisplay

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
to take a small config struct instead of the glamor private

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
for glamor_egl's private data

This allows glamor to fully manage it's resources and not leak or use-after-free.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
`glamor_egl_init2` is now another function that can be used by xf86 drivers

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
… `glamor_egl_init2`

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
@stefan11111
Copy link
Copy Markdown
Contributor Author

We need some some backports of this pr to pr/25.1 and maybe to pr/25.0, I noticed having nvidia & amd gpus on same system. I have failing nvidia on glamor:

... log snippet ...
[2026-04-09 14:41:20] (EE) glamor: eglInitialize() failed on EGL_PLATFORM_GBM_KHR
[2026-04-09 14:41:20] (EE) glamor: eglInitialize() failed on EGL_PLATFORM_GBM_MESA
[2026-04-09 14:41:20] (II) glamor: eglInitialize() succeeded on EGL_PLATFORM_DEVICE_EXT
[2026-04-09 14:41:20] (II) glamor: Using OpenGL 3.1 context.
[2026-04-09 14:41:20] (II) glamor dri X acceleration enabled on NVIDIA GeForce RTX 3090/PCIe/SSE2

That's really weird.
The extra glamor messages are from this pr, so I'll assume you user the entire pr.

From the log, you tested this on a 3090, where gbm should work.

    if (glamor_egl->fd >= 0) {
        GLAMOR_EGL_TRY_PLATFORM(EGL_PLATFORM_GBM_KHR, glamor_egl->gbm, FALSE);
        GLAMOR_EGL_TRY_PLATFORM(EGL_PLATFORM_GBM_MESA, glamor_egl->gbm, TRUE);
    }
[2026-04-09 14:41:20] (EE) glamor: eglInitialize() failed on EGL_PLATFORM_GBM_KHR
[2026-04-09 14:41:20] (EE) glamor: eglInitialize() failed on EGL_PLATFORM_GBM_MESA

This means that you have an fd and a gbm device, but from the log, egl couldn't initialize on it (perhaps not the nvidia backend)?

    if (glamor_query_devices_ext(&devices, &num_devices)) {
#define GLAMOR_EGL_TRY_PLATFORM_DEVICE(strict) \
        for (uint32_t i = 0; i < num_devices; i++) { \
            if (glamor_egl_device_matches_config(devices[i], glamor_egl, strict, &driver_name)) { \
                GLAMOR_EGL_TRY_PLATFORM(EGL_PLATFORM_DEVICE_EXT, devices[i], TRUE); \
            } \
        }

        GLAMOR_EGL_TRY_PLATFORM_DEVICE(2);
        GLAMOR_EGL_TRY_PLATFORM_DEVICE(1);
        GLAMOR_EGL_TRY_PLATFORM_DEVICE(0);
[2026-04-09 14:41:20] (II) glamor: eglInitialize() succeeded on EGL_PLATFORM_DEVICE_EXT

Since it couldn't initialize on gbm, it fell back to the device platform.
From your log, glamor found a suitable device and initialized on it.

    /* Check if at least one combination of format + modifier is supported */
    CARD32 *formats = NULL;
    CARD32 num_formats = 0;
    Bool found = FALSE;
    if (!glamor_get_formats_internal(glamor_egl, &num_formats, &formats)) {
        goto glamor_no_dri;
    }

    if (num_formats == 0) {
        found = TRUE;
    }

    for (uint32_t i = 0; i < num_formats; i++) {
        uint64_t *modifiers = NULL;
        uint32_t num_modifiers = 0;
        if (glamor_get_modifiers_internal(glamor_egl, formats[i],
                                          &num_modifiers, &modifiers)) {
            found = TRUE;
            free(modifiers);
            break;
        }
    }
    free(formats);

    if (!found) {
        LogMessage(X_ERROR,
                   "glamor: No combination of format + modifier is supported\n");
        goto glamor_no_dri;
    }

    LogMessage(X_INFO, "glamor dri X acceleration enabled on %s\n",
               renderer);
[2026-04-09 14:41:20] (II) glamor dri X acceleration enabled on NVIDIA GeForce RTX 3090/PCIe/SSE2

This means that glamor found a (format, modifier) pair that it could use, so it initialized DRI3.

This means that you are using the nvidia gbm backend.
But if so, why did egl not initialize on the gbm platform in the first place.

I assume that without this pr glamor just fails to initialize?
What does eglinitialize -B say on your system?

@stefan11111
Copy link
Copy Markdown
Contributor Author

Split the first 4 commits (everything before the more egl platforms change) into #2167

@cepelinas9000
Copy link
Copy Markdown
Contributor

We need some some backports of this pr to pr/25.1 and maybe to pr/25.0, I noticed having nvidia & amd gpus on same system. I have failing nvidia on glamor:

... log snippet ...
[2026-04-09 14:41:20] (EE) glamor: eglInitialize() failed on EGL_PLATFORM_GBM_KHR
[2026-04-09 14:41:20] (EE) glamor: eglInitialize() failed on EGL_PLATFORM_GBM_MESA
[2026-04-09 14:41:20] (II) glamor: eglInitialize() succeeded on EGL_PLATFORM_DEVICE_EXT
[2026-04-09 14:41:20] (II) glamor: Using OpenGL 3.1 context.
[2026-04-09 14:41:20] (II) glamor dri X acceleration enabled on NVIDIA GeForce RTX 3090/PCIe/SSE2

That's really weird. The extra glamor messages are from this pr, so I'll assume you user the entire pr.

From the log, you tested this on a 3090, where gbm should work.

    if (glamor_egl->fd >= 0) {
        GLAMOR_EGL_TRY_PLATFORM(EGL_PLATFORM_GBM_KHR, glamor_egl->gbm, FALSE);
        GLAMOR_EGL_TRY_PLATFORM(EGL_PLATFORM_GBM_MESA, glamor_egl->gbm, TRUE);
    }
[2026-04-09 14:41:20] (EE) glamor: eglInitialize() failed on EGL_PLATFORM_GBM_KHR
[2026-04-09 14:41:20] (EE) glamor: eglInitialize() failed on EGL_PLATFORM_GBM_MESA

This means that you have an fd and a gbm device, but from the log, egl couldn't initialize on it (perhaps not the nvidia backend)?

    if (glamor_query_devices_ext(&devices, &num_devices)) {
#define GLAMOR_EGL_TRY_PLATFORM_DEVICE(strict) \
        for (uint32_t i = 0; i < num_devices; i++) { \
            if (glamor_egl_device_matches_config(devices[i], glamor_egl, strict, &driver_name)) { \
                GLAMOR_EGL_TRY_PLATFORM(EGL_PLATFORM_DEVICE_EXT, devices[i], TRUE); \
            } \
        }

        GLAMOR_EGL_TRY_PLATFORM_DEVICE(2);
        GLAMOR_EGL_TRY_PLATFORM_DEVICE(1);
        GLAMOR_EGL_TRY_PLATFORM_DEVICE(0);
[2026-04-09 14:41:20] (II) glamor: eglInitialize() succeeded on EGL_PLATFORM_DEVICE_EXT

Since it couldn't initialize on gbm, it fell back to the device platform. From your log, glamor found a suitable device and initialized on it.

    /* Check if at least one combination of format + modifier is supported */
    CARD32 *formats = NULL;
    CARD32 num_formats = 0;
    Bool found = FALSE;
    if (!glamor_get_formats_internal(glamor_egl, &num_formats, &formats)) {
        goto glamor_no_dri;
    }

    if (num_formats == 0) {
        found = TRUE;
    }

    for (uint32_t i = 0; i < num_formats; i++) {
        uint64_t *modifiers = NULL;
        uint32_t num_modifiers = 0;
        if (glamor_get_modifiers_internal(glamor_egl, formats[i],
                                          &num_modifiers, &modifiers)) {
            found = TRUE;
            free(modifiers);
            break;
        }
    }
    free(formats);

    if (!found) {
        LogMessage(X_ERROR,
                   "glamor: No combination of format + modifier is supported\n");
        goto glamor_no_dri;
    }

    LogMessage(X_INFO, "glamor dri X acceleration enabled on %s\n",
               renderer);
[2026-04-09 14:41:20] (II) glamor dri X acceleration enabled on NVIDIA GeForce RTX 3090/PCIe/SSE2

This means that glamor found a (format, modifier) pair that it could use, so it initialized DRI3.

This means that you are using the nvidia gbm backend. But if so, why did egl not initialize on the gbm platform in the first place.

I assume that without this pr glamor just fails to initialize? What does eglinitialize -B say on your system?

On that system there are two gpus:

/dev/dri/card0 - found 1st amd & no monitors connected
/dev/dri/card1 - nvidia


with patch:

eglinfo -B
GBM platform:
eglinfo: eglInitialize failed

Wayland platform:
eglinfo: eglInitialize failed

X11 platform:
eglinfo: eglInitialize failed

Surfaceless platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 595.58.03
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 595.58.03
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 595.58.03
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device platform:
Device #0:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 595.58.03
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 595.58.03
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 595.58.03
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device #1:

Platform Device platform:
libEGL warning: pci id for fd 24: 10de:2204, driver (null)

pci id for fd 26: 10de:2204, driver (null)
kmsro: driver missing
libEGL warning: egl: failed to create dri2 screen
libEGL warning: pci id for fd 24: 10de:2204, driver (null)

pci id for fd 26: 10de:2204, driver (null)
kmsro: driver missing
libEGL warning: egl: failed to create dri2 screen
libEGL warning: pci id for fd 24: 10de:2204, driver (null)

eglinfo: eglInitialize failed

Device #2:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: AMD
OpenGL core profile renderer: AMD Ryzen 9 7950X 16-Core Processor (radeonsi, raphael_mendocino, LLVM 21.1.8, DRM 3.64, 6.18.8)
OpenGL core profile version: 4.6 (Core Profile) Mesa 25.2.8
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: AMD
OpenGL compatibility profile renderer: AMD Ryzen 9 7950X 16-Core Processor (radeonsi, raphael_mendocino, LLVM 21.1.8, DRM 3.64, 6.18.8)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 25.2.8
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: AMD
OpenGL ES profile renderer: AMD Ryzen 9 7950X 16-Core Processor (radeonsi, raphael_mendocino, LLVM 21.1.8, DRM 3.64, 6.18.8)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 25.2.8
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device #3:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: Mesa
OpenGL core profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL core profile version: 4.5 (Core Profile) Mesa 25.2.8
OpenGL core profile shading language version: 4.50
OpenGL compatibility profile vendor: Mesa
OpenGL compatibility profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 25.2.8
OpenGL compatibility profile shading language version: 4.50
OpenGL ES profile vendor: Mesa
OpenGL ES profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 25.2.8
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

without patch:

eglinfo -B
GBM platform:
eglinfo: eglInitialize failed

Wayland platform:
eglinfo: eglInitialize failed

X11 platform:
eglinfo: eglInitialize failed

Surfaceless platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 595.58.03
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 595.58.03
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 595.58.03
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device platform:
Device #0:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 595.58.03
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 595.58.03
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 595.58.03
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device #1:

Platform Device platform:
libEGL warning: pci id for fd 24: 10de:2204, driver (null)

pci id for fd 26: 10de:2204, driver (null)
kmsro: driver missing
libEGL warning: egl: failed to create dri2 screen
libEGL warning: pci id for fd 24: 10de:2204, driver (null)

pci id for fd 26: 10de:2204, driver (null)
kmsro: driver missing
libEGL warning: egl: failed to create dri2 screen
libEGL warning: pci id for fd 24: 10de:2204, driver (null)

eglinfo: eglInitialize failed

Device #2:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: AMD
OpenGL core profile renderer: AMD Ryzen 9 7950X 16-Core Processor (radeonsi, raphael_mendocino, LLVM 21.1.8, DRM 3.64, 6.18.8)
OpenGL core profile version: 4.6 (Core Profile) Mesa 25.2.8
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: AMD
OpenGL compatibility profile renderer: AMD Ryzen 9 7950X 16-Core Processor (radeonsi, raphael_mendocino, LLVM 21.1.8, DRM 3.64, 6.18.8)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 25.2.8
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: AMD
OpenGL ES profile renderer: AMD Ryzen 9 7950X 16-Core Processor (radeonsi, raphael_mendocino, LLVM 21.1.8, DRM 3.64, 6.18.8)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 25.2.8
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device #3:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: Mesa
OpenGL core profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL core profile version: 4.5 (Core Profile) Mesa 25.2.8
OpenGL core profile shading language version: 4.50
OpenGL compatibility profile vendor: Mesa
OpenGL compatibility profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 25.2.8
OpenGL compatibility profile shading language version: 4.50
OpenGL ES profile vendor: Mesa
OpenGL ES profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 25.2.8
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Only difference that glamor is disabled:

[2026-04-09 15:33:24] (II) Loading sub module "glamoregl"
[2026-04-09 15:33:24] (II) LoadModule: "glamoregl"
[2026-04-09 15:33:24] LoaderOpen(/tmp/x11libre/lib64/xorg/modules/xlibre-25/libglamoregl.so)
[2026-04-09 15:33:24] (II) Loading /tmp/x11libre/lib64/xorg/modules/xlibre-25/libglamoregl.so
[2026-04-09 15:33:24] (II) Module glamoregl: vendor="X.Org Foundation"
[2026-04-09 15:33:24] (II) modeset(0): glamor initialization failed
[2026-04-09 15:33:24] (II) Loading sub module "glamoregl"
[2026-04-09 15:33:24] (II) LoadModule: "glamoregl"
[2026-04-09 15:33:24] LoaderOpen(/tmp/x11libre/lib64/xorg/modules/xlibre-25/libglamoregl.so)
[2026-04-09 15:33:24] (II) Loading /tmp/x11libre/lib64/xorg/modules/xlibre-25/libglamoregl.so
[2026-04-09 15:33:24] (II) Module glamoregl: vendor="X.Org Foundation"
[2026-04-09 15:33:24] (II) glamor: Using OpenGL 4.6 context.
[2026-04-09 15:33:24] (II) glamor X acceleration enabled on AMD Ryzen 9 7950X 16-Core Processor (radeonsi, raphael_mendocino, LLVM 21.1.8, DRM 3.64, 6.18.8)
[2026-04-09 15:33:24] (II) modeset(G0): glamor initialized

...

Xorg.1.log

@stefan11111
Copy link
Copy Markdown
Contributor Author

GBM platform:
eglinfo: eglInitialize failed

This one is not affected by the X server, it should work even in a tty.

X11 platform:
eglinfo: eglInitialize failed

This one is, but I don't think the X server is the issue here.

It looks like a setup issue to me, I had this problem before.
I'll assume this is a gentoo system.

Otoh, you need at least these for gbm to work on nvidia:
libgbm and the nvidia backend.

the nvidia egl libs provided by gui-libs/egl-gbm.

modeset=1 passed to the nvidia-drm module (I have options nvidia-drm modeset=1 in /etc/modprobe.d/nvidia.conf to do it automatically).
And

And you need the right config options for the kernel.

You need at least : CONFIG_DRM=y CONFIG_DRM_KMS_HELPER=y CONFIG_DRM_TTM=y CONFIG_DRM_TTM_HELPER=y

I Enabled CONFIG_DRM_QXL=y, which pulls these in.

For reference, here is my eglinfo -B

GBM platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 580.95.05
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 580.95.05
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 580.95.05
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

X11 platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 580.95.05
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 580.95.05
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 580.95.05
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Surfaceless platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 580.95.05
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 580.95.05
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 580.95.05
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device platform:
Device #0:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 580.95.05
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 580.95.05
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 580.95.05
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

@cepelinas9000
Copy link
Copy Markdown
Contributor

the nvidia egl libs provided by gui-libs/egl-gbm

That good catch. Installed it and now modesetting working correctly

now eglinfo -B looks good:

GBM platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 595.58.03
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 595.58.03
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 595.58.03
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Wayland platform:
eglinfo: eglInitialize failed

X11 platform:
libEGL warning: pci id for fd 27: 10de:2204, driver (null)

pci id for fd 28: 10de:2204, driver (null)
kmsro: driver missing
libEGL warning: egl: failed to create dri2 screen
libEGL warning: egl: failed to create dri2 screen
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: Mesa
OpenGL core profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL core profile version: 4.5 (Core Profile) Mesa 25.2.8
OpenGL core profile shading language version: 4.50
OpenGL compatibility profile vendor: Mesa
OpenGL compatibility profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 25.2.8
OpenGL compatibility profile shading language version: 4.50
OpenGL ES profile vendor: Mesa
OpenGL ES profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 25.2.8
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Surfaceless platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 595.58.03
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 595.58.03
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 595.58.03
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device platform:
Device #0:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 595.58.03
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 595.58.03
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 595.58.03
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device #1:

Platform Device platform:
libEGL warning: pci id for fd 25: 10de:2204, driver (null)

pci id for fd 27: 10de:2204, driver (null)
kmsro: driver missing
libEGL warning: egl: failed to create dri2 screen
libEGL warning: pci id for fd 25: 10de:2204, driver (null)

pci id for fd 27: 10de:2204, driver (null)
kmsro: driver missing
libEGL warning: egl: failed to create dri2 screen
libEGL warning: pci id for fd 25: 10de:2204, driver (null)

eglinfo: eglInitialize failed

Device #2:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: AMD
OpenGL core profile renderer: AMD Ryzen 9 7950X 16-Core Processor (radeonsi, raphael_mendocino, LLVM 21.1.8, DRM 3.64, 6.18.8)
OpenGL core profile version: 4.6 (Core Profile) Mesa 25.2.8
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: AMD
OpenGL compatibility profile renderer: AMD Ryzen 9 7950X 16-Core Processor (radeonsi, raphael_mendocino, LLVM 21.1.8, DRM 3.64, 6.18.8)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 25.2.8
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: AMD
OpenGL ES profile renderer: AMD Ryzen 9 7950X 16-Core Processor (radeonsi, raphael_mendocino, LLVM 21.1.8, DRM 3.64, 6.18.8)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 25.2.8
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device #3:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: Mesa
OpenGL core profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL core profile version: 4.5 (Core Profile) Mesa 25.2.8
OpenGL core profile shading language version: 4.50
OpenGL compatibility profile vendor: Mesa
OpenGL compatibility profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 25.2.8
OpenGL compatibility profile shading language version: 4.50
OpenGL ES profile vendor: Mesa
OpenGL ES profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 25.2.8
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

@stefan11111
Copy link
Copy Markdown
Contributor Author

stefan11111 commented Apr 9, 2026

now eglinfo -B looks good:

X11 platform:
libEGL warning: pci id for fd 27: 10de:2204, driver (null)

pci id for fd 28: 10de:2204, driver (null)
kmsro: driver missing
libEGL warning: egl: failed to create dri2 screen
libEGL warning: egl: failed to create dri2 screen
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: Mesa
OpenGL core profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL core profile version: 4.5 (Core Profile) Mesa 25.2.8
OpenGL core profile shading language version: 4.50
OpenGL compatibility profile vendor: Mesa
OpenGL compatibility profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 25.2.8
OpenGL compatibility profile shading language version: 4.50
OpenGL ES profile vendor: Mesa
OpenGL ES profile renderer: llvmpipe (LLVM 21.1.8, 256 bits)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 25.2.8
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

The gbm platform looks good, but are you sure this is good?
On the X11 platform, you are using llvmpipe instead of nvidia/mesa (depending on the card).
What happens if you do prime-run eglinfo -B p x11?

@github-actions
Copy link
Copy Markdown

Merge Conflict found

@github-actions
Copy link
Copy Markdown

Merge Conflict found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants