From e65de74aa542f92b3789e00197b0ae51f67c00ed Mon Sep 17 00:00:00 2001 From: "Sahar A. Kashi" Date: Tue, 5 Mar 2024 19:50:29 +0100 Subject: [PATCH 1/2] Cycles: HIP search for ROCm 6 driver This should be backwards compatible, and is more future proof for future driver releases. Pull Request: https://projects.blender.org/blender/blender/pulls/118944 --- extern/hipew/src/hipew.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/hipew/src/hipew.c b/extern/hipew/src/hipew.c index 74b2ef111d6..736168e2e2f 100644 --- a/extern/hipew/src/hipew.c +++ b/extern/hipew/src/hipew.c @@ -233,7 +233,7 @@ static int hipewHipInit(void) { /* Library paths. */ #ifdef _WIN32 /* Expected in C:/Windows/System32 or similar, no path needed. */ - const char *hip_paths[] = {"amdhip64.dll", NULL}; + const char *hip_paths[] = {"amdhip64.dll", "amdhip64_6.dll", NULL}; #elif defined(__APPLE__) /* Default installation path. */ From 3e09fbf062bd9d79d6961e717954193dcae2030d Mon Sep 17 00:00:00 2001 From: "Sahar A. Kashi" Date: Thu, 29 Feb 2024 17:18:13 -0800 Subject: [PATCH 2/2] Fix #112983: Cycles HIP-RT crash on deleting all objects Pull Request: https://projects.blender.org/blender/blender/pulls/118944 --- intern/cycles/device/hiprt/device_impl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/intern/cycles/device/hiprt/device_impl.cpp b/intern/cycles/device/hiprt/device_impl.cpp index db603cd725e..f3ef48089f0 100644 --- a/intern/cycles/device/hiprt/device_impl.cpp +++ b/intern/cycles/device/hiprt/device_impl.cpp @@ -803,6 +803,12 @@ hiprtScene HIPRTDevice::build_tlas(BVHHIPRT *bvh, hiprtBuildOptions options, bool refit) { + + size_t num_object = objects.size(); + if (num_object == 0) { + return 0; + } + hiprtBuildOperation build_operation = refit ? hiprtBuildOperationUpdate : hiprtBuildOperationBuild; @@ -816,7 +822,6 @@ hiprtScene HIPRTDevice::build_tlas(BVHHIPRT *bvh, size_t num_instances = 0; int blender_instance_id = 0; - size_t num_object = objects.size(); user_instance_id.alloc(num_object); prim_visibility.alloc(num_object); hiprt_blas_ptr.alloc(num_object);