news.volyx.in

CUDA-oxide: Nvidia's official Rust to CUDA compiler (nvlabs.github.io)

424 points by adamnemecek · 110 days ago · 118 comments on HN

Article summary

Nvidia has released an experimental Rust-to-CUDA compiler called cuda-oxide, which allows developers to write GPU kernels in Rust. The compiler translates Rust code into PTX, which can be executed on NVIDIA GPUs. This project aims to provide a safe and idiomatic way to write GPU code in Rust, leveraging the language's type system and ownership model. The compiler is still in its early stages, with a v0.1.0 release available for testing and feedback.

Main themes

  • Rust for GPU programming
  • CUDA compiler
  • GPU kernel development
  • Safety and performance
  • Nvidia and open source

What commenters say

  • Cuda-oxide has the potential to be a near drop-in replacement for existing Rust CUDA crates, offering improved build times and a more idiomatic Rust experience.
  • The project's focus on safety and Rust's ownership model can bring more safety to CUDA programming, but some argue that writing GPU kernels is inherently unsafe due to hardware complexities.
  • Some commentators are skeptical about the project's value due to its reliance on closed-source NVIDIA drivers and runtime binaries, while others see it as a practical solution for adding GPU interaction to Rust programs.
  • The use of Rust's type system and ownership model can help mitigate common errors in GPU programming, such as use-after-free and aliasing issues, but may also introduce additional complexity.
  • There are differing opinions on whether cuda-oxide is a library or a full-fledged compiler, with some arguing that its compilation of Rust to CUDA makes it more than just a library.
  • Some commentators are interested in the potential for automatic differentiation in Rust, which could be a valuable feature for machine learning and other applications.
  • The project's compatibility with existing CUDA ecosystems and tools, such as Cudarc, is a topic of discussion, with some arguing that it can coexist with or even replace these tools.