Rust GPU Transitions to Community Ownership
Posted on 2024-08-12

We are excited to announce that as of today the Rust GPU project will be transitioning from Embark Studios to community ownership under the Rust GPU GitHub organization. This move marks the beginning of a broader strategy aimed at revitalizing, unifying, and standardizing GPU programming in Rust. We are eager to share more details in the near future but in the meantime if you are a maintainer of a GPU-related Rust project, please reach out!

What is Rust GPU?๐Ÿ”—

Rust GPU makes it possible to write and run GPU software in Rust, leveraging the language's powerful safety and concurrency features to enhance performance and reliability. With Rust GPU, you can seamlessly develop for both CPU and GPU using a unified codebase, all while benefiting from Rustโ€™s existing ecosystem.

The Rust GPU compiler backend emits code compatible with Vulkan, ensuring your code runs across a wide range of devices and vendors.

If instead you wish to stick to the NVIDIA ecosystem, stay tuned as the Rust CUDA project is in the process of being rebooted and possibly integrated with Rust GPU.

To put Rust GPU in context, here's an overview of the current landscape:

Why Rust for GPU Programming?๐Ÿ”—

  1. Modern and Unified Experience: There is no longer a need to learn a GPU-specific programming language. You can write both CPU and GPU code in Rust, leveraging your existing Rust knowledge and maintaining a consistent development experience. Furthermore, the same code can run on both the CPU and GPU, with divergent behavior gated behind cfg attributes and macros where necessary.

    Even if your current codebase isn't written in Rust, choosing Rust for the GPU parts instead of GPU-specific languages gives you more widely applicable skills in one of the fastest-growing languages on GitHub. Rust is also one of the most admired programming languages while GPU-specific languages are considered a necessary evil.

  2. Fearless Concurrency: Rust's ownership model and type system guarantee memory safety, minimizing bugs and undefined behavior. Rust's borrow checker also enables fearless concurrency, which is essential for maximizing performance on massively parallel GPUs.

  3. Powerful Abstractions: Programming in GPU-specific languages can often feel like taking a step back to the 90s, where primitive tools and sharp edges abound. Because of this, code written for GPUs is simplistic with low cyclomatic complexity. Rust has an expressive type system and zero-cost abstractions that enable writing high-level, reusable code without sacrificing performance. This approach leads to more maintainable and sophisticated GPU programs, streamlining the development process and enhancing productivity.

  4. Leverage Existing Ecosystem: The state-of-the-art for sharing GPU code is copy and pasting. With Rust GPU we are excited to bring the excellent cargo and crates.io ecosystem to GPU programming and provide some sanity.

    Additionally, Rust's no_std ecosystem offers a wide array of libraries that can be used in environments without the standard library. Traditionally this has meant embedded devices, but a lot of the same assumptions apply to GPUs! As a consequence, you can reuse existing no_std libraries from crates.io in your GPU code without the authors explicitly adding GPU support. This is uniquely enabled by Rust GPU's implementation choices and Rust's registers. Sharing and reusing code from the greater Rust ecosystem is a superpower when writing GPU programs that will massively compound over time.

    Soon developers will write and share Rust libraries that require running on the GPU, similar to how some existing open source libraries require a specific OS or CPU architecture. We expect many innovative GPU-specific algorithms and projects to be built in Rust.

A Heartfelt Thank You to Embark๐Ÿ”—

First and foremost, we extend our deepest gratitude to Embark Studios for their incredible work in kickstarting and supporting the Rust GPU project. Their dedication and contributions have been invaluable, laying a strong foundation for the future. The community is immensely grateful for all the resources and expertise Embark has poured into this project.

Transition Challenges: Repository Transfer๐Ÿ”—

Unfortunately, Embark has decided not to transfer the existing repository via GitHub's transfer tool, which means we will lose all our stars, issues, and pull requests. Additionally, automatic GitHub redirects will not be added. All this causes avoidable churn.

We have not fully transitioned to the new community-owned repository due to these downsides and we believe the best course of action is to encourage Embark to reconsider and simply press the GitHub transfer button, easing this transition for everyone involved. We appreciate the community's patience and understanding as we get things sorted out and we'd love your support encouraging Embark to reconsider the mechanics of the transfer.

New Focus: GPU Compute and GPGPU๐Ÿ”—

With the industry's growing emphasis on generative AI and LLMs, we are shifting our primary focus towards GPU compute and General-Purpose GPU (GPGPU) programming. This also aligns with the trend in GPU hardware to increasingly utilize the compute capabilities of GPUs to run graphics pipelines as software libraries rather than relying on specialized hardware. Even graphics-focused programs such as video games are moving away from solely relying on graphics pipelines and instead running as much of the engine as possible in GPU compute.

In the past, the primary focus on graphics use-cases did not materialize the necessary contributors and community engagement to make the Rust GPU project sustainable. We hope our new focus will attract more contributors and users.

However, it is important to note that graphics use-cases will continue to be supported, developed, and improved in Rust GPU! We appreciate our early graphics adopters and remain committed to enhancing the graphics capabilities of Rust GPU.

Addressing Stability and Nightly Rust๐Ÿ”—

Though Rust GPU requires the nightly version of Rust, Embark had unique stability goals which resulted in Rust GPU not tracking the latest nightly. This has been a hurdle for adoption, as most people experimenting with Rust GPU are likely already on nightly to get the latest and greatest, not use a randomly chosen nightly from months ago. To address this, we will be tracking the latest Rust nightly builds moving forward. For those concerned about stability, you can pin to a particular nightly version via rust-toolchain, and there are ways to build your GPU code with nightly while keeping your CPU code on stable.

With today's release we are closer to this goal but we aren't quite tracking the latest nightly yet as some newer rustc changes require more substantial changes to Rust GPU's compiler backend.

Short-Term Roadmap๐Ÿ”—

Our immediate focus is on the following tasks:

Long-Term Vision: First-Class GPU Targets in Rust๐Ÿ”—

Looking further ahead, one of our ambitious goals is to merge Rust GPU or its successor into the Rust compiler itself. We want to make GPUs (and TPUs and NPUs) first-class targets in Rust and make programming them as ergonomic as CPU programming. Hardware is shifting from scalar, serial processing to matrix, parallel processingโ€”software must do the same. We are excited about the future of Rust GPU and the potential it holds.

Thank you for your continued support and contributions. Stay tuned for more updates, and don't hesitate to reach out if you have any questions or want to get involved.

Happy coding!

LegNeato (GitHub, Twitter) and eddyb (GitHub)

Rust GPU Maintainers