Skip to content

feat: add driver conflict group resolution for multi-GPU systems#255

Merged
vnepogodin merged 2 commits into
masterfrom
feat/multi-gpu-resolution
Jun 23, 2026
Merged

feat: add driver conflict group resolution for multi-GPU systems#255
vnepogodin merged 2 commits into
masterfrom
feat/multi-gpu-resolution

Conversation

@vnepogodin

Copy link
Copy Markdown
Member

When a system has multiple NVIDIA GPUs requiring incompatible driver branches (e.g. GTX 1080 needing nvidia-580xx + RTX 5080 needing nvidia-open), chwd previously tried to install both, causing package conflicts since only one nvidia kernel module can be loaded at a time.

Introduce a generic driver_conflict_group profile field. Profiles sharing the same group are mutually exclusive - only one may be installed system-wide. For NVIDIA, all proprietary driver profiles (nvidia-open-dkms, nvidia-dkms-580xx, nvidia-dkms-470xx) share the "nvidia" conflict group.

Resolution logic:

  • Single device in group: use its best profile
  • Multiple devices, common driver exists: use the highest-priority profile that matches ALL devices (e.g. RTX 2060 + RTX 5080 both get nvidia-open-dkms)
  • Multiple devices, no common driver: install for the primary (highest-priority) device, skip others with a warning

Closes: #158
See-also: #179 (temporary shell-script workaround, kept as safety net)

When a system has multiple NVIDIA GPUs requiring incompatible driver
branches (e.g. GTX 1080 needing nvidia-580xx + RTX 5080 needing
nvidia-open), chwd previously tried to install both, causing package
conflicts since only one nvidia kernel module can be loaded at a time.

Introduce a generic `driver_conflict_group` profile field. Profiles
sharing the same group are mutually exclusive - only one may be
installed system-wide. For NVIDIA, all proprietary driver profiles
(nvidia-open-dkms, nvidia-dkms-580xx, nvidia-dkms-470xx) share the
"nvidia" conflict group.

Resolution logic:
- Single device in group: use its best profile
- Multiple devices, common driver exists: use the highest-priority
  profile that matches ALL devices (e.g. RTX 2060 + RTX 5080 both
  get nvidia-open-dkms)
- Multiple devices, no common driver: install for the primary
  (highest-priority) device, skip others with a warning

Closes: #158
See-also: #179 (temporary shell-script workaround, kept as safety net)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a generic driver_conflict_group field to profiles so that, on multi-GPU systems, chwd can choose a single mutually-compatible driver across devices rather than attempting to install conflicting packages. The NVIDIA proprietary/open driver profiles are placed in the new "nvidia" conflict group, and a resolver picks a common profile when possible or falls back to the highest-priority device when no shared profile exists.

Changes:

  • New driver_conflict_group field on Profile, parsed from TOML and persisted to the installed-profile DB.
  • New resolve_conflict_groups resolver in src/data.rs (with unit tests) plus integration into prepare_autoconfigure to honor resolved/skipped devices.
  • All NVIDIA proprietary/open profiles (nvidia-open-dkms, nvidia-dkms-580xx, nvidia-dkms-470xx) tagged with driver_conflict_group = "nvidia".

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/profile.rs Adds driver_conflict_group field, parser, and TOML writer support.
src/data.rs Introduces ConflictResolution, resolve_conflict_groups and supporting helpers with unit tests; minor formatting cleanups.
src/main.rs Uses conflict resolution in prepare_autoconfigure to swap per-device best profile for a compatible one and skip incompatible devices.
src/misc.rs Shortens an outdated comment about USB directories.
profiles/pci/graphic_drivers/profiles.toml Tags NVIDIA proprietary/open driver profiles with the "nvidia" conflict group.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main.rs Outdated

// Check if this device was skipped due to conflict group incompatibility
if skipped_busids.contains(device.sysfs_busid.as_str()) {
log::warn!("Skipping device {}. incompatible driver conflict group", device_info);
Comment thread src/data.rs
Comment on lines +533 to +535
let all_match = indices[1..]
.iter()
.all(|&idx| devices[idx].available_profiles.iter().any(|p| p.name == candidate.name));
Comment thread src/data.rs
@vnepogodin vnepogodin merged commit 2d8b64f into master Jun 23, 2026
1 of 2 checks passed
@vnepogodin vnepogodin deleted the feat/multi-gpu-resolution branch June 23, 2026 12:10
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.

Validate set of GPU profiles before trying to install them

3 participants