Backends/DRM: add --prefer-drm (independent scanout device) for hybrid/eGPU#11
Open
relil wants to merge 1 commit into
Open
Backends/DRM: add --prefer-drm (independent scanout device) for hybrid/eGPU#11relil wants to merge 1 commit into
relil wants to merge 1 commit into
Conversation
Decouple the DRM/KMS scanout device from the Vulkan render device. init_drm() derives the KMS node from the chosen Vulkan physical device (vulkan_primary_dev_id -> DRM_NODE_PRIMARY), so on hybrid/eGPU/muxless setups selecting a headless render GPU via --prefer-vk-device also forces scanout onto that GPU, which has no connectors -> black screen. --prefer-drm picks the KMS device explicitly while --prefer-vk-device keeps choosing the render GPU and -O selects the connector within it. Accepts /dev/dri/cardX, the short cardX form, and /dev/dri/by-path/...-card symlinks. Also read from $GAMESCOPE_PREFER_DRM when the flag is absent, so a session can configure a split setup without per-game options. The node is validated by device number (primary minors 0-63) up-front in main(), not by open() (which the compositor cannot do for a primary node under seatd/logind); drmIsKMS() still runs later. Default behavior is unchanged when neither is set. Also submitted upstream: ValveSoftware#2220.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carries the
--prefer-drmoption in the Bazzite gamescope fork so hybrid / eGPU / headless-render setups work in Game Mode.Problem:
init_drm()derives the KMS/scanout device from the selected Vulkan device (vulkan_primary_dev_id()→DRM_NODE_PRIMARY). So--prefer-vk-device(e.g. a headless render GPU) also forces scanout onto that GPU →'/dev/dri/cardX' is not a KMS device→ black screen, with no way to render on GPU A and scan out on display GPU B.Change: adds
--prefer-drm <device>to choose the DRM/KMS scanout device independently of--prefer-vk-device, plus aGAMESCOPE_PREFER_DRMenv fallback so the session can set it without per-game launch options. Accepts/dev/dri/cardX,cardX, and/dev/dri/by-path/…-card. Validated by device number up-front inmain()(notopen(), which the compositor can't do for a primary node under seatd/logind);drmIsKMS()still runs. No behaviour change without the flag/env.This pairs with Bazzite's
export-gpu(VULKAN_ADAPTER= render GPU): setGAMESCOPE_PREFER_DRMto the display GPU's by-path and the UI/games render on the fast GPU while output goes through the iGPU.Tested on Bazzite + CachyOS Game Mode (Intel iGPU + AMD BC-160): compositor on BC-160, scanout via Intel HDMI; Steam Big Picture and Cyberpunk 2077 work, no atomic/dmabuf errors.
Also submitted upstream: ValveSoftware#2220 (this carries it for Bazzite until it lands upstream). Upstream request: ValveSoftware#1004.