DRI3Open missing in the X11 driver for wlroots compositors

I’d like to run a wlroots-based Wayland compositor like waybox or sway inside my main X server. I’m getting this error message:

$ ~/src/waybox/build/waybox/waybox
00:00:00.000 [backend/x11/backend.c:609] Failed to query DRI3 DRM FD
00:00:00.000 […/waybox/main.c:90] Failed to create backend

The error happens because wlroots is calling DRI3Open, but the dri3_screen_info_rec struct provided to Xorg by the nvidia driver is missing “open” and “open_client” pointers:

https://github.com/freedesktop/xorg-xserver/blob/master/dri3/dri3_screen.c#L40

(gdb) p *info
$1 = {version = 2, open = 0x0, pixmap_from_fd = 0x0, fd_from_pixmap = 0x0, open_client = 0x0, pixmap_from_fds = 0x7f87480ab940, fds_from_pixmap = 0x0, get_formats = 0x7f87480ab8b0,
get_modifiers = 0x7f87480ab7d0, get_drawable_modifiers = 0x0}

Is this supposed to work? Am I missing some configuration? I have kernel modesetting and see DRI3 in xdpyinfo and Xorg log.

nvidia-bug-report.log.gz (1.0 MB)

1 Like

Unfortunately, I don’t think they’ve implemented it. I came across the same issue when investigation how to get Chrome to support my VA-API implementation under X. Chrome uses the DRM device to initialise VA-API, rather than using the X window.

It shouldn’t be difficult for them to support, since I believe it only returns an fd to the tender DRM device.

Is it still a thing in 2024 and 550 driver? It seems so. Chromium recently got patches for offscreen rendering. It could be possible to use it on Linux, but with Nvidia card/driver it fails on DRI3 open, here: https://source.chromium.org/chromium/chromium/src/+/main:ui/gfx/linux/gpu_memory_buffer_support_x11.cc;l=56;drc=f4a00cc248dd2dc8ec8759fb51620d47b5114090;bpv=0;bpt=1

Is there really no viable workaround for this issue on Nvidia GPU on Linux? This breaks sooo many use-cases for rendering graphics in the cloud with nvidia instances :(

BTW is there a chance for DRI3 to work via Wayland, or is the support there even worse than on X11?