Default NvvmArch::Compute75 silently produces InvalidPtx on pre-Turing GPUs (Pascal/Maxwell/Volta)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- rust
- 領域
- backend, documentation
調査の方向性
crates/nvvm/src/lib.rs と入門ガイドから始め、文書化されている Compute75 のデフォルト値と、例がアーキテクチャをどのように設定しているかを確認します。次に cust::Module::from_ptx と PTX ローダーのエントリーポイントを調べ、診断オプションを評価します。ガイドまたは診断の合意された改善によって Turing 世代より前の GPU に対応し、その結果生じる動作についてのカバレッジまたはドキュメントが含まれていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Rust
- スター
- 5.4k
- フォーク
- 251
- 平均マージ
- 4日 15時間
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Rust-GPU/rust-cuda のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
Array parameters lose alignment metadata and ICE on >16 byte alignments対応中かも @Snehal-Reddy が 163 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Rust-GPU/rust-cuda の issue をすべて見る
似ている issue
-
Progress difficulty filter lists Hard before Medium対応中かも @Pandamachi が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
sysprog21/codetrial#281 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
C-bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rust-lang/rust-analyzer#23501 ·
メンテナーはふだん 1 日以内に返信
-
Streamable HTTP client: a 401 or 403 with a JSON-RPC error body and no WWW-Authenticate loses its HTTP status対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug P2 ready for work T-security T-transport
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modelcontextprotocol/rust-sdk#1339 ·
メンテナーはふだん 3 日以内に返信
-
scripts/gen-gallery.py:118: a ready session now reports in_progress, so SESSION_READY_OLD can goオープンnightly-audit
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
antithesishq/snouty#396 ·
メンテナーはふだん 1 日以内に返信
-
French BIP39 wordlist starts with a UTF-8 BOM, so generated French mnemonics carry U+FEFF and derive a non-canonical seed対応中かも @Kshot3000 が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
ergoplatform/sigma-rust#976 ·
メンテナーはふだん 1 日以内に返信