MCHPRS
MCHPRS copied to clipboard
[Question] Redpiler on a GPU?
Is it possible to make Redpiler utilize the GPU for even higher performance with something like Vulkano?
Hello :)
I think this sounds super cool. I'm new here and I don't know anything about the redpiler, so I don't know if this is possible. But I was thinking that if the weighted graph it generates can be represented as a linear system of equations it might be possible to solve on the GPU. I would have to think more about it and understand more about the redpiler though :)
Edit: now that I think about it time and delays will be a difficult thing to deal with. I'll have to think more about this.
Thank you for looking into it, if you create something, please let me now, I'm ready to compile and test it on my machine (Fedora Linux, Nvidia GPU)
Honestly, I've spent some time thinking about it, and this seems difficult to do on the GPU, at least the way I originally described it. Some components in redstone (like repeaters) inherently have non-linear outputs, and approximating them with a linear function didn't do any good for me.
If anyone has any ideas, please let me know! I'm not very well versed in math or CS, so input is appreciated.
Yeah, so I've actually been thinking about this too. The main problem is that redstone circuits are kinda tricky for GPUs because they have these complex dependencies and timing stuff that doesn't really play nice with how GPUs work.
GPUs are great when you can parallelize things across tons of cores, but redstone logic is often sequential like one gate's output affects the next one, i think it would be troublesome
But there might be some ways to make it work:
Maybe use the GPU for calculating independent components in bulk
Keep the timing-sensitive sequential stuff on CPU
Could probably use compute shaders for some of the math-heavy operations in complex circuits?
Honestly, I’d probably go with OpenCL or even CUDA instead of Vulkan. The main issue with compute APIs is that working with Vulkan can get pretty cumbersome at times, plus, it’s quite sensitive and debugging can be a bit of a hassle, especially when you’re just running tests. I think a better approach would be to stick with compute APIs, and maybe later on if it proves worthwhile and offers improvements over a compute API you could consider switching.