←back to thread

Rust CUDA Project

(github.com)
146 points sksxihve | 1 comments | | HN request time: 0s | source
Show context
shmerl ◴[] No.43656833[source]
Looks like a dead end. Why CUDA? There should be some way to use Rust for GPU programming in general fashion, without being tied to Nvidia.
replies(5): >>43656967 #>>43657008 #>>43657034 #>>43658709 #>>43659892 #
pjmlp ◴[] No.43657034[source]
Because others so far have failed to deliver anything worthwhile using, with the same tooling ecosystem as CUDA.
replies(3): >>43657851 #>>43658002 #>>43658007 #
coffeeaddict1 ◴[] No.43657851[source]
While I agree, that CUDA is the best in class API for GPU programming, OpenCL, Vulkan compute shaders and Sycl are alternatives that are usable. I'm for example, using compute shaders for writing GPGPU algorithms that work on Mac, AMD, Intel and Nvidia. It works ok. The debugging experience and ecosystem sucks compared to CUDA, but being able to run the algorithms across platforms is a huge advantage over CUDA.
replies(3): >>43658021 #>>43658035 #>>43658602 #
keldaris ◴[] No.43658021[source]
How are you writing compute shaders that work on all platforms, including Mac? Are you just writing Vulkan and relying on MoltenVK?

AFAIK, the only solution that actually works on all major platforms without additional compatibility layers today is OpenCL 1.2 - which also happens to be officially deprecated on MacOS, but still works for now.

replies(2): >>43658633 #>>43658666 #
pjmlp ◴[] No.43658633[source]
And is stuck with C99, versus C++20, Fortran, Julia, Haskell, C#, anything else someone feels like targeting PTX with.
replies(1): >>43658760 #
keldaris ◴[] No.43658760[source]
Technically, OpenCL can also include inline PTX assembly in kernels (unlike any compute shader API I've ever seen), which is relevant for targeting things like tensor cores. You're absolutely right about the language limitation, though.
replies(1): >>43662463 #
pjmlp ◴[] No.43662463[source]
At which point why bother, PTX is CUDA.
replies(1): >>43666392 #
1. keldaris ◴[] No.43666392{3}[source]
Generally, the reason to bother with this approach is if you have a project that only needs tensor cores in a tiny part of the code and otherwise benefits from the cross platform nature of OpenCL, so you have a mostly shared codebase with a small vendor-specific optimization in a kernel or two. I've been in that situation and do find that approach valuable, but I'll be the first to admit the modern GPGPU landscape is full of unpleasant compromises whichever way you look.