‹ 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. 15155 · · focus · HN ↗
      I don't mind CUDA, I do mind that all of the SDKs don't dynamically load the various CUDA shared libraries at runtime.. intertwining itself into your application linking process makes for extreme binary portability inconvenience.
      1. uncle_kostya · · focus · HN ↗
        There a flavor of CUDA runtime libraries that binds at runtime, so you can have a single binary that runs with CUDA and without it. I did this at work.

        Obviously you need to check if CUDA is available before trying to execute kernels, or it will error out.

        1. 15155 · · focus · HN ↗
          Sure, I've written them. None of the NVIDIA-provided SDKs are like this, including the new Rust one.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.