NVIDIA Drops cuda-oxide so Rust Developers Can Write GPU Kernels Natively
NVIDIA's research arm open-sourced cuda-oxide, a rustc backend that compiles pure Rust kernels directly to PTX with no DSL layer.
Takeaways
- NVlabs open-sourced cuda-oxide, a rustc backend compiling pure Rust kernels directly to CUDA PTX
- Single-source model: host and device code in one file, built with
cargo oxide build - Pipeline: Rust to MIR to Pliron IR to LLVM IR to PTX, using MLIR-like framework Pliron
- Ships 60+ examples including Blackwell GEMM, tcgen05 tensor cores, TMA, and async MLP pipeline
- Supports closures with captures, generics, cross-crate kernels, and Rust to C++/CCCL FFI via LTOIR
- Alpha stage under Apache 2.0, requires nightly Rust, CUDA 12+, LLVM 21+, Linux
NVIDIA Research just dropped something the Rust GPU community has been quietly waiting years for: a proper rustc backend that emits CUDA PTX. cuda-oxide lets you write SIMT kernels in idiomatic Rust, put host and device code in the same file, and build the whole thing with a single cargo oxide build. It is an experimental, alpha-stage project under Apache 2.0, but the surface area on day one is unusually broad.
One source file, no DSL, no FFI dance
cuda-oxide is a custom rustc backend for compiling GPU kernels in pure Rust. Unlike most Rust-on-GPU efforts, it avoids macro DSLs, source-to-source translation, and cuBLAS wrappers. You annotate a function with #[kernel], wrap the module in #[cuda_module], and rustc itself lowers your MIR into PTX.
The compilation pipeline goes Rust to Rust MIR to Pliron IR to LLVM IR to PTX. Pliron is an MLIR-like IR framework written in Rust, which keeps the project inside the Rust ecosystem rather than shelling out to nvcc. The #[cuda_module] macro then embeds the generated device artifact directly into your host binary and produces typed launch methods, so kernel arguments get checked at compile time on the host side.
What actually works today
For an alpha, the feature list is surprisingly deep. Highlights from the repo:
- End-to-end Rust to PTX compilation with unified single-source host plus device in one file