Skip to content

Support multi-GPU/hybrid systems in auto-detection #319

@ericbsd

Description

@ericbsd

Problem Statement

The xconfig auto command only configures the first detected GPU, which causes issues on hybrid/multi-GPU systems (common in modern laptops with integrated + discrete graphics).

Current Behavior

Detection order in cmd_auto():

  1. Intel GPU → configures Intel DRM
  2. AMD GPU → configures AMD DRM
  3. NVIDIA GPU → configures NVIDIA

Impact: On hybrid laptops (e.g., Intel iGPU + NVIDIA dGPU), only the Intel GPU gets configured. The discrete GPU remains unused.

Expected Behavior

  • Detect all available GPUs
  • Configure the system appropriately for hybrid/multi-GPU setups
  • Provide user control over GPU selection when needed

Technical Details

File: bin/xconfig
Function: cmd_auto() (lines 743-809)

Detection functions:

  • detect_intel_gpu()
  • detect_amd_gpu()
  • detect_nvidia_gpu()

Currently use return 0 on first match, stopping further detection.

Tasks

Investigation Phase

  • Research FreeBSD best practices for hybrid GPU configurations
  • Investigate how other BSD tools handle multi-GPU systems
  • Determine if both GPUs can/should be configured simultaneously
  • Document findings and recommend approach

Implementation Phase

  • Enumerate all GPUs instead of early return
  • Implement chosen approach from investigation
  • Add GPU priority logic or user selection menu
  • Log all detected GPUs for debugging
  • Update documentation with multi-GPU behavior

Testing Phase

  • Test on hybrid laptop (Intel + NVIDIA)
  • Test on hybrid laptop (Intel + AMD)
  • Test on desktop with multiple GPUs
  • Test on single GPU systems (ensure no regression)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions