Skip to content

fix(build): add CUDA 13.2 support#368

Draft
CharryWu wants to merge 2 commits intoRust-GPU:mainfrom
CharryWu:fix/cuda-13.2-cumem-location-bindgen
Draft

fix(build): add CUDA 13.2 support#368
CharryWu wants to merge 2 commits intoRust-GPU:mainfrom
CharryWu:fix/cuda-13.2-cumem-location-bindgen

Conversation

@CharryWu
Copy link
Copy Markdown
Contributor

@CharryWu CharryWu commented Mar 26, 2026

Summary

  • In CUDA 13.2, the id field of CUmemLocation_st was placed inside an anonymous union. Bindgen exposes this as __bindgen_anon_1: CUmemLocation_st__bindgen_ty_1 instead of a direct id field on the struct.
  • The existing code (from commit 2623e21, "Fix CUDA 13 API issues") set id directly, which compiled on CUDA 13.0 but fails on 13.2.
  • Adds a cuMemLocation_anon_id cfg in build.rs (gated on driver_version >= 13020) and uses field-level #[cfg] at all 5 CUmemLocation construction sites so both CUDA 13.0 and 13.2 compile correctly.

Test plan

  • cargo build -p cust passes on CUDA 13.2 (Windows, RTX 3060, driver 595.79)
  • Verify cargo build -p cust still passes on CUDA 13.0 (Windows, Linux CI)

Attribution

This bugfix was implemented with the help of Claude Sonnet 4.6 and Cursor IDE

@CharryWu
Copy link
Copy Markdown
Contributor Author

@LegNeato Please hold off on this PR for now — Jimver/cuda-toolkit does not yet support CUDA 13.2.0 (Error: Version not available: 13.2.0), so the Windows CI matrix entry can't run, see CI output on my fork. I'll revisit once the action adds 13.2 support.

@CharryWu CharryWu marked this pull request as draft March 26, 2026 21:00
@CharryWu CharryWu changed the title fix(cust): use bindgen anonymous union for CUmemLocation_st.id on CUDA 13.2 fix(cust): support CUDA 13.2 Mar 26, 2026
@CharryWu CharryWu changed the title fix(cust): support CUDA 13.2 fix(build): add CUDA 13.2 support Mar 26, 2026
@LegNeato
Copy link
Copy Markdown
Contributor

LegNeato commented Mar 27, 2026

We have docker images for cuda 13 in https://github.com/Rust-GPU/rust-cuda/tree/e91b9cefc78258000f92d0978f327c907c515831/container for CI. They currently check 13.0...should we add 13.2? The matrix is starting to get big 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants