Merge branch 'gpu-scaling-wait-fix' into rc173 (clear the failed allocation's CUDA error before the GPU-scaling retry)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D1G8gJVAy6gp1K5Dz3NE5C
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-09-29 14:20:24 +02:00
commit 2201fcb2b6
1 file changed
+4
@@ -713,11 +713,15 @@ struct RotationScaleMergeGPU::Impl {
// end and is asked for again - the same buffer, so what the merge computes does not depend on the
// wait. It is asked for again also when nothing is running beside it any more: work that ended
// between the failure and the check has just given its memory back.
//
// The failed allocation is handled here, so its error must not stay behind as this thread's last
// error: the next kernel launch's cudaGetLastError() would report it over work that went fine.
template <typename T>
CudaDevicePtr<T> Alloc(size_t n) const {
try {
return CudaDevicePtr<T>(n, ALLOC);
} catch (const JFJochException &) {
cuda_clear_error();
}
if (!wait_for_gpu_work_beside(GPU_BUSY_TIMEOUT))
ThrowGPUBusy(n_obs);