‹ BackHN Continuity

Thread

Nvidia announces native GPU programming in Rust

970 points · 404 comments · nonmaskable

  1. jacobgorm · · focus · HN ↗
    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, etc. These days we even have DSLs like Triton that make kernel writing much more ergonomic than anything you would hope to achieve in Rust.

    1. harrison_clarke · · focus · HN ↗
      from what i can tell, you're going to be stuck with that no matter what you do

      i'm currently using vulkan, and HLSL via dxc. which should be portable but it's not.

      apple refuses to support vulkan, and relies on moltenvk and there's a bunch of OS/hardware/driver differences no matter what you do, that you'll probably have to feature test for, and compile a few different versions of your code no matter what you do

      i think if you're doing something that you don't have to distribute to customers, just picking one stack and getting locked in has some appeal.

      it leaves you vulnerable to lockin. but, especially in the age of ai, "claude, port this to vulkan" seems like a good enough defense against that

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.