fix: support RTX 50-series (Blackwell sm_120) CUDA via cu128 wheels (#217) - #218
Merged
Conversation
added 2 commits
June 23, 2026 22:18
The stock torch 2.6 cu12x wheels have no sm_120 kernels, so Blackwell GPUs (e.g. RTX 5060 Ti) pass torch.cuda.is_available() but crash mid- extraction with "no kernel image is available for execution on the device" (#217). Targeted carve-out so existing users are untouched: - detect_nvidia_gpu now also reads the GPU compute capability - wheel_tag routes sm_100/sm_120 (cap major >= 10) to cu128, everything else keeps the existing cu124/cu121/cu118 heuristic - install_cuda_torch installs torch 2.7.1+cu128 for the cu128 tag and stays on 2.6.0 for all other tags - verify_cuda_torch now forces a real kernel launch instead of trusting is_available(), so an incompatible wheel falls back to CPU cleanly instead of crashing during a job Closes #217
Trivy flags msgpack 1.1.2 with a HIGH advisory (out-of-bounds read / crash on Unpacker reuse). It's a transitive dep via the torch/demucs stack; bump to the fixed 1.2.1 to clear the trivy fs scan.
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.
Problem
NVIDIA RTX 50-series cards (Blackwell, compute capability
sm_120) fail GPU stem extraction with:The stock torch 2.6
cu124/cu121wheels were built before Blackwell and contain nosm_120kernels.torch.cuda.is_available()still returnsTrue, so detection "succeeds" and demucs is told to usecuda— then dies the moment a kernel runs. Blackwell support requires thecu128wheels, which only exist for torch 2.7+.Fixes #217.
Approach — targeted Blackwell carve-out
Only
sm_120/sm_100GPUs gettorch 2.7.1+cu128; every existing user stays on the validated2.6.0path, so there is no regression risk for the current base. The 2.7 wheel is fetched at runtime only —pyproject.tomland the build scripts are untouched.The
torch<2.7pin exists because torchaudio 2.7+ changed its codec backend, but stems are written viatorchaudio.save()which StemDeck already routes throughsoundfile/libsndfile, independent of the torch version — so the 2.7 wheel writes WAVs fine.Changes (all in
desktop/src-tauri/src/main.rs)detect_nvidia_gpu()now also runsnvidia-smi --query-gpu=compute_cap(newdetect_compute_cap()helper). Missing/N/Ais non-fatal and falls back to the old logic.wheel_tag()— routes compute-cap major>= 10→cu128; everything else keeps the existingcu124/cu121/cu118table.install_cuda_torch()installstorch==2.7.1+cu128for thecu128tag,2.6.0for all others (unchanged).verify_cuda_torch()now forces a real kernel launch instead of trustingis_available(), so an incompatible wheel falls back to CPU cleanly instead of crashing mid-job. This is a safety net independent of the cu128 fix.wheel_tag_routes_blackwell_to_cu128covers Blackwell/Ada/Ampere/Turing/missing-cap.Verification
cargo checkcompilescargo test wheel_tagpassescargo fmt --checkcleancuda_verified = true, and a full GPU extraction with no error.