Skip to content

Commit c0c92a8

Browse files
authored
[DevASAN] Report more detailed message if enqueue kernel failed (#20010)
If user used all SLM, enqueue kernel will failed with out of device memory. We'd better report more detailed messages then user will not confuse about this error.
1 parent 04af259 commit c0c92a8

File tree

1 file changed

+11
-2
lines changed
  • unified-runtime/source/loader/layers/sanitizer/asan

1 file changed

+11
-2
lines changed

unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,19 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch(
520520

521521
UR_CALL(getAsanInterceptor()->preLaunchKernel(hKernel, hQueue, LaunchInfo));
522522

523-
UR_CALL(getContext()->urDdiTable.Enqueue.pfnKernelLaunch(
523+
ur_result_t UrRes = getContext()->urDdiTable.Enqueue.pfnKernelLaunch(
524524
hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize,
525525
LaunchInfo.LocalWorkSize.data(), numPropsInLaunchPropList, launchPropList,
526-
numEventsInWaitList, phEventWaitList, phEvent));
526+
numEventsInWaitList, phEventWaitList, phEvent);
527+
if (UrRes != UR_RESULT_SUCCESS) {
528+
if (UrRes == UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY) {
529+
UR_LOG_L(
530+
getContext()->logger, ERR,
531+
"urEnqueueKernelLaunch failed due to out of device memory, maybe "
532+
"SLM is fully used.");
533+
}
534+
return UrRes;
535+
}
527536

528537
UR_CALL(getAsanInterceptor()->postLaunchKernel(hKernel, hQueue, LaunchInfo));
529538

0 commit comments

Comments
 (0)