Wlroots: Sway fails to start with nvidia egl vendor libraries installed

Created on 17 Nov 2020  Â·  4Comments  Â·  Source: swaywm/wlroots

Sway fails to start, on both the wayland and drm backends. This behavior begins for me in c8d95acc.

$ sway --version
sway version 1.5-f5ca4c26 (Nov 16 2020, branch 'master')
$ pacman -Q mesa libglvnd
mesa 20.2.2-2
libglvnd 1.3.2-1
$ lspci -kd::300
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04)
    DeviceName:  Onboard IGD
    Subsystem: Dell Device 07be
    Kernel driver in use: i915
    Kernel modules: i915
$ uname -a
Linux rxps 5.9.8-arch1-1 #1 SMP PREEMPT Tue, 10 Nov 2020 22:44:11 +0000 x86_64 GNU/Linux

The following debug log was captured when attempting to start sway:



sway log

00:00:00.000 [sway/main.c:327] Sway version 1.5-f5ca4c26 (Nov 16 2020, branch 'master')
00:00:00.002 [sway/main.c:154] Linux rxps 5.9.8-arch1-1 #1 SMP PREEMPT Tue, 10 Nov 2020 22:44:11 +0000 x86_64 GNU/Linux
00:00:00.002 [sway/main.c:170] Contents of /etc/lsb-release:
00:00:00.002 [sway/main.c:154] LSB_VERSION=1.4
00:00:00.002 [sway/main.c:154] DISTRIB_ID=Arch
00:00:00.002 [sway/main.c:154] DISTRIB_RELEASE=rolling
00:00:00.002 [sway/main.c:154] DISTRIB_DESCRIPTION="Arch Linux"
00:00:00.002 [sway/main.c:170] Contents of /etc/os-release:
00:00:00.002 [sway/main.c:154] NAME="Arch Linux"
00:00:00.002 [sway/main.c:154] PRETTY_NAME="Arch Linux"
00:00:00.002 [sway/main.c:154] ID=arch
00:00:00.002 [sway/main.c:154] BUILD_ID=rolling
00:00:00.002 [sway/main.c:154] ANSI_COLOR="38;2;23;147;209"
00:00:00.002 [sway/main.c:154] HOME_URL="https://www.archlinux.org/"
00:00:00.002 [sway/main.c:154] DOCUMENTATION_URL="https://wiki.archlinux.org/"
00:00:00.002 [sway/main.c:154] SUPPORT_URL="https://bbs.archlinux.org/"
00:00:00.002 [sway/main.c:154] BUG_REPORT_URL="https://bugs.archlinux.org/"
00:00:00.002 [sway/main.c:154] LOGO=archlinux
00:00:00.002 [sway/main.c:142] LD_LIBRARY_PATH=
00:00:00.002 [sway/main.c:142] LD_PRELOAD=
00:00:00.002 [sway/main.c:142] PATH=/home/ronan/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
00:00:00.002 [sway/main.c:142] SWAYSOCK=
00:00:00.002 [sway/server.c:44] Preparing Wayland server initialization
00:00:00.007 [INFO] [backend/session/logind.c:853] Successfully loaded logind session
00:00:00.009 [INFO] [backend/backend.c:157] Found 1 GPUs
00:00:00.009 [INFO] [backend/drm/backend.c:138] Initializing DRM backend for /dev/dri/card0 (i915)
00:00:00.009 [DEBUG] [backend/drm/drm.c:71] Using atomic DRM interface
00:00:00.009 [INFO] [backend/drm/drm.c:256] Found 3 DRM CRTCs
00:00:00.009 [INFO] [backend/drm/drm.c:177] Found 9 DRM planes
00:00:00.049 [ERROR] [EGL] command: eglGetPlatformDisplay, error: EGL_BAD_PARAMETER (0x300c), message: "EGL_BAD_PARAMETER error: In internal function: Additional INFO may be available
"
00:00:00.049 [INFO] [EGL] command: eglGetPlatformDisplay, error: EGL_BAD_PARAMETER (0x300c), message: "EGL_BAD_PARAMETER error: In function eglGetPlatformDisplay(), unsupported EGL Platform
"
00:00:00.053 [ERROR] [EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_DISPLAY (0x3008), message: "(null)"
00:00:00.053 [ERROR] [render/egl.c:314] eglQueryDeviceStringEXT(EGL_EXTENSIONS) failed
00:00:00.053 [ERROR] [EGL] command: eglMakeCurrent, error: EGL_BAD_DISPLAY (0x3008), message: "Invalid display (nil)"
00:00:00.053 [ERROR] [render/wlr_renderer.c:261] Could not initialize EGL
00:00:00.053 [ERROR] [backend/drm/renderer.c:47] Failed to create EGL/WLR renderer
00:00:00.054 [ERROR] [backend/drm/backend.c:182] Failed to initialize renderer
00:00:00.055 [ERROR] [backend/backend.c:163] Failed to open DRM device 9
00:00:00.055 [ERROR] [backend/backend.c:303] Failed to open any DRM device
00:00:00.096 [sway/server.c:50] Unable to create backend

I get the same result using both the iris and i965 drivers.

Regarding the EGL_BAD_PARAMETER error message, it comes from here:

$ ls /usr/share/glvnd/egl_vendor.d
10_nvidia.json
50_mesa.json
$ cat 10_nvidia.json
{
  "file_format_version": "1.0.0",
  "ICD": {
    "library_path": "libEGL_nvidia.so.0"
  }
}
$ strings /usr/include/libEGL_nvidia.so.0 | grep "unsupported EGL Platform"
EGL_BAD_PARAMETER error: In function eglGetPlatformDisplay(), unsupported EGL Platform

My laptop contains an nvidia card, but both nvidia and nouveau are blacklisted. I keep the card powered off using the method described here.

Sure enough, pacman -Rns nvidia nvidia-utils allows me to launch sway again. Can we find a solution that doesn't require me to uninstall these? I may need that hardware to function outside of sway.

Most helpful comment

We can't help because it's all about a proprietary driver we don't have the source code for.

The final error message in my case comes from the nvidia EGL vendor library, but it shouldn't have reached there in the first place. The bug is within glvnd, mesa, or wlroots at that point – and we have the sources for those projects.

Anyway, I did chase this down and submitted this libglvnd MR which resolves the issue.

All 4 comments

This

00:00:00.053 [ERROR] [render/egl.c:314] eglQueryDeviceStringEXT(EGL_EXTENSIONS) failed

can't come from Mesa, because Mesa's implementation straight up returns the dev->extensions list.

I'd suggest reporting a bug to NVIDIA or libglvnd. We can't help because it's all about a proprietary driver we don't have the source code for.

We can't help because it's all about a proprietary driver we don't have the source code for.

The final error message in my case comes from the nvidia EGL vendor library, but it shouldn't have reached there in the first place. The bug is within glvnd, mesa, or wlroots at that point – and we have the sources for those projects.

Anyway, I did chase this down and submitted this libglvnd MR which resolves the issue.

It is because sway does not currently support eglstreams and they won't because its propierity perhaps when vulkan support comes too wlroots nvidia will run.

No. It's because of a libglvnd bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

m01 picture m01  Â·  3Comments

ddevault picture ddevault  Â·  5Comments

emersion picture emersion  Â·  4Comments

acrisci picture acrisci  Â·  5Comments

luispabon picture luispabon  Â·  4Comments