negril / gentoo-overlay

1 stars 0 forks source link

Blender HIPRT (Blender 4.3 onwards) have special considerations for runtime path #1

Open yretenai opened 2 hours ago

yretenai commented 2 hours ago

Relevant CMake rules: https://github.com/blender/blender/blob/8a02a5de56d163ecad402804898cc58d417d9499/intern/cycles/kernel/CMakeLists.txt#L452-L465

HIPRT is a recent addition to Blender and it struggles to find the appropriate fatbins (hiprt02003_6.1_amd.hipfb, oro_compiled_kernels.hipfb) as it looks in ./libs (which ends up being /lib64?)

Failing to find these Blender will simply report Failed to create BLAS, however forcing HIPRT to log everything it's simply failing to find the fatbin.

This is behavior built into HIPRT and HIPRTEW: https://github.com/GPUOpen-LibrariesAndSDKs/HIPRT/blob/83e18cc9c3de8f2f9c48b663cf3189361e891054/hiprt/impl/Compiler.cpp#L543-L572 and Orochi https://github.com/GPUOpen-LibrariesAndSDKs/HIPRT/blob/83e18cc9c3de8f2f9c48b663cf3189361e891054/contrib/Orochi/ParallelPrimitives/RadixSort.cpp#L146-L147

Note that HIPRT itself compiles to libhiprt0200364.so, where blender anticipates libhiprt64.so.

The comments and usage in the Blender CMake indicate that Intel OneAPI might also rely on this behavior. https://github.com/blender/blender/blob/8a02a5de56d163ecad402804898cc58d417d9499/intern/cycles/kernel/CMakeLists.txt#L1302-L1303

yretenai commented 2 hours ago

https://github.com/GPUOpen-LibrariesAndSDKs/HIPRT/blob/83e18cc9c3de8f2f9c48b663cf3189361e891054/contrib/Orochi/ParallelPrimitives/RadixSort.cpp#L126-L139 https://github.com/GPUOpen-LibrariesAndSDKs/HIPRT/blob/83e18cc9c3de8f2f9c48b663cf3189361e891054/hiprt/impl/Utility.cpp#L59-L71

It seems to always locate next to the libhiprt.so

yretenai commented 10 minutes ago

Blender 4.3 releases on 6th November 2024.