fix(linux/vulkan): auto-detect GPU with connected display#4961
fix(linux/vulkan): auto-detect GPU with connected display#4961neatnoise wants to merge 1 commit intoLizardByte:masterfrom
Conversation
82c9239 to
a0b3617
Compare
…renderD128 On multi-GPU systems the Vulkan encoder defaulted to /dev/dri/renderD128 which may not be the GPU driving the display. This caused encode failures or unnecessary cross-GPU copies. Add platf::find_render_node_with_display() which scans DRM connectors to find the GPU with a connected monitor and returns its render node path. Use this as the default when adapter_name is not configured. Fallback chain: user config > auto-detected GPU > renderD128 > FFmpeg default.
a0b3617 to
1e54ff0
Compare
|
Bundle ReportBundle size has no change ✅ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4961 +/- ##
==========================================
- Coverage 17.99% 17.96% -0.04%
==========================================
Files 108 108
Lines 23317 23354 +37
Branches 10263 10288 +25
==========================================
- Hits 4197 4195 -2
+ Misses 16033 15025 -1008
- Partials 3087 4134 +1047
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 40 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|



Description
On multi-GPU Linux systems, the Vulkan encoder hardcoded
/dev/dri/renderD128as the default render device whenadapter_namewas not configured. This caused the encoder to use the wrong GPU (e.g. Intel iGPU instead of the Nvidia dGPU driving the display), leading to encode failures or unnecessary cross-GPU copies.This PR adds
platf::find_render_node_with_display()which scans DRM card devices for a connector inDRM_MODE_CONNECTEDstate and returns the corresponding render node viadrmGetRenderDeviceNameFromFd(). This is used as the default GPU selection whenadapter_nameis empty.Fallback chain (unchanged for users with explicit config):
adapter_nameconfig → used as-is/dev/dri/renderD128if detection failsAll Vulkan capture paths benefit (KMS, portal, wlgrab) since they all funnel through the same
create_vulkan_hwdevice()or thevideo.cppfallback.This creates a common method to auto choose GPU. It can be used with other encoders like VAAPI (which is also static) as well in the future.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage