Skip to content

fix(linux): multi-GPU VA-API render-node probing - #1543

Draft
EtienneLescot wants to merge 3 commits into
getopenscreen:mainfrom
EtienneLescot:fix/linux-render-node-probing
Draft

EtienneLescot wants to merge 3 commits into
getopenscreen:mainfrom
EtienneLescot:fix/linux-render-node-probing

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Multi-GPU DRM render-node selection for the Linux helper and the compositor's VA-API export encoder, split out of #1476 so the vaMapBuffer2 shim can land first. The probing is @PyVoyager's work; their commit keeps their name.

  • Export encoder (pipeline_linux.rs): VaapiEncoder::open now opens on the render node of the GPU wgpu renders on, read from VK_EXT_physical_device_drm (Gpu::render_node in d3d_linux.rs). Order: OPENSCREEN_LINUX_RENDER_NODE, then that node. The renderD128..135 scan runs only when the driver does not expose the node (lavapipe, Vulkan 1.0 instance). No new dependency: ash and wgpu-hal are already there.
  • Helper (dmabuf_import.rs, encoder.rs): honors OPENSCREEN_LINUX_RENDER_NODE, then probes /dev/dri/renderD128..renderD135. The importer and the encoder walk one candidate list, in the same order, so they pick the same node.
  • The Vulkan H.264 queue check runs after the device is created again (it read a null device).

Draft: what is missing

  • The helper importer can still open on a GPU other than the desktop compositor's. Its dmabufs come from the Wayland compositor through PipeWire, and nothing the helper receives names the exporting device, so there is no clean source for the right node. Setup on the wrong node succeeds and mapping fails per frame; OPENSCREEN_LINUX_RENDER_NODE stays the workaround.
  • Not compiled locally (no Linux reachable). CI's Linux compositor tests and the Nix build are the compile proof.
  • Needs a run on a hybrid-GPU Linux machine: the export log should show h264_vaapi on the rendering GPU's node. Plus the evidence the crates/compositor/** and electron/native/** locks ask for.

Related issue

Refs #1340
Follows #1476.

🤖 Generated with Claude Code

PyVoyager and others added 2 commits November 13, 2026 03:07
- Probe candidate DRM render nodes (/dev/dri/renderD128..135) with fallback in
  dmabuf_import.rs, encoder.rs, and pipeline_linux.rs for hybrid GPU systems.
- Gate render node candidate discovery in encoder.rs to VA-API only.
- Support OPENSCREEN_LINUX_RENDER_NODE override with automatic fallback.

Split out of getopenscreen#1476.

Refs getopenscreen#1340
The dmabuf importer and the VA-API encoder now try the nodes in the
same order, from one function, so they settle on the same GPU. The
encoder no longer tries the libva default between the override and the
scan; it falls back to it only when no node exists.

Check the Vulkan H.264 queue after the device is created, not before:
the check read a null device.

Refs getopenscreen#1340
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

VaapiEncoder::open imports dmabufs exported by the compositor's wgpu
device, so it must open on that GPU. Read its render node from
VK_EXT_physical_device_drm (Gpu::render_node) and try it right after
OPENSCREEN_LINUX_RENDER_NODE. The renderD128..135 scan now runs only
when the driver does not expose the node.

Refs getopenscreen#1340
@EtienneLescot

Copy link
Copy Markdown
Member Author

Hi @PyVoyager, this PR carries your render-node probing, split out of #1476 (your commit keeps your name). CI compiles it, but nobody on our side has a hybrid-GPU Linux machine.

Could you build this branch (fix/linux-render-node-probing, head 415a3b8e) on your Carrizo + discrete laptop and share:

  1. the helper log of a short screen recording, without OPENSCREEN_LINUX_RENDER_NODE set;
  2. the log of an export of that recording: it should show h264_vaapi opening on the render node of the GPU that renders;
  3. whether the recording and the export play back fine.

Thanks a lot for the original write-up!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants