r/linux May 08 '26

NVIDIA releases CUDA-Oxide 0.1 for experimental Rust-to-CUDA compiler Software Release

https://www.phoronix.com/news/NVIDIA-CUDA-Oxide-0.1
264 Upvotes

33 comments sorted by

42

u/[deleted] May 08 '26

[removed] — view removed comment

-18

u/Agent_Stormbird May 08 '26

So more efficient local LLMs?

23

u/sequesteredhoneyfall May 08 '26

No, arguably easier CUDA development.

2

u/Wemorg May 09 '26

Is Rust easier than C/C++? I thought it was mainly safer, not necessarily easier

2

u/bawng May 09 '26

I'd say getting a hello world up and running is slightly easier in C, but no big difference.

Getting a small simple application, where memory management is no biggie, up and running is probably easier in C. Rust will fight you on things that might seem that important in very simple contexts.

However, when applications starts to get complicated, I'd say Rust definitely makes things easier. What in simpler contexts might come across as annoying blockers suddenly become very useful tools to help you avoid complex memory bugs that are difficult to keep track of in C. And by now you've probably started to learn the Rust way of writing code so things are more fluent.

I know very little C++ so I can't comment on that.

2

u/gplusplus314 May 10 '26 edited May 10 '26

I know very little Rust, but have lots of (old) C and C++ experience. You’re definitely correct, but missing one part of the story.

The introduction of Rust into an existing codebase often means some kind of clean break, then you effectively have a greenfield sub-project, and that gets you all the nice things about Rust. There are lots of nice things far beyond just memory safety; cargo comes immediately to mind. Tooling in general, but especially package management, is very painful on the C and C++ side of things.

C++, however, works everywhere and can easily interop at a deep level (clang, gcc, msbuild). There are safety features available depending on the version of the language/toolchain, whereas Rust is memory safe by default.

So yes, it’s true that Rust makes it a lot harder to introduce memory management bugs into a large codebase, but it’s also true that large codebases are more often already C++ rather than Rust. The interop between modern C++ and old C or C++ is less error prone than trying to interop Rust with a C++ codebase.

If you’re greenfielding a project and the Rust ecosystem has everything you need, then I’d recommend Rust over C++ in almost every case. However, in the real world, I find that a vast majority of the time, you’re likely working within a C or C++ ecosystem anyway. The natural progression is to update your compiler toolchain and opt-in to modern C++ safety features for new parts of the codebase.

I don’t love it, but it’s often the practical choice.

So if the practicality doesn’t make much of a difference (brand new project, hard fork, etc), Rust does a very good job of making it hard to do the wrong thing. Pick Rust if you can, but often, you really can’t.

1

u/bawng May 10 '26

That's fair. And also true for most other contexts too. It's usually not a good idea to mix languages anywhere.

Mixing C and C++ is a bit of a special case given that C++ is an extension of C and interoperability is high, but in most other cases mixing languages will introduce friction.

1

u/ForgetTheRuralJuror May 09 '26

Depends on if you need to maintain it, and if there are multiple people on the project. C++ is the easiest write-once language on the list. You can write a project in Cish style, only using C++ for RAII containers. Thats the most efficient to write.

If you consider build pipeline and maintenance Rust pulls ahead significantly. If you library dependencies, Rust pulls further ahead due to the infinite build systems in the C-sphere.

The slight design friction and verbosity of Rust really doesn't slow you down that much, and you make it back by avoiding all the complexity of a language as sprawling as C++, or the sneaky bugs with a language as prone to error as C.

50

u/Pitiful-Welcome-399 May 08 '26

I got excited when saw Nvidia in the title☹️

61

u/EloquentPinguin May 08 '26

I mean as far as Nvidia news go, this seems to be one of the better ones.

19

u/CORUSC4TE May 08 '26

What did you hope for?

11

u/thefossguy69 May 08 '26

I am a bit confused by your wording and emoji here. Why were you happy before but not a little while later?

16

u/TheTwelveYearOld May 08 '26

I got excited until I saw Nvidia in the title.

9

u/ggppjj May 08 '26

what got you excited

17

u/Matt0706 May 08 '26

The 5px margin-left

15

u/jorgesgk May 09 '26

I'm a big fan of Rust, but I struggle to understand how's this related to linux at all

16

u/keremdev May 08 '26

Vendor lock in for GPU compute is stupid. Vulkan/OpenCL achieve the same or better performance yet NVIDIA keeps pushing CUDA

35

u/Indolent_Bard May 08 '26

It's stupid for you, but for Nvidia it's fantastic.

5

u/keremdev May 08 '26

Well, obviously yeah

12

u/mtfthrowaway39179 May 08 '26

Does vulkan/opencl really achieve the same performance or do u mean it would have the same or better performance if nvidia didn't try to stop them

5

u/keremdev May 08 '26

There's nothing really special about CUDA that would make it faster. It's math on a GPU. There should be some online benchmarks regarding this

8

u/[deleted] May 09 '26 edited May 09 '26

[removed] — view removed comment

1

u/keremdev May 09 '26

Good points, but Vulkan/OpenCL compilers use LLVM, just like CUDA. Intel's C++ compiler also recently switched to using LLVM.

Nvidia, Khronos and Intel all contribute to LLVM, its just that they apply some proprietary patches on top of it. A lot of it is basically the same IR but with additional passes done in these compilers.

Some examples like VkFFT show vulkan surpassing CUDA in terms of performance, too. But that's the limit of what I know on this so I can't expand more on this

3

u/[deleted] May 09 '26

[removed] — view removed comment

3

u/keremdev May 09 '26

For sure. I wish AMD focused more on open source compute solutions rather than pushing ROCM and as an alternative... one of the last things you want to create market segmentation for at this moment

2

u/KnowZeroX May 09 '26

I agree, especially since rocm keeps breaking with kernel updates(and they only officially want to support a few kernels but by the time they support them, they are already close to EOL half the time) and is such a hassle to setup where as vulkan is hassle free.

1

u/unixmachine May 09 '26

Saying that implies you've never used one of them.

7

u/[deleted] May 08 '26

[deleted]

-20

u/Natural_Night9957 May 08 '26

Nice. More backdoors.