Nvidia announces native GPU programming in Rust

(developer.nvidia.com)

148 points | by nonmaskable 12 hours ago

15 comments

  • claiir 1 hour ago
    > The launch is checked rather than trusted.

    Damn even Nvidia is putting out fully Claude-written articles.

    • written-beyond 0 minutes ago
      I hadn't read the article and read this comment as though NVIDIA themselves were implying that this library was checked but not trusted by them since it was fully LLM generated.
    • bayindirh 1 hour ago
      That's actually a magnificent observation. This is not only an indication of a keen eye, but a trained brilliant mind as well.
      • hitekker 58 minutes ago
        You’re absolutely right!
    • daemonologist 3 minutes ago
      I get the impression that Nvidia employees don't care too much - I started seeing fully AI-written "documentation" on some of their smaller projects more than a year ago (i.e., before it was even slightly a good idea).
      • DonsDiscountGas 1 minute ago
        People never really read documentation before. Agents do read it now, and they seem to understand LLM-written text just fine.
        • WD-42 0 minutes ago
          > People never really read documentation before.

          The heck you talking about? How do you think we wrote software for the last 50 years?

    • keybrd-intrrpt 53 minutes ago
      > even Nvidia

      Why "even Nvidia"?

      They are fully behind using AI for basically everything.

      What's next? "Damn, even McDonald's is putting out unhealthy food"

      • jchw 38 minutes ago
        Sure, but even Anthropic doesn't appear to use Claude for blog posts. (I don't think anyone should. The prose stinks.)
      • keithnz 51 minutes ago
        they even do burgers!
    • api 1 minute ago
      Is that your honest load bearing assessment you’re going to flag?
    • manyatoms 1 hour ago
      not to worry, they have an 'AI generated summary' box too
      • greenavocado 57 minutes ago
        Its a recursive summarization pyramid
        • pizzafeelsright 44 minutes ago
          This thread flags an honest assessment of AI signal detection.
    • mahboi 1 hour ago
      Thanks, saved me a few minutes
  • dllu 1 hour ago
    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

    • jacobgorm 1 hour ago
      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.
      • keithnz 47 minutes ago
        kernels aren't meant to be written by any defined language. C is just a traditionally good default language that took over from assembly. No particular reason we have to stick with C.
      • cpill 56 minutes ago
        oh no no no, this is going to break the CPP hold on AI and game dev.
  • jacobgorm 1 hour ago
    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.

    • tombert 30 minutes ago
      > I strongly dislike CUDA. Once you have allowed that proprietary cr*p

      Genuine question...why not just type "crap"? It's not even that much of a curse, but I've never really understood the point of self-censorship. If you don't want to curse then you could just use a non-curse word.

      • lovelearning 0 minutes ago
        It may be to bypass censorship, rather than self-censorship. Some platforms block or shadowban comments with curse words. Not sure about this platform.
    • fg137 58 minutes ago
      > Once you have allowed that proprietary cr*p into your C++ codebase

      People have been doing that all the time for every kind of codebase. It's just part of the business. I don't see how it's worth having any emotions or opinions about it. Seems like you are wasting your energy.

      Are win32 APIs proprietary? So you decide to use them, use a wrapper/UI framework, or don't develop for Windows. Easy choice.

      Developing for embedded devices? So you read the manufacturers manual and implement based on the spec, use some sort of HAL if they are available, or you don't have a job. Even simpler.

      • jacobgorm 44 minutes ago
        CUDA is not an API, CUDA is a language, so you cannot make that comparison.
        • esseph 25 minutes ago
          > The CUDA runtime is a special case of one of the libraries provided by the CUDA Toolkit. The CUDA runtime provides both an API and some language extensions to handle common tasks such as allocating memory, copying data between GPUs and other GPUs or CPUs, and launching kernels. The API components of the CUDA runtime are referred to as the CUDA runtime API.

          From: https://docs.nvidia.com/cuda/cuda-programming-guide/01-intro...

    • pavon 1 hour ago
      > 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

      Isn't that how CUDA code is normally written?

      • jacobgorm 43 minutes ago
        No. CUDA allows you to write all the code in a single file, and uses a preprocessor to split it back out and pass it through separate compilers, one for host and one for device.
        • compiler-guy 33 minutes ago
          This true, but you can write the two separately if you want.

          The disadvantages of writing them together are listed in the various parent posts. But some code authors really like the convenience of having the two in the same file.

    • melodyogonna 1 hour ago
      You could also use Mojo, one language for all targets.
      • carefree-bob 1 hour ago
        I began to lose interest after the acquisition. Have you been following along, are they still going to open source it?
        • ecl3ctic 1 hour ago
          The Mojo compiler has been open source for over a month now.

          And the Mojo standard library has been open source for over a year.

          It’s all open source. Go check it out!

          • carefree-bob 27 minutes ago
            Nice, thank you. There is an old python project I've been thinking about converting to Mojo.
        • YuechenLi 1 hour ago
          I thought they already did and released the compiler source code under Apache 2.0.
    • cpill 52 minutes ago
      yeah, just write a stub/wrapper around it and abstract. it's the classic coupling problem. nothing to do with CUDA
    • bigyabai 1 hour ago
      Is this satire? D3D12 and Metal aren't any less proprietary than CUDA.
  • LarsDu88 1 hour ago
    In this age of LLM written everything which has softly killed my motivation for learning Rust somewhat, this has revived my interest if not only for the fact the LLMs haven't yet been trained on this yet!
    • impulser_ 1 hour ago
      LLM don't need to be trained in a library to use it well. It's just Rust which they know well.
    • w4yai 1 hour ago
      And what prevent you exactly ?

      There were humans far superior than you for writting Rust before LLM, now there's a LLM. The only difference is price and time execution.

      You get an awesome teacher (LLM) ready to answer all your questions about Rust.

      And you still find excuses not to learn it ?

      At some point, just realize you've been lazy to learn it and LLMs are just an excuse.

      • afavour 43 minutes ago
        I think OP’s point is that the payoff in learning a new language has diminished in this AI era. You can call that lazy, I’d consider it smart to consider whether you could be doing other, better, things with your time.
        • w4yai 13 minutes ago
          If the sole motivation for learning things are payoff, then sure.
  • manyatoms 1 hour ago
    How does this compare to vectorware? (https://www.vectorware.com/blog/)
  • the__alchemist 1 hour ago
    I'm looking forward to trying these when they stabilize! I currently use WGPU for graphics, and cudarc for CUDA.

    Note: Cuda-oxide is similar to Cudarc's host component, but uses a rust-style kernel dialect. Advantage: Share structs between host and device. Disadvantage: Trading standard Cuda kernels for a new, WIP dialect.

    I haven't tried the tile API yet; looking forward to it.

    The last time I checked, Cuda Oxide was Linux only, and required Async; these are why I haven't tried it yet.

    • embedding-shape 1 hour ago
      cudarc been great for me, because it's easy to look up existing examples and references, and it maps 1-to-1 with what I see. I'm already having a tough time with CUDA itself, a dialect of it makes a tad harder to rely on previous work.

      Seems more ergonomic in general though, both approaches they share, compared to cudarc, and less build infrastructure and fiddling with environments, which is great.

  • bt1a 44 minutes ago
    Will it then be possible to query TJunc hotspot temps on linux?
  • nicebyte 1 hour ago
    what this article tells me is that no one at Nvidia actually cares about this project whatsoever. otherwise, they would have had a person actually write the announcement.
  • mococa 41 minutes ago
    AI slop article, how can I trust on this?
  • shmerl 7 minutes ago
    Nvidia only? Typical.

    This is more promising: https://github.com/Rust-GPU/rust-gpu/

  • mococa 42 minutes ago
    The world is unsafe
    • Xeoncross 4 minutes ago
      Rust just makes you sign a waiver first.
  • rvz 1 hour ago
    First of all, this is a pre-1.0 release that requires a nightly Rust compiler (if you choose the SIMT track with cuda-oxide) so that one is going to be unstable software.

    Secondly, When an issue occurs with a kernel or you want to write your own custom kernel in Rust, now we need to diagnose if the problem came from either cuda-oxide (SIMT), Rust's side, CUDA or Tile (If you decide to choose the Tile track).

    Another dependency into the list and course everything is open source except CUDA itself. So any issue that happens on the CUDA level, you are forced to wait for them to fix it.

  • nonmaskable 12 hours ago
    [dead]
  • westurner 30 minutes ago
    [dead]
  • ReshamJoshi 12 hours ago
    [dead]