Merge branch 'blender-v4.4-release'

This commit is contained in:
Sergey Sharybin
2025-03-04 09:37:06 +01:00
5 changed files with 49 additions and 13 deletions

View File

@@ -40,9 +40,20 @@ ExternalProject_Add(external_hiprt
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/hiprt
PATCH_COMMAND ${PATCH_CMD} -p 1 -d
${BUILD_DIR}/hiprt/src/external_hiprt <
${PATCH_DIR}/hiprt.diff
# hiprt_target_dependency.diff:
# https://github.com/GPUOpen-LibrariesAndSDKs/HIPRT/pull/31
# hiprt_install.diff:
# https://github.com/GPUOpen-LibrariesAndSDKs/HIPRT/pull/30
PATCH_COMMAND
${PATCH_CMD} -p 1 -d
${BUILD_DIR}/hiprt/src/external_hiprt <
${PATCH_DIR}/hiprt_target_dependency.diff &&
${PATCH_CMD} -p 1 -d
${BUILD_DIR}/hiprt/src/external_hiprt <
${PATCH_DIR}/hiprt_install.diff &&
${PATCH_CMD} -p 1 -d
${BUILD_DIR}/hiprt/src/external_hiprt <
${PATCH_DIR}/hiprt_baked_bvh_array.diff
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/hiprt

View File

@@ -0,0 +1,21 @@
diff --git a/hiprt/impl/Compiler.cpp b/hiprt/impl/Compiler.cpp
index 514667a..509f3f4 100644
--- a/hiprt/impl/Compiler.cpp
+++ b/hiprt/impl/Compiler.cpp
@@ -776,7 +776,15 @@ oroFunction Compiler::getFunctionFromPrecompiledBinary( const std::string& funcN
// kernel.
if constexpr ( UseBakedCompiledKernel )
{
- checkOro( oroModuleLoadData( &module, &bvh_build_array_h ) );
+ // Copy the data into a heap memory.
+ //
+ // Otherwise it seems to be causing issues with access from the HIP SDK when the application binary is
+ // located in a directory with space in it.
+ //
+ // The speculation is that static global memory can not really be megabytes, and access to it requires
+ // mapping of the original file, and this is where things start to go wrong.
+ std::vector<char> binary(bvh_build_array_h, bvh_build_array_h + bvh_build_array_h_size);
+ checkOro( oroModuleLoadData( &module, binary.data() ) );
}
else
{

View File

@@ -2,15 +2,6 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50eb25e..b13d2da 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -503,7 +503,7 @@ if ( BAKE_COMPILED_KERNEL )
# Create the 'bake_compiled_kernels' project
add_custom_target(bake_compiled_kernels ALL
- DEPENDS ${KERNEL_HIPRT_H} ${KERNEL_OROCHI_H}
+ DEPENDS ${KERNEL_HIPRT_H} ${KERNEL_OROCHI_H} precompile_kernels
)
add_dependencies(${HIPRT_NAME} precompile_kernels bake_compiled_kernels)
@@ -585,12 +585,16 @@ install(FILES ${HIPRT_ORO_HEADERS}
DESTINATION include/contrib/Orochi/ParallelPrimitives)

View File

@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50eb25e..b13d2da 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -503,7 +503,7 @@ if ( BAKE_COMPILED_KERNEL )
# Create the 'bake_compiled_kernels' project
add_custom_target(bake_compiled_kernels ALL
- DEPENDS ${KERNEL_HIPRT_H} ${KERNEL_OROCHI_H}
+ DEPENDS ${KERNEL_HIPRT_H} ${KERNEL_OROCHI_H} precompile_kernels
)
add_dependencies(${HIPRT_NAME} precompile_kernels bake_compiled_kernels)