danvd / wlroots-eglstreams

A modular Wayland compositor library with EGLStreams support
MIT License
105 stars 11 forks source link

Does this currently work? #28

Open botiapa opened 3 years ago

botiapa commented 3 years ago

I'm trying to launch sway with wlroots-eglstreams. I'm using the git version, so I have the newest one compiled sway version 1.6-94e041b5 (Sep 13 2021, branch 'master').

But I'm getting the following error:

00:00:00.001 [ERROR] [sway/main.c:60] !!! Proprietary Nvidia drivers are in use !!!
00:00:00.005 [ERROR] [wlr] [backend/backend.c:442] Failed to open any DRM device
00:00:00.010 [ERROR] [sway/server.c:55] Unable to create backend

Also, I'm wondering whether wayfire works with this patch? Thanks for your response in advance.

EDIT: I managed to start both of them, I just needed to start the kernel with the drm option. I'm not sure how usable it is though, since on wayfire every window (probably xwayland?) is just a black rectangle.

colemickens commented 3 years ago

Can you elaborate? What kernel param did you pass, exactly? I have tried a few times over the last month to get this working and get roughly what you show...

danvd commented 3 years ago

Please check your permissions on dri card device. Mine are: ~ > ls -l /dev/dri/card0 crw-rw----+ 1 root video 226, 0 сен 14 00:21 /dev/dri/card0 And what groups you are in: ~ > groups libvirt users video uucp storage kvm disk audio

danvd commented 3 years ago

I did not try wayfire (will do), but in sway all apps including X work with HW acceleration just fine

PolyMeilex commented 3 years ago

For me everything besides gitkraken work flawlessly (but that's not this project specific issue, I have it on gnome too)

colemickens commented 3 years ago
cole@porty ~
❯ ls -al /dev/dri*
total 0
drwxr-xr-x   3 root root        100 Sep 15 17:14 .
drwxr-xr-x  20 root root       4040 Sep 15 17:15 ..
drwxr-xr-x   2 root root         80 Sep 15 17:14 by-path
crw-rw----+  1 root video  226,   0 Sep 15 17:14 card0
crw-rw-rw-   1 root render 226, 128 Sep 15 17:14 renderD128

~
❯ groups
cole wheel audio video dialout keys input kvm render

~
❯ sway --my-next-gpu-wont-be-nvidia
00:00:00.001 [sway/main.c:60] !!! Proprietary Nvidia drivers are in use !!!
00:00:00.002 [wlr] [libseat] [libseat/backend/seatd.c:78] Could not connect to socket /run/seatd.sock: No such file or directory
00:00:00.006 [wlr] [render/egl.c:593] Failed to initialize EGL context
00:00:00.006 [wlr] [render/gles2/renderer.c:789] Could not initialize EGL
sway: render/gles2/renderer.c:39: gles2_get_renderer: Assertion `wlr_renderer_is_gles2(wlr_renderer)' failed.
zsh: IOT instruction (core dumped)  sway --my-next-gpu-wont-be-nvidia
colemickens commented 3 years ago

I guess now that I look more closely, I see that it's just a different error. I'll open a new bug, sorry for any noise.

botiapa commented 3 years ago

So I managed to make sway work, however wayfire can only display wayland-native applications. XWayland applications only show a black rectangle.

anyputer commented 3 years ago

Wayfire shows GL applications as black here, next to XWayland... but it's almost amazing other than that!

g4gg433 commented 3 years ago

Can confirm above. Under sway everything so far tested works flawlessly.

Under wayfire there are two major problems: -XWayland apps just show a black rectangle -Wayland native applications take like 10 seconds to show a window only Chromium shows up instantly with --disable-gpu flag (this seemingly is also the case on sway but only for GTK applications, electron wayland shows up instantly)

Either this is a problem with wayfires implementation or nvidias rendering. Under GNOME all of this works flawlessly after setting GNOMEs dconf kms-modifier to true.

EDIT: This seems to be a problem with the rendering. MPV also shows a black rectangle despite using the config that works as a wayland native window under GNOME (gpu-context=wayland opengl-es=yes)

To add more info. It seems to me (who has no clue about Wayland rendering architecture) that sway is directly writing the client pixels as it receives it while wayfire is applying transforms (the graphical effects). Nvidia wayland only works for applications that can either disable gpu support (as explained for Chromium) or use "opengl-es" (or opengl-desktop for chromium/electron). Wayfire problably just does not check for this (why should it anyway I guess) and as thus it just renders a black window just like mpv does on GNOME if you do not append --opengl-es=yes