CUDA Rust
CUDA Rust is NVIDIA's CUDA platform for Rust, with host-side runtime crates and device-side tools for writing GPU kernels in idiomatic Rust using SIMT and Tile models.
Visit NVIDIA/cuda-rustOverview
CUDA Rust is NVIDIA's CUDA platform for Rust. It provides host-side runtime crates for working with the CUDA driver and device-side crates and tools for writing GPU kernels in idiomatic Rust. The project includes cuda-oxide for the traditional SIMT kernel programming model and cutile-rs for the Tile programming model, plus shared runtime crates for driver bindings, contexts, streams, device buffers, events, and lazy composable device operations.
Key Features
- Host-side runtime crates include cuda-bindings, cuda-core with cuda-core-derive, and cuda-async, covering driver bindings, contexts, streams, device buffers, events, and lazy composable device operations.
- cuda-oxide provides a custom rustc codegen backend, cargo helper utility, and crates for the CUDA SIMT kernel programming model, giving access to device-side CUDA programming details.
- cutile-rs provides a proc-macro plugin and crates for the CUDA Tile programming model, partitioning tensors into sub-tensors, computing on whole tiles, and letting the compiler map tiles to each architecture.
- Both kernel programming models extend Rust ownership rules across the GPU launch boundary: mutable buffers are partitioned into disjoint pieces, immutable buffers are shared, and launchers keep borrows alive while GPU work is in flight.
- Kernels from both models interoperate: a cutile-rs Tile kernel and a cuda-oxide SIMT kernel can run on the same stream over shared device buffers.
Use Cases
- Porting existing CUDA C++ kernels or needing direct control over threads, warps, shared memory, TMA, or cluster operations.
- Tensor computations and math over densely packed numerical data where the Tile model's abstractions fit naturally.
- Sparse problems, pointer chasing, or mapping traditional data structures to the GPU, where SIMT offers more flexibility.
- Applications that combine Tile and SIMT kernels on the same stream over shared device buffers.
Getting Started
- Start with the CUDA Rust documentation; cuda-oxide and cutile-rs each have a book with installation instructions, guides, and reference material.
- Runtime crates cuda-bindings, cuda-core, and cuda-async are documented in the cutile-rs book.
Deployment & Requirements
- cuda-oxide uses a pinned stable Rust toolchain (1.99.1) managed by cargo oxide.
- cutile-rs requires stable Rust 1.89 or newer.
Before You Adopt
- License: Apache-2.0. Review its terms before using, modifying, or distributing the project.
- CUDA Rust is an early-stage research project, so users should expect bugs, incomplete features, and API breakage.