Just like it says on the tin there. I was getting frustrated with having to use workarounds and jury-rigging to get anywhere with HIP on Windows when the Googler pointed towards a comment from @bsavery about Orochi, I got nothing but time until next fall when college starts for my interactive media development program, got a stack of surgeries to chew through so I’m homebound regardless, guidance on good practices is always welcome.
I hope to replace all GPU backend in Cycles with Orochi which will hopefully mean that the necessary code for compute is reduced to 1/4 of it’s previous self to allow for (hopefully) much simpler development provided hardware vendors don’t go offroad with their development. oneAPI and Metal are not as of yet implemented in Orochi so that’s an obstacle on top of an obstacle. It would be nice to use Orochi to get OpenCL going again for those with legacy hardware, if possible.
My hope is to really push for hardware agnosticism and simplicity (somewhat). I think it would make an interesting project if nothing else and technically the code to do this is already in Blender, (sort of) because if you’ve read the Orochi documentation it almost seems like you could just run a script to find every instance of “hip” and change it to “oro” and 90% of dev is taken care of.
From the github repo
HIP
#include <hip/hip_runtime.h>
hipInit( 0 );
hipDevice device;
hipDeviceGet( &device, 0 );
hipCtx ctx;
hipCtxCreate( &ctx, 0, device );
After pushing it through the oro-fice it becomes,
Orochi CUDA/HIP
#include <Orochi/Orochi.h>
oroInitialize( ORO_API_HIP, 0 );
oroInit( 0 );
oroDevice device;
oroDeviceGet( &device, 0 );
oroCtx ctx;
oroCtxCreate( &ctx, 0, device );
Which as they say on the repo has made that code capable of being used on red or green flavored GPUs. Not all cases are going to be that simple but in essence this beautiful layer barely changed pre-existing HIP targeted code, then traded one small addition for the entirety of what would be needed for CUDA, if/with oneAPI, Metal and BrokenCL that’s a bananas amount of code not to have to worry about anymore. This also has the added benefit of not having to care about the HIP SDK not being around for Windows users and the lack of straightforward means to compile HIP on Windows. Unless one decided to just appear out of thin air recently.
If anyone has been playing with Orochi and has some pearls to drop I’m all for it,