Skip to content

Commit 03f5e13

Browse files
committed
Avoid segfaults during Scene shutdown
The JIT might have shutdown before the `static_accel_shutdown_gpu` is executed.
1 parent 112d1ae commit 03f5e13

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/render/scene_optix.inl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,8 @@ MI_VARIANT void Scene<Float, Spectrum>::static_accel_shutdown_gpu() {
580580
/* Decrease the reference count of the pipeline JIT variable.
581581
This will trigger the release of the OptiX pipeline data
582582
structure if no ray tracing calls are pending. */
583-
(void) UInt32::steal(config.pipeline_jit_index);
583+
if (jit_has_backend(JitBackend::CUDA))
584+
(void) UInt32::steal(config.pipeline_jit_index);
584585

585586
for (size_t i = 0; i < 2 * OPTIX_SHAPE_TYPE_COUNT; i++)
586587
free(config.custom_shapes_program_names[i]);

0 commit comments

Comments
 (0)