Skip to main content

Ecosystem

The GPU ecosystem in Rust is nascent and complex. It can be challenging to understand why projects exist and how they compare to others in the space. This section is a decoder ring for key projects that relate to both Rust and GPUs in some way.

rust-gpu

Compiles unmodified Rust code to SPIR-V (Vulkan) so that it can run on the GPU.

rust-cuda

Compiles unmodified Rust code to NVVM (CUDA) so that it can run on the GPU. Currently unmaintained but stay tuned!

nvptx backend in rustc

Compiles unmodified Rust code to PTX (CUDA) so that it can run on the GPU.

CubeCL

Compute language extension for Rust. Enables annotated Rust code to run on the GPU.

krnl

Safe, portable, high performance compute (GPGPU) kernels. Enables annotated Rust code to run on the GPU (via Rust GPU).

cudarc

Minimal and safe api over the CUDA toolkit. Enables calling CUDA from Rust running on the CPU.

wgpu

A safe and portable graphics library for Rust based on the WebGPU API. Enables communicating with the GPU from Rust running on the CPU.

naga

A source code translator written in Rust that converts between various GPU-specific shader languages (WGSL, GLSL, HLSL, and MSL). These shaders ultimately run on the GPU.

ZLUDA

A drop-in replacement for CUDA written in Rust. Enables using tools and libraries targeted at CUDA on non-NVIDIA hardware.

Asahi Linux GPU drivers

GPU drivers partially written in Rust to add Linux support for Apple GPUs.