Skip to content

sway 1.6 + egl error (optimus laptop amdgpu + nvidia)

I just updated to sway 1.6 and after reboot sway doesnt start, 1.5 had no problems, the error in the logs :

00:00:00.079 [ERROR] [wlr] [EGL] command: eglGetPlatformDisplay, error: EGL_BAD_PARAMETER (0x300c), message: "EGL_BAD_PARAMETER error: In internal function: Additional INFO may be available
"
00:00:00.399 [ERROR] [wlr] [EGL] command: eglQueryDevicesEXT, error: EGL_BAD_ALLOC (0x3003), message: "EGL_BAD_ALLOC error: In eglQueryDevicesEXT: Failed to allocate device list.
"
00:00:00.399 [ERROR] [wlr] [EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_DISPLAY (0x3008), message: "(null)"
00:00:00.399 [ERROR] [wlr] [render/egl.c:280] eglQueryDeviceStringEXT(EGL_EXTENSIONS) failed
00:00:00.399 [ERROR] [wlr] [EGL] command: eglMakeCurrent, error: EGL_BAD_DISPLAY (0x3008), message: "Invalid display (nil)"
00:00:00.400 [ERROR] [wlr] [render/wlr_renderer.c:263] Could not initialize EGL
00:00:00.400 [ERROR] [wlr] [backend/drm/renderer.c:34] Failed to create EGL/WLR renderer
00:00:00.402 [ERROR] [wlr] [backend/drm/backend.c:201] Failed to initialize renderer
00:00:00.403 [ERROR] [wlr] [backend/backend.c:174] Failed to create DRM backend
00:00:00.403 [ERROR] [wlr] [backend/backend.c:312] Failed to open any DRM device
00:00:00.440 [ERROR] [sway/server.c:55] Unable to create backend

My setup: nvidia driver blacklisted (and not loaded) and nvidia card pci suspended (power/control auto) for my everyday work so I can have better temps/battery, I enable it when needed. Sway configured to run with the igpu amdgpu card WLR_DRM_DEVICES=/dev/dri/card0 exec sway --my-next-gpu-wont-be-nvidia The error appears with or without the flag(s) --unsupported-gpu, --my-next-gpu-wont-be-nvidia

If I load the nvidia driver at boot sway works but the card stays in active state consuming power and increase temps, testing I noticed that if I install the aur packages libglvnd-git lib32-libglvnd-git Sway 1.6 works normally with my setup as in 1.5.

So the temporaily fix is to use the aur packages, or, I dont know if is possible, a way to tell sway to use only the mesa egl amdgpu?

9 points2 comments
Open on Reddit
About this post
Posted
Archived
Score
9 · 100% up
Kind
Text
ID
ms5fon

Author

3
posts
128
comments
1
media
View profile

3 comments

It's a bug in libglvnd that is merged (I think but not released yet).

When Sway checks for available devices with the GBM extension (at least I think it's the extension it's looking for) libglvnd return no device as soon as one installed driver fails to provide this extension (even if the driver is not loaded).

The merged patch yet to be released changes this logic so that it would return any device with a driver that provides the extension.

That's why the git version of libglvnd does work properly. You can either keep it until there's a new release of libglvnd or remove the nvidia driver from your system.

3 points

The failure is totally unrelated to gbm, libglvnd just gets confused when trying to dispatch egl. It's fixed in ligblvnd now at least, but they haven't cut a release in a while so the arch package doesn't have the fix. OP should just use libglvnd-git until arch patches libglvnd or a new release is made.

3 points
unknown author

Deleted before we saved it.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.