danvd / wlroots-eglstreams

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

Vulkan support #43

Open GrabbenD opened 2 years ago

GrabbenD commented 2 years ago

This fork has finally allowed me to run Sway without pixel flickering but it looks like Vulkan support is missing unless I've done something wrong? With WLR_RENDERER=vulkan Sway fails due to:

00:00:00.000 [INFO] [sway/main.c:338] Sway version 1.8-dev-0ca00b35 (Oct  7 2022, branch 'HEAD')
00:00:00.000 [INFO] [sway/main.c:339] wlroots version 0.16.0-dev
00:00:00.001 [INFO] [sway/main.c:120] Linux unix 5.19.10-xanmod1-x86_64 #1 SMP PREEMPT_DYNAMIC Fri Sep 30 12:45:51 CEST 2022 x86_64 AMD Ryzen 9 5950X 16-Core Processor AuthenticAMD GNU/Linux
00:00:00.001 [INFO] [sway/main.c:136] Contents of /etc/lsb-release:
00:00:00.001 [INFO] [sway/main.c:120] DISTRIB_ID="Gentoo"
00:00:00.001 [INFO] [sway/main.c:136] Contents of /etc/os-release:
00:00:00.001 [INFO] [sway/main.c:120] NAME=Gentoo
00:00:00.001 [INFO] [sway/main.c:120] ID=gentoo
00:00:00.001 [INFO] [sway/main.c:120] PRETTY_NAME="Gentoo Linux"
00:00:00.001 [INFO] [sway/main.c:120] ANSI_COLOR="1;32"
00:00:00.001 [INFO] [sway/main.c:120] HOME_URL="https://www.gentoo.org/"
00:00:00.001 [INFO] [sway/main.c:120] SUPPORT_URL="https://www.gentoo.org/support/"
00:00:00.001 [INFO] [sway/main.c:120] BUG_REPORT_URL="https://bugs.gentoo.org/"
00:00:00.001 [INFO] [sway/main.c:120] VERSION_ID="2.9"
00:00:00.001 [INFO] [sway/main.c:136] Contents of /etc/gentoo-release:
00:00:00.001 [INFO] [sway/main.c:120] Gentoo Base System release 2.9
00:00:00.001 [INFO] [sway/main.c:108] LD_LIBRARY_PATH=
00:00:00.001 [INFO] [sway/main.c:108] LD_PRELOAD=
00:00:00.001 [INFO] [sway/main.c:108] PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/bin:/usr/lib/llvm/15/bin:/usr/lib/llvm/14/bin
00:00:00.001 [INFO] [sway/main.c:108] SWAYSOCK=
00:00:00.001 [ERROR] [sway/main.c:62] !!! Proprietary Nvidia drivers are in use !!!
00:00:00.001 [INFO] [sway/main.c:376] Starting sway version 1.8-dev-0ca00b35 (Oct  7 2022, branch 'HEAD')
00:00:00.002 [INFO] [wlr] [libseat] [libseat/backend/seatd.c:64] Could not connect to socket /run/seatd.sock: No such file or directory
00:00:00.002 [INFO] [wlr] [libseat] [libseat/libseat.c:76] Backend 'seatd' failed to open seat, skipping
00:00:00.007 [INFO] [wlr] [libseat] [libseat/libseat.c:73] Seat opened with backend 'logind'
00:00:00.007 [INFO] [wlr] [backend/session/session.c:110] Successfully loaded libseat session
00:00:00.008 [INFO] [wlr] [backend/backend.c:220] Found 1 GPUs
00:00:00.008 [INFO] [wlr] [backend/drm/backend.c:202] Initializing DRM backend for /dev/dri/card0 (nvidia-drm)
00:00:00.008 [INFO] [wlr] [backend/drm/drm.c:261] Found 4 DRM CRTCs
00:00:00.008 [INFO] [wlr] [backend/drm/drm.c:182] Found 12 DRM planes
00:00:00.008 [INFO] [wlr] [render/wlr_renderer.c:294] Loading user-specified renderer due to WLR_RENDERER: vulkan
00:00:00.008 [INFO] [wlr] [render/vulkan/renderer.c:1473] The vulkan renderer is only experimental and not expected to be ready for daily use
00:00:00.101 [INFO] [wlr] [render/vulkan/vulkan.c:282] Vulkan device: 'NVIDIA GeForce RTX 3080 Ti'
00:00:00.101 [INFO] [wlr] [render/vulkan/vulkan.c:283]   Device type: 'discrete'
00:00:00.101 [INFO] [wlr] [render/vulkan/vulkan.c:284]   Supported API version: 1.3.205
00:00:00.101 [INFO] [wlr] [render/vulkan/vulkan.c:285]   Driver version: 515.260.64
00:00:00.101 [INFO] [wlr] [render/vulkan/vulkan.c:370]   Driver name: NVIDIA (515.65.01)
00:00:00.101 [INFO] [wlr] [render/vulkan/vulkan.c:384] Found matching Vulkan physical device: NVIDIA GeForce RTX 3080 Ti
00:00:00.146 [INFO] [wlr] [render/wlr_renderer.c:222] EGLStreams: binding wl_disply to EGL and initializing eglstream controller...
sway: render/gles2/renderer.c:39: gles2_get_renderer: Assertion `wlr_renderer_is_gles2(wlr_renderer)' failed.

For reference, I can use Vulkan renderer in Sway 1.7 with wlroots 0.15.1 using GBM and NVIDIA driver v515.65.01 (it works with either the open- and closed driver)

TheGreatMcPain commented 2 years ago

I was able to fix the pixel flickering I was getting in Hyprland by patching wlroots like so.

--- render/gles2/renderer.c 2022-02-03 16:19:54.000000000 -0500
+++ render/gles2/renderer.c 2022-08-20 09:29:26.937878381 -0400
@@ -159,7 +159,7 @@
        assert(wlr_egl_is_current(renderer->egl));

        push_gles2_debug(renderer);
-       glFlush();
+       glFinish();
        glBindFramebuffer(GL_FRAMEBUFFER, 0);
        pop_gles2_debug(renderer);
GrabbenD commented 2 years ago

@TheGreatMcPain I just took a look Hyprland and it looks very interesting and their documentation has various tweaks for NVIDIA, thanks a lot for mentioning it! https://wiki.hyprland.org/Nvidia/

Regarding Vulkan support in wlroots-eglstream, looks like the author actually removed the triggers for it. I'd guess this implamentationen needs more work to fully support it