feat(drivers): tell players when their graphics driver is old and how to update it #384
No reviewers
Labels
No labels
area/build
area/install
area/mods
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!384
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/LongshotLauncher:feat/old-graphics-driver-banner"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
An old graphics driver is a common cause of crashes and stutter in Longshot, and players rarely know to update it. The launcher now says so on Home, and a "Learn more" window gives instructions for the player's own system.
What it does
kisak-mesaorgraphics-driversPPA as the second step), Debian stable (backports), Flatpak, image-based systems and a generic fallback on Linux; the NVIDIA app, AMD Software and Intel Driver & Support Assistant, with the vendor's download page, on Windows.LONGSHOT_FAKE_GRAPHICS_DRIVER(Mesa 24.0,NVIDIA 535.183.01, or on WindowsNVIDIA 2025-01-31) to see the banner without an old driver, and on LinuxLONGSHOT_FAKE_OS_RELEASE=<file>to see another distribution's instructions.Tested
cargo fmt, locked Clippy with-D warnings, andtests/test_launcher_core.py(292 tests; the version, age, distribution and step logic has unit tests, the Windows date and vendor logic too).cargo testhas one environment-dependent test (adding_the_same_release_twice_creates_distinct_instances) that refuses to run while aLongshot.x86_64game is open; it passes with no game running.Still to test
HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-…},ProviderNameandDriverDate) has not run on a real Windows PC. Its parsing and age logic is covered by tests that run on Linux; the registry call itself was not compiled or run on Windows.🤖 Generated with Claude Code
Home with the banner, and the "Learn more" window (Linux, Mesa 24.0 faked with
LONGSHOT_FAKE_GRAPHICS_DRIVER, CachyOS):9ba5bfbe00eaa55040bdMore scenarios, same window (Linux, faked drivers):
Ubuntu, Mesa 24.0: the system update first, then the
kisak-mesaPPA with the command to stop using it.Debian 12, Mesa 24.0: backports, with the command to remove it.
Ubuntu, NVIDIA 535: its own commands and the
graphics-driversPPA.Arch (CachyOS), Mesa 24.0: one step, since Arch needs no extra source. The command box is darker, in a monospace font and centered.
@review
Recommendation: Request changes. The Debian instructions can overwrite and later delete an existing package source, and Windows detection can associate an active GPU with an unrelated installed driver. Several other cases prevent the promised warning or recovery instructions from working.
The launcher adds an old-driver banner and system-specific update instructions. The feature could help players find driver updates, but its detection and some Linux commands need correction before they are reliable.
Blocking (2): must change before merging.
src/graphics_driver/linux.rs:273: The suggested backports command overwrites a potentially existing system source file, and its undo deletes that file. (more on the line) Do: Use a uniquely named source without overwriting an existing file, and provide an undo that removes only the source this instruction added.src/graphics_driver/windows.rs:81: The newest registry entry for a vendor is not necessarily the driver used by the Vulkan adapter. (more on the line) Do: Associate each Vulkan device with its corresponding present Windows display adapter and read that adapter's driver date, rather than selecting across all entries from the vendor.Should fix (4): not blocking, but worth doing before merging.
src/graphics_driver/linux.rs:263: The Debian stable codename trixie is treated as testing and excluded from the backports instructions. (more on the line) Do: Identify stable and testing from the actual distribution release information, or maintain the codename mapping so current stable receives its backports instructions.src/graphics_driver/linux.rs:273: The NVIDIA backports source includes only main, although Debian's proprietary NVIDIA driver is in non-free. (more on the line) Do: Provide the required Debian repository components for NVIDIA, or direct players to configure the appropriate backports source through Debian's documented procedure.src/graphics_driver/linux.rs:96: NVIDIA dismissals are keyed to a branch rather than a driver release. (more on the line) Do: Include the full reported NVIDIA driver version in the dismissal key and test an upgrade within one branch.src/graphics_driver/linux.rs:299: Only one dismissal is stored even though detection can find multiple old drivers. (more on the line) Do: Persist a set of dismissed driver release keys and show the next undismissed report after a dismissal.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
src/graphics_driver/windows.rs:136: The Windows registry and window path need a real Windows run. (more on the line) Do: Exercise detection, dismissal and the instructions on Windows with an actual old driver and a current driver.src/graphics_driver.rs:74: Real Linux Vulkan driver reporting and the distribution-specific update paths need verification. (more on the line) Do: Exercise actual old and current Mesa and NVIDIA drivers, and verify the affected distribution-specific instructions on representative systems.@fixcan do L1, L2, L3, L4, L5 and L6.Questions (1) (not confirmed from the code; they don't hold the recommendation)
Checks: Still running: 5 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven. The reported Linux UI runs used fake drivers; real driver detection and the Windows registry path have not been exercised on the target systems.
Other systems: The change enumerates every Vulkan physical device, including GPUs the game may not select. Windows registry entries are matched by vendor rather than device. Linux distribution derivatives, Debian package sources, Flatpak, image-based systems and SteamOS affect the instructions or whether a warning appears. The reported runs cover fake drivers on a subset of Linux distributions; real systems and Windows remain untested.
Switches: LONGSHOT_FAKE_GRAPHICS_DRIVER and LONGSHOT_FAKE_OS_RELEASE are debug-build-only overrides, unset by default. Their defaults are appropriate for developer testing.
Reviewed:
eaa55040bdagainst57abf726cc: Read AGENTS.md and CONTRIBUTING.md, the commit, changed Rust and Slint code, and relevant settings and Vulkan requirement code. Skimmed the translation diffs and the reported runs. No review checklist or pull request template was found at the specified paths.; nothing run (a code review).Checked and fine:
Testing: No commands from the project, builds or tests were run, as requested. The author reports formatting, Clippy, core tests and Linux screenshots; CI was still running.
Overlaps and merge order: Not checked; the network is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -0,0 +71,4 @@return Vec::new();};let mut found = Vec::new();for device in instance.enumerate_physical_devices().unwrap_or_default() {L8 (should fix): Real Linux Vulkan driver reporting and the distribution-specific update paths need verification.
When: The supplied Linux screenshots use fake driver strings, so they do not establish that actual Mesa and proprietary NVIDIA reports reach the expected banner and instructions.
Do: Exercise actual old and current Mesa and NVIDIA drivers, and verify the affected distribution-specific instructions on representative systems.
@ -0,0 +93,4 @@fn key(&self) -> String {match self {Self::Mesa(v) => format!("mesa {}", v.label()),Self::Nvidia { branch, .. } => format!("nvidia {branch}"),L5 (should fix): NVIDIA dismissals are keyed to a branch rather than a driver release.
When: A player dismisses NVIDIA 535.183.01 and later installs another still-old 535 release. Both have the key 'nvidia 535', so the promised renewed warning does not appear.
Do: Include the full reported NVIDIA driver version in the dismissal key and test an upgrade within one branch.
@ -0,0 +260,4 @@let mut steps = vec![update(usual, "sudo apt update\nsudo apt full-upgrade")];// Testing and unstable have no backports: they are as new as Debian gets.if !os.codename.is_empty()&& !matches!(os.codename.as_str(), "sid" | "trixie" | "forky")L3 (should fix): The Debian stable codename trixie is treated as testing and excluded from the backports instructions.
When: On Debian 13 stable with an old Mesa driver, the dialog offers only the normal system upgrade even when the player needs trixie-backports.
Do: Identify stable and testing from the actual distribution release information, or maintain the codename mapping so current stable receives its backports instructions.
@ -0,0 +270,4 @@};steps.push(newer(format!("echo \"deb http://deb.debian.org/debian {code}-backports main\" | sudo tee /etc/apt/sources.list.d/backports.list\nsudo apt update\nsudo apt install -t {code}-backports {packages}"L1 (blocking): The suggested backports command overwrites a potentially existing system source file, and its undo deletes that file.
When: A Debian player already has /etc/apt/sources.list.d/backports.list with their own repository components or entries. Copying the suggested command replaces them; copying the undo removes the file altogether.
Do: Use a uniquely named source without overwriting an existing file, and provide an undo that removes only the source this instruction added.
L4 (should fix): The NVIDIA backports source includes only main, although Debian's proprietary NVIDIA driver is in non-free.
When: On Debian stable without backports already configured, a player following the NVIDIA second step adds a main-only backports source and then asks apt to install nvidia-driver from it; that source cannot supply the package.
Do: Provide the required Debian repository components for NVIDIA, or direct players to configure the appropriate backports source through Debian's documented procedure.
@ -0,0 +296,4 @@}found.into_iter().find(|d| d.is_old_on(today) && dismissed != Some(d.key().as_str()))L6 (should fix): Only one dismissal is stored even though detection can find multiple old drivers.
When: A machine with old Mesa and NVIDIA drivers shows Mesa first. After dismissing it and restarting, it shows NVIDIA; dismissing that replaces the Mesa key, so Mesa returns on the next start and the warnings alternate.
Do: Persist a set of dismissed driver release keys and show the next undismissed report after a dismissal.
@ -0,0 +78,4 @@}}vendors.into_iter().find_map(|vendor| {let newest = adaptersL2 (blocking): The newest registry entry for a vendor is not necessarily the driver used by the Vulkan adapter.
When: After replacing an NVIDIA card, a newer NVIDIA class entry can remain installed while the active card uses an older driver. The newer entry wins the vendor-wide maximum, so the old active driver produces no warning.
Do: Associate each Vulkan device with its corresponding present Windows display adapter and read that adapter's driver date, rather than selecting across all entries from the vendor.
@ -0,0 +133,4 @@/// The display adapters Windows has drivers for, one per installed driver.#[cfg(windows)]fn adapters() -> Vec<Adapter> {L7 (should fix): The Windows registry and window path need a real Windows run.
When: The supplied runs use Linux fake drivers, and the PR says the registry call and Windows window have not run on Windows.
Do: Exercise detection, dismissal and the instructions on Windows with an actual old driver and a current driver.
eaa55040bd46661c69c9Fixed from the review (L1 to L6):
longshot-backports.listand its undo removes only that file; for NVIDIA the source hasmain contrib non-free non-free-firmware.MatchingDeviceId), so a newer driver left by a replaced card no longer hides an old one.dismissedGraphicsDrivers), the old single setting is still read, and the next undismissed driver is shown.Not done: L7 and L8 need a real Windows PC and real old drivers. The hybrid-GPU question stays open: the check looks at every GPU Vulkan lists, not the one the game picks.
llun referenced this pull request2026-12-01 05:00:37 +00:00