‹ BackHN Continuity

Thread

Nvidia announces native GPU programming in Rust

970 points · 404 comments · nonmaskable

  1. salsa_catsup · · focus · HN ↗
    Does this mean I can write shaders in Rust for use with WGPU or Vulkan?
    1. ivanjermakov · · focus · HN ↗
      WGPU/Vulkan don't work with PTX shaders by default, additional translation would be needed.

      On a side note, Vulkan has extension to launch CUDA kernels: <a href="https:&#x2F;&#x2F;docs.vulkan.org&#x2F;refpages&#x2F;latest&#x2F;refpages&#x2F;source&#x2F;VK_NV_cuda_kernel_launch.html" rel="nofollow">https:&#x2F;&#x2F;docs.vulkan.org&#x2F;refpages&#x2F;latest&#x2F;refpages&#x2F;source&#x2F;VK_N...

    2. berkes · · focus · HN ↗
      The way I understood it, rust would become an option next to Vulkan, WGPU (and opengl etc?).

      But only for compute tasks. So, practically an alternative language to write compute shaders in.

    3. PudgePacket · · focus · HN ↗
      You have been able to for a while with rust-gpu <a href="https:&#x2F;&#x2F;github.com&#x2F;Rust-GPU&#x2F;rust-gpu" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Rust-GPU&#x2F;rust-gpu.
    4. laggui · · focus · HN ↗
      For compute shaders, you can already do this with CubeCL: <a href="https:&#x2F;&#x2F;github.com&#x2F;tracel-ai&#x2F;cubecl" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tracel-ai&#x2F;cubecl

      You write kernels in a Rust DSL using #[cube], it supports WebGPU through WGSL and Vulkan through SPIR-V, along with CUDA, AMD via ROCm, and Metal. (disclosure: I am a contributor)

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.