Skip to content

Commit

Permalink
Pipeline early killswitch: release the GPU device when exiting early
Browse files Browse the repository at this point in the history
Thanks @Jiyone
  • Loading branch information
aurelienpierre committed Jan 17, 2025
1 parent 836443c commit 4b5a8db
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/develop/pixelpipe_hb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2306,6 +2306,11 @@ static int dt_dev_pixelpipe_process_rec_and_backcopy(dt_dev_pixelpipe_t *pipe, d
#define KILL_SWITCH_PIPE \
if(dt_atomic_get_int(&pipe->shutdown)) \
{ \
if(pipe->devid >= 0) \
{ \
dt_opencl_unlock_device(pipe->devid); \
pipe->devid = -1; \
} \
pipe->status = DT_DEV_PIXELPIPE_DIRTY; \
dt_iop_nap(200); \
return 1; \
Expand Down Expand Up @@ -2393,10 +2398,15 @@ restart:;
dt_print(DT_DEBUG_OPENCL,
"[opencl] frequent opencl errors encountered; disabling opencl for this session!\n");
dt_control_log(
_("ansel discovered problems with your OpenCL setup; disabling OpenCL for this session!"));
_("Ansel discovered problems with your OpenCL setup; disabling OpenCL for this session!"));
// also remove "opencl" from capabilities so that the preference entry is greyed out
dt_capabilities_remove("opencl");
}
else
{
dt_print(DT_DEBUG_OPENCL,
"[opencl] opencl errors encountered; disabling opencl for this pipeline!\n");
}

dt_dev_pixelpipe_flush_caches(pipe);
dt_dev_pixelpipe_change(pipe, dev);
Expand Down

0 comments on commit 4b5a8db

Please sign in to comment.