Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Default NvvmArch::Compute75 silently produces InvalidPtx on pre-Turing GPUs (Pascal/Maxwell/Volta)

オープン
#410 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust

調査の方向性

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)

  1. 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 to nvidia-smi --query-gpu=compute_cap --format=csv for finding it.
  2. Better diagnostics: have cust::Module::from_ptx (or the PTX loader) detect a CUDA_ERROR_INVALID_PTX / CUDA_ERROR_NO_BINARY_FOR_GPU outcome and, when possible, compare the PTX's .target smXX line 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.toml at the commit in question
  • OS: Windows 11
主要言語
Rust
スター
5.4k
フォーク
251
平均マージ
4日 15時間
マージ済み PR(30日)
4

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Rust-GPU/rust-cuda のほかの issue

Rust-GPU/rust-cuda の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。