Live data from Hacker News

Nvidia announces native GPU programming in Rust

developer.nvidia.com

281–290 of 321 posts

Re: Nvidia announces native GPU programming in Rust

#281
post #128

Earlier quoted context omitted.

> Are win32 APIs proprietary? Yes. And crap. Not in my code bases.

If you're going to make apps in windows, you need to call their proprietary API somehow. Maybe you do it via a wrapper library, or via electron or something. But that's the same thing, just with more indirection.

> If you're going to make apps in windows, you need to call their proprietary API somehow. Maybe you do it via a wrapper library, or via electron or something. But that's the same thing, just with more indirection.

Not even close to being true. You can invoke syscalls directly, just needs a bit of reverse engineering. I wrote a bare metal libc library, with (not a whole lot of) effort I'm fully able to interface with the kernel/open windows etc. Fully statically linked, no libc, no win32, compiled on Linux executed on Windows.

The problem is this isn't really well documented _at all_, and I even ended up attempting to get in touch with the Windows kernel dev team to give me the actual internal syscalls/endpoints, but they refuse to cooperate. Which is why writing anything for Windows is entirely pointless.

Re: Nvidia announces native GPU programming in Rust

#282

Earlier quoted context omitted.

Yes but there are business costs to using high-level proprietary tools and libraries. If you write your app using win32, you won’t be able to port is very easily. You’re also stuck with whatever bad or bizarre decisions Microsoft made. It’s even worse for CUDA. GPUs are expensive, and now you’re vendor locked. You’re between a rock and a hard place. Either spend millions in engineering time, or millions on price-gaug…

Win32 is the most stable abi on the Linux desktop.

Dead wrong. Win32 (externally) only seems stable, but internally it changes between Windows releases. Win7 syscalls are completely different from Win11 syscalls, meaning if I want to release a binary _without relying_ on Win32 I need to provide full syscall mappings _for each and every Windows version_. This doesn't happen on Linux.

Re: Nvidia announces native GPU programming in Rust

#283

I strongly dislike CUDA. Once you have allowed that proprietary cr*p into your C++ codebase, it is very hard to get rid, and you end up with code that is either tied to a single vendor or an #ifdef hell, probably both. The best way to program GPUs is face up to the reality that they are not the same machine as the CPU, write your kernels in separate files, and launch them manually, like in Metal, OpenCL, and D3D12, e…

Is this satire? D3D12 and Metal aren't any less proprietary than CUDA.

You can call their APIs without needing to compile your code with a proprietary compiler or adopt a bastardized version of C++.

Re: Nvidia announces native GPU programming in Rust

#285
post #261

Earlier quoted context omitted.

> If you write your app using win32, you won’t be able to port is very easily. Is this still true? eg, Shopify saying porting is now easy so no need for abstractions.

Porting has never been hard. Just follow the platform guidelines. Make sane architecture. Done. I mean _it's just work_. You don't need to invent anything. Just do the work. What _is_ hard is when people run after silver bullets to avoid all this work. Because people who don't understand software decide it would be cheaper to implement something only once. Or someone who does not really understand what they are doing…

> Good software development orgs _have always_ done proper per platform ports.

I really wonder why this was never fundamentally fixed. How performant a certain instruction on a specific platform is, how well it is supported and potential equivalents or sets of other instructions to emulate an equivalent are usually all very well understood.

So there should be some graph of operations which can transform any software from and to the specifics of each platform. Especially because firmware + compliers + platform abstracting libraries are basically already just that graph, although (usually?) to lossy to be applied in reverse. Add the recent developments in very large scale statistics to it and it'd probably be quite possible to transform from and to generic intent in the implementation to the uniqueness of each platform. E.g. the theming differences between a MacOS UI and a terminal application served over serial or the processing capabilities of a VLIW CPU compared to a FPGA or a GPU server.

Considering the enormous amount of work that went into compilers, better debugging and intermediate representations it seems like a huge missed opportunity nobody seriously asked the question whether information could be emitted that would allow for decompiling all the way back to the generic intent.

Re: Nvidia announces native GPU programming in Rust

#286

Earlier quoted context omitted.

I guess you are not from the generation of texters. This how languages work we used to use * as a way to avoid getting censored it over time became a way to curse or give emphasis.

Am I, with around 30, in this generation? Putting * in words seems like self censorship to me. Still, might have a cultural component. German here.

I'm in my 40s and * is self-censorship to me. It must be a cultural thing.

Re: Nvidia announces native GPU programming in Rust

#287
post #235

Earlier quoted context omitted.

I certainly dislike how everyone on YouTube is saying “SA” and “unalive” and “corn”. It’s one thing if it’s some funny commentary channel avoiding those words, but what bothers me is the true crime YouTubers. In the subject of true crime, rape and murder are just things that are probably going to come up, and when they refuse to use the appropriate language, it comes off as infantilizing, which is weird considering t…

It's become so bad that even quality history youtube channels are frequently using euphemisms like "moustache-man" instead of just saying "Hitler", to avoid their videos being buried by The Algorithm, and therefore cut severely into their viewership.

> even quality history youtube channels are frequently using euphemisms like "moustache-man" instead of just saying "Hitler"

That can be quite confusing. You had German mustache-man, Russian mustache-man, French mustache-man (Petain), French small-mustache-man (de Gaulle), Spanish small-moustache-man (Franco)

Re: Nvidia announces native GPU programming in Rust

#289
post #237

Earlier quoted context omitted.

Nobody cares if kernels are written in Rust. Kernels were meant to be written in C, but if you want to go more high-level try Triton or a similar DSL that nicely abstract tile sizes etc.

I have never seen a comment this gray

I haven't felt this popular since then 1990s when I was opposing Visual J++ and IIS.

Re: Nvidia announces native GPU programming in Rust

#290
post #5

Since NVIDIA owns huggingface now and huggingface has the excellent Candle [1] crate for inference on Rust, this seems like a good step towards nice native Rust kernels. [1] https://github.com/huggingface/candle

noob here - what's the benefit of this? Will using Rust lead to more optimal LLMs or code or both?
Post reply on HN