# nvidia/cuda-rust

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/nvidia-cuda-rust).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

4,007 stars · 364 forks · Rust · Apache-2.0

## Links

- GitHub: https://github.com/NVIDIA/cuda-rust
- Homepage: https://nvidia.github.io/cuda-rust/
- awesome-repositories: https://awesome-repositories.com/repository/nvidia-cuda-rust.md

## Topics

`async` `compiler-backend` `cuda` `gpu` `heterogeneous-computing` `high-performance-computing` `nvidia` `programming-languages` `rust`

## Description

cuda-rust is a Rust toolchain for writing NVIDIA CUDA GPU kernels and managing the host-side resources that run them. It lets developers write GPU programs in Rust instead of C++, using either direct thread-level programming or higher-level tile-based programming. Rust ownership and borrowing rules are carried across kernel launches, which is how the project aims to prevent data races and invalid memory use in parallel GPU code.

The two kernel models are handled differently. Thread-level kernels are compiled ahead of time to PTX by a custom compiler backend, which keeps direct control over threads, blocks, warps, cluster operations and shared memory. Tile-based kernels operate on whole tiles of partitioned tensors with array-style operations, and the compiler decides how tiles map onto the GPU. They are compiled just in time at first launch for the detected architecture, so the source stays architecture-agnostic. Both kinds of kernel can run on the same stream over shared device buffers, so an application can use whichever model suits each workload.

On the safety side, a mutable tensor is split into disjoint sub-tensors, each owned exclusively by one tile program. Immutable buffers are shared, and borrows are held until in-flight GPU work finishes. On the host, safe wrappers cover GPU contexts, streams, device buffers and events, with lifetimes tied to Rust scopes. Device operations are composed as lazy values that are scheduled and awaited asynchronously, so host code can overlap other work instead of blocking on each launch.

## Tags

### Programming Languages & Runtimes

- [GPU Kernel Programming](https://awesome-repositories.com/f/programming-languages-runtimes/gpu-kernel-programming.md) — Compiles idiomatic Rust into NVIDIA GPU kernels, covering both thread-level and tile-based programming instead of C++. ([source](https://github.com/nvidia/cuda-rust#readme))
- [Ahead-Of-Time Compilers](https://awesome-repositories.com/f/programming-languages-runtimes/compiler-interpreter-internals/compiler-toolchains/execution-mode-engines/ahead-of-time-kernel-compilation/ahead-of-time-compilers.md) — Ships a custom compiler backend that lowers idiomatic Rust to PTX ahead of time, keeping control over threads, blocks, warps and shared memory.
- [Ownership & Borrowing](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/ownership-borrowing.md) — Extends Rust ownership and borrowing rules across GPU kernel launches, sharing immutable buffers and holding borrows until in-flight work completes.
- [SIMT Thread-Level Programming](https://awesome-repositories.com/f/programming-languages-runtimes/simt-thread-level-programming.md) — Offers direct control over threads, blocks, warps, cluster operations and shared memory through a custom compiler backend. ([source](https://github.com/nvidia/cuda-rust#readme))
- [Asynchronous GPU Host Runtimes](https://awesome-repositories.com/f/programming-languages-runtimes/asynchronous-gpu-host-runtimes.md) — Provides safe host wrappers for GPU contexts, streams, buffers and events, with lazy device operations composed and awaited asynchronously.
- [Ahead-of-Time Kernel Compilation](https://awesome-repositories.com/f/programming-languages-runtimes/compiler-interpreter-internals/compiler-toolchains/execution-mode-engines/ahead-of-time-kernel-compilation.md) — Compiles thread-level Rust kernels to PTX ahead of time through a custom compiler backend, keeping direct control over threads, warps and shared memory.
- [Lazy Asynchronous Task Modeling](https://awesome-repositories.com/f/programming-languages-runtimes/lazy-asynchronous-task-modeling.md) — Composes device operations as lazy values that are scheduled and awaited asynchronously so host code can overlap other work.
- [Mixed-Model Kernel Execution](https://awesome-repositories.com/f/programming-languages-runtimes/mixed-model-kernel-execution.md) — Runs tile-based and thread-level kernels on one stream over shared device buffers so each workload uses the model that suits it.
- [GPU Resource Managers](https://awesome-repositories.com/f/programming-languages-runtimes/raii-patterns/gpu-resource-managers.md) — Manages GPU contexts, streams, device buffers and events through safe Rust wrappers tied to scope lifetimes. ([source](https://nvidia.github.io/cuda-rust/))

### Artificial Intelligence & ML

- [Tile-Based GPU Kernel Programming](https://awesome-repositories.com/f/artificial-intelligence-ml/gpu-kernel-implementations/tile-based-kernel-authoring/tile-based-gpu-kernel-programming.md) — Provides a tile-based kernel model where kernels operate on whole partitioned tensor tiles and the compiler maps tiles onto the GPU.
- [Disjoint Tensor Partitions](https://awesome-repositories.com/f/artificial-intelligence-ml/disjoint-tensor-partitions.md) — Splits a mutable tensor into disjoint sub-tensors, each owned by one tile program, so concurrent GPU writes cannot race.
- [Just-In-Time Kernel Compilers](https://awesome-repositories.com/f/artificial-intelligence-ml/just-in-time-kernel-compilers.md) — Compiles tile kernels at first launch through an intermediate representation into a binary tuned for the detected GPU architecture.

### Operating Systems & Systems Programming

- [GPU Kernel Development](https://awesome-repositories.com/f/operating-systems-systems-programming/gpu-kernel-development.md) — Lets developers write NVIDIA GPU kernels in Rust instead of C++, with either direct thread-level control or higher-level tile-based code.
- [Memory Safety](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/memory-management/memory-safety-and-semantics/memory-safety.md) — Extends Rust ownership rules over kernel launches by splitting mutable buffers into disjoint pieces, sharing immutable ones, and holding borrows until GPU work finishes. ([source](https://github.com/nvidia/cuda-rust#readme))
- [SIMT Execution Models](https://awesome-repositories.com/f/operating-systems-systems-programming/simt-execution-models.md) — Gives direct control over threads, blocks, warps, cluster operations and shared memory through kernels compiled ahead of time to PTX.

### Software Engineering & Architecture

- [Ownership and Borrowing](https://awesome-repositories.com/f/software-engineering-architecture/block-based-data-models/data-block-memory-management/contiguous-memory-buffers/manual-pointer-management/pointer-memory-management/ownership-and-borrowing.md) — Applies Rust ownership and borrowing across CUDA kernel launches, using disjoint tensor partitions and borrows tracked until in-flight work completes.
- [Asynchronous GPU Tasking](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-task-processors/asynchronous-gpu-tasking.md) — Chains lazy GPU operations that are scheduled and awaited asynchronously, letting host code avoid blocking on each kernel launch. ([source](https://nvidia.github.io/cuda-rust/))
