back

by raphlinus·4y ago·view on hn ↗
It's not just easier to use, but more powerful in many ways. A huge advantage of CUDA is the ecosystem of high quality libraries, including cuBLAS, cuDNN (machine learning), CUB, and Thrust. In the compute shader landscape, there's nothing remotely comparable, largely because GLSL doesn't support abstractions to express concepts like "do a prefix sum (scan) with this custom monoid", so you end up having to custom code everything yourself in C.

In more recent iterations (ie since Volta/GTX 20XX), CUDA also supports independent thread scheduling (allowing mutexes with thread granularity) and cooperative groups. For really advanced workloads, that's well beyond what compute shaders can do, and I suspect it will be a decade or so to catch up, if they ever do. Of course, part of what I enjoy about compute shaders is the challenge of making algorithms run well in a more constrained computing model.

Nvidia does not hinder Vulkan compute in any way. I have a bunch of experience with Vulkan implementations and Nvidia's is certainly one of the best. In particular, their implementation of the Vulkan memory model is top-notch, with no correctness issues I've uncovered, and with a measurable performance improvement from using the fancy atomic semantics over older-style barriers. In fact, this is arguably one way in which compute shaders are more advanced than CUDA, which still does not have a formal memory model.

1 comments
> CUDA also supports independent thread scheduling

And that’s technically only present on NVIDIA and Arm Mali GPUs as of today. (Both do independent thread scheduling, not so for the other GPU vendors)