Intel + NVIDIA dual-GPU Wayland (wlroots PRIME copy) broken on FreeBSD — DMA-BUF import fails

Hi.
Ok, I know this wouldn't be a news, rather one more confirmation that laptop with hybrid video (intel+nvidia) can't run pure wayland setup with both cards simultaneously. Works only one - either intel or nvidia, depending on that I specify in WLR_DRM_DEVICES.

Laptop on Intel UHD 630 + NVIDIA RTX 2060 with dual monitors: build-in (intel on eDP) and external (nvidia on DP)
OS: FreeBSD 15.0-RELEASE

And it worth mentioning that X11/Gnome works fine with both monitors.

Out of curiosity, I tried to run a wlroots-based compositor (river 0.4-dev), but under Wayland the PRIME copy path fails — NVIDIA refuses to import DMA-BUF buffers allocated by Intel GBM, both via EGL and Vulkan. Logs suggest sync_file support is missing from the FreeBSD NVIDIA port.

GLES2 renderer, default modifiers
WLR_DRM_DEVICES=/dev/dri/card0:/dev/dri/card1 \
river -log-level debug 2>river.log
Allocated 1920x1080 GBM buffer with format XR24, modifier Y_TILED_CCS
no valid memory type index
Failed to import source buffer into multi-GPU renderer

GLES2 renderer, LINEAR modifiers forced
WLR_DRM_NO_MODIFIERS=1 \
WLR_DRM_DEVICES=/dev/dri/card0:/dev/dri/card1 \
river -log-level debug 2>river.log
Allocated 1920x1080 GBM buffer with format XR24, modifier LINEAR
eglCreateImageKHR failed: EGL_BAD_ALLOC
message: "could not bind to DMA buffer"
Failed to import source buffer into multi-GPU renderer

Vulkan renderer + WLR_DRM_NO_MODIFIERS=1 (with default modifiers intel fallback to Y_TILED_CCS and doesn't work)
WLR_DRM_NO_MODIFIERS=1 \
WLR_RENDERER=vulkan \
WLR_DRM_DEVICES=/dev/dri/card0:/dev/dri/card1 \
river -log-level debug 2>river.log
Allocated 1920x1080 GBM buffer with format XR24, modifier LINEAR
Failed to find matching plane and renderer modifiers
Failed to pick primary plane format

Just in case, reversing GPU order (card1:card0, NVIDIA as primary) causes river to panic, so that direction is also not viable.

For reference, the same Intel+NVIDIA PRIME copy combination works on Linux (Debian 13), where dma_fence / sync_file infrastructure is available in the kernel.

The Vulkan capability enumeration shows the root constraint for format 'XR24',
Intel Vulkan reports 'LINEAR: ✓ texture ✓ render',
NVIDIA Vulkan reports 'LINEAR: ✓ texture ✗ render'.
This means there is no modifier that both GPUs can agree on for cross-GPU buffer sharing.

In the bottom line seems the DMA-BUF sync_file import/export not supported

Is there any known workaround, or is this a known missing feature in the FreeBSD NVIDIA port?
Has anyone managed to get cross-GPU Wayland compositing working on FreeBSD with hybrid Intel+NVIDIA hardware?


Additional details
# kldstat | grep nvidia
30 1 0xffffffff82ea8000 14a88 nvidia-drm.ko
31 2 0xffffffff83000000 6068378 nvidia.ko
35 1 0xffffffff89069000 1652f8 nvidia-modeset.ko
# pkg info --all | grep nvidia
nvidia-driver-580.119.02_1 NVidia graphics card binary drivers for hardware OpenGL rendering
nvidia-drm-66-kmod-580.119.02.1500068_2 NVIDIA DRM Kernel Module
nvidia-drm-kmod-580.119.02 NVIDIA DRM Kernel Module
nvidia-kmod-580.119.02.1500068_1 kmod part of NVidia graphics card binary drivers for hardware OpenGL rendering
# uname -a
FreeBSD ... 15.0-RELEASE FreeBSD 15.0-RELEASE releng/15.0-n280995-7aedc8de6446 GENERIC amd64
 
Back
Top