Default NvvmArch::Compute75 silently produces InvalidPtx on pre-Turing GPUs (Pascal/Maxwell/Volta)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- backend, documentation
Direzione di ricerca
Inizia da crates/nvvm/src/lib.rs e dalla guida introduttiva per confermare il valore predefinito Compute75 documentato e il modo in cui l’esempio configura la propria architettura. Poi esamina cust::Module::from_ptx e i punti di ingresso del loader PTX per valutare l’opzione diagnostica. Il lavoro è completo quando un miglioramento concordato della guida o della diagnostica affronta le GPU pre-Turing e include una copertura o una documentazione per il comportamento risultante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened
Following the getting-started guide on a GTX 1070 (Pascal, sm_61) with CUDA 12.9, cargo run builds successfully but fails at runtime with:
Error: InvalidPtx
No indication of why the PTX is invalid.
Root cause
cuda_builder::CudaBuilder defaults to NvvmArch::Compute75 (crates/nvvm/src/lib.rs):
/// This default value of 7.5 corresponds to Turing and later devices. We default to this
/// because it is the minimum supported by CUDA 13.0 while being in the middle of the range
/// supported by CUDA 12.x.
#[default]
Compute75,
This is a deliberate, documented choice — but it means the getting-started example silently generates PTX targeting sm_75, which the CUDA driver refuses to load on any GPU below Turing (Pascal, Maxwell, Volta — all still fully supported for building/running on CUDA 12.x, just not compiling for them by default). The failure surfaces as a generic cust::error::CudaError::InvalidPtx with nothing pointing at the arch mismatch, which is a confusing first-run experience for anyone following the guide on older hardware.
Suggestions (either would help; happy to send a PR for whichever is preferred)
- Guide fix: add a line to the getting-started example / Windows setup section noting that
.arch(NvvmArch::ComputeXX)should be set explicitly to match the target GPU's actual compute capability, with a pointer to Compute Capability Gating and tonvidia-smi --query-gpu=compute_cap --format=csvfor finding it. - Better diagnostics: have
cust::Module::from_ptx(or the PTX loader) detect aCUDA_ERROR_INVALID_PTX/CUDA_ERROR_NO_BINARY_FOR_GPUoutcome and, when possible, compare the PTX's.target smXXline against the current device's actual compute capability, surfacing a clearer error like "PTX built for sm_75 but device is sm_61 — rebuild with.arch(NvvmArch::Compute61)".
Either fix would have saved a fair amount of debugging time here since the error gives no hint that architecture — not toolchain or driver version — is the issue.
Environment
- GPU: GTX 1070 (Pascal,
sm_61) - Driver: 582.28
- CUDA Toolkit: 12.9.2
- Rust nightly: pinned per
rust-toolchain.tomlat the commit in question - OS: Windows 11
- Lingua principale
- Rust
- Stelle
- 5.4k
- Fork
- 249
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Rust-GPU/rust-cuda
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Tutte le issue di Rust-GPU/rust-cuda
Issue simili
-
bug github_actions
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
registrystack/registry-stack#1393 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
longbridge/gpui-kit#3223 ·
-
bug engine
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rocky-data/rocky#2181 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
oasisprotocol/oasis-sdk#2523 ·
-
[indexer] [QA] Add a focused test for the new NonRetryableError / assertSocketAlive() behavior. Apertabot:ai-assisted component:indexer QA-roadmap status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
midnightntwrk/midnight-indexer#1557 ·