5 ms·
Rust CUDA Project
- porphyra 2y agoVery cool to see this project get rebooted. I'm hoping it will have the critical mass needed to actually take off. Writing CUDA kernels in C++ is a pain. In theory, since the NVVM IR is based on LLVM IR, rust in CUDA should be quite doable. In practice, though, of course it is an extreme amount of work.
- pjmlp 2y agoUnless NVIDIA actually embraces this, it will never be better than the C++, alone given the whole IDE integration, graphical debugging and libraries ecosystem. Unless one is prepared to do lots of yak shaving, and who knows, then NVIDIA will actually pay attention, like it has happened with CUDA support for other ecosystems.
- Asraelite 2y agoYeah, I would prefer to see this effort being done for AMD GPUs. They're not as powerful, but at least everything is open source and developer friendly. They should be rewarded for that.
- porphyra 2y agoAMD GPUs actually have fairly powerful hardware. However, despite being open source, calling them "developer friendly" is rather generous. Just look at how TinyCorp struggled with AMD ROCm before resorting to writing a completely sovereign stack.
- the__alchemist 2y agoSummary, from someone who uses CUDA on rust in several projects (Computational chemistry and cosmology simulations): - This lib has been in an unusable and unmaintained state for years. I.e., to get it working, you need to use specific, several-years-old variants of both rustc, and CUDA. - It was recently rebooted. I haven't tried the Github branch, but there isn't a release yet. Has anyone verified if this is working on current Rustc and CUDA yet? - The Cudarc library (https://github.com/coreylowman/cudarc) is actively maintained, and works well. It does not, however, let you share host and device data structures; you will [de]serialize as a byte stream, using functions the lib provides. Works on any (within past few years at least) CUDA version and GPU. I highlight this as a trend I see in software libs, in Rust more than others: The projects that are promoted the most are often not the most practical or well-managed ones. It's not clear from the description, but maybe rust-CUDA intends to allow shared data structures between host and device? That would be nice.
- sksxihve 2y agoI think that's true in most newer languages, there's always a rush of libraries once a language starts to get popular, for example Go has lots http client libraries even though it also has an http library in the standard library. relevant xkcd, https://xkcd.com/927/ https://xkcd.com/927/
- pests 2y agoI think this also was in small part due to them (Rob Pike perhaps? Or Brad) live-streaming them creating an http server back in the early days and it was good tutorial fodder.
- hobofan 2y agoDamn. I transfered ownership over the cudnn and cudnn-sys crates (they are by now almost 10 year old crates that I'm certain nobody ever managed to use them for anything useful) to the maintainers a few years back as it looked to be on a good trajectory, but it seems like they never managed to actually release the crates. Hope that the reboot pulls through!
- gbin 2y agoWe observed the same thing here at Copper Robotics where we absolutely need to have good Cuda bindings for our customers and in general the lack thereof has been holding back Rust in robotics for years. Finally with cudarc we have some hope for a stable project that keeps up with the ecosystem. The last interesting question at that point is why Nvidia is not investing in the rust ecosystem?
- adityamwagh 2y agoI was talking to one person from the CUDA Core Compute Libraries team. They hinted that in the next 5 years, NVIDIA could support Rust as a language to program CUDA GPUs. I also read a comment on a post on r/Rust that Rust’s safe nature makes it hard to use it to program GPUs. Don’t know the specifics. Let’s see how it happens!
- pjmlp 2y ago
- shmerl 2y agoLooks 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.
- kouteiheika 2y agoThere's no cross-vendor API which exposes the full power of the hardware. For example, you can use Vulkan to do compute on the GPU, but it doesn't expose all of the features that CUDA exposes, and you need to do the legwork yourself reimplementing all of the well optimized libraries (like e.g. cublas or cudnn) that you get for free with CUDA.
- shmerl 2y agoMake a compiler that takes Rust and compiles into some IR, then another compiler that compiles that IR into GPU machine code. Then it can work and that's going to be your API (what you developed in Rust). That's the whole point of what's missing. Not some wrapper around CUDA.
- the__alchemist 2y agoCUDA is the easiest-to-use and most popular GPGPU framework. I agree that it's unfortunate there aren't good alternatives! As kouteiheika pointed out, you can use Vulkan (Or OpenCL), but they are not as pleasant.
- pjmlp 2y agoBecause others so far have failed to deliver anything worthwhile using, with the same tooling ecosystem as CUDA.
- nuc1e0n 2y agoShouldn't it be called RUDA?
- jjallen 2y agoI’ve been using the cudarc crate professionally for a while to write and call cuda from rust. Can highly recommend. You don’t have to use super old rustc versions. Although I haven’t looked exactly what you do need to use recently.
- the__alchemist 2y agoWorks on any recent rust and Cuda version. The maintainer historically adds support for new GPU series and Cuda versions fast.
- jjallen 2y agoExactly. I thought it did, just didn't want to claim too much about it. Been a couple of months since I looked at it. I wish things would coalesce around this one.
- ein0p 2y agoFor this to take off it has to be supported by Nvidia, at feature parity with C++. Otherwise it'll remain a niche tool, unfortunately. I do hope Nvidia either supports this or rolls out their own alternative. I've been looking to get off the C++ train for years, but stuff like this keeps me there.