Announcing The Rust CUDA Project; An ecosystem of crates and tools for writing and executing extremely fast GPU code fully in Rust
https://github.com/RDambrosio016/Rust-CUDA
Hello everyone!
After over half a year of work, i am finally releasing a very early version of the project i have been working on with the goal of making Rust a Tier-1 language for fast GPU computing.
It is still early so expect bugs, things that don't work, and maybe needing to install llvm sometimes.
With this release comes a few crates:
rustc_codegen_nvvmfor compiling rust to CUDA PTX code using rustc's custom codegen mechanisms and the libnvvm CUDA library.custfor actually executing the PTX, it is a high level wrapper for the CUDA Driver API.cuda_builderfor easily building GPU crates.cuda_stdthe GPU-side standard library which complementsrustc_codegen_nvvm.gpu_randGPU-friendly random number generation (because curand doesn't work with the driver API).nvvmHigh level bindings tolibnvvmptx_compilerHigh level bindings to the PTX compiler APIs, currently incomplete (does not include compiler options).find_cuda_helperfor finding CUDA on the system.
As well as some more WIP projects (not published to crates.io):
optixfor CPU-side OptiX, currently not published because it is actively being rewritten.optix_gpu(on a different branch) for using rustc_codegen_nvvm for OptiX. Needs a lot of work on the codegen side.ptxPTX lexing, parsing, and analysis. Eventually will be used for safety-checking launches.
The path tracer i previously posted as a teaser for this project has also been published in examples/cuda.
Leading this project are:
- Riccardo D'Ambrosio (me): First year college student with interests in GPU computing and optimization, started this as a random project half a year ago.
- Anders Langlands: VFX Supervisor at Weta FX, Author of the original
optix-rsOptiX bindings. Currently works on wrapping OptiX and using the project for OptiX ray tracing.
I would also like to extend a big thanks to everyone on Zulip who helped in debugging and answering weird questions about rustc internals, especially bjorn3 and nagisa.