Repository navigation
fix(desktop): re-detect GPU after CPU→NVIDIA build swap (#316) - #317
Merged
Merged
Conversation
A persisted "cpu-only-package" torch device reason was treated as a permanently settled decision by the setup gate, so replacing the CPU portable build with the NVIDIA build in the same data dir left the user pinned to CPU -- setup skipped ensure_torch_device (and its #247 clear_stale_cpu_marker + GPU re-probe) entirely. Invalidate the stale reason at probe time when the current install is no longer the cpu-only package, so the device reads as unsettled and setup re-runs GPU detection. Reuses the existing #247 self-heal path.
thcp
added a commit
that referenced
this pull request
Jul 18, 2026
…318) (#320) #318 force-installed the CUDA torch wheel into the NVIDIA package, which pushed the release zip to 2456 MB -- over GitHub's 2 GiB release-asset cap (2147483648 bytes) -- so the Windows NVIDIA asset upload failed on the v0.8.0-alpha.12 release. Bundling was the wrong approach: the desktop app already installs the CUDA build on first run via ensure_torch_device (which picks the cuXXX index matching the detected GPU's compute capability / driver). The NVIDIA package is meant to ship base torch small (~419 MB zip) and pull CUDA on first launch. #317 is the actual fix -- it makes that first-run install trigger again after a CPU->NVIDIA build swap. Restore the non-CpuOnly path to base torch and document why not to bundle, so this isn't reintroduced. Co-authored-by: Thales <>
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.
Fixes #316.
Problem
A Windows user with an NVIDIA GPU who switches from the CPU portable build to the NVIDIA build — reusing the same
%LOCALAPPDATA%\StemDeckdata dir — stays pinned to CPU. The only recovery was manually deleting the data dir and relaunching.Cause
The setup gate treats a persisted
cpu-only-packagedevice reason as permanently settled, so setup early-returns and skipsensure_torch_device— the very function whoseclear_stale_cpu_marker+ GPU re-probe (#247) heals this case. Thecpu-only-packagereason is only valid while the current install is still the CPU-only build; after an in-place swap to the NVIDIA build it is stale but never re-checked.Fix
probe_runtimenow runs the persisted reason through a new pure helpereffective_device_reason(persisted, cpu_only_package): acpu-only-packagereason is dropped toNonewhen the current install is not the cpu-only package. That marks the device unsettled, so the gate falls through and setup re-runsensure_torch_device, which clears the stale marker, detects the GPU, and persistscuda/verified. Single heal — subsequent launches match. All other reasons pass through unchanged (reuses the existing #247 "unknown/unsettled reason self-heals" path).Scope
mpsreasons are already non-terminal; Docker has no persisted-device machinery and upgrades are clean image replacements).Tests
Three unit tests for
effective_device_reason(stale reason dropped on non-cpu-only package; kept on genuine cpu-only package; all other reasons +Nonepass through). Validated via WSLcargo test(3 passed) andcargo clippy --all-targets(no new warnings).Follow-up (separate PR)
Make the Windows NVIDIA build install cu124 torch explicitly in
make-portable.ps1so GPU support is reproducible rather than an implicit property of the CI runner's PyPI resolution.