From b2a12c304c8982b9e80c2a6b6ccd140e35f95499 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Tue, 27 Aug 2024 07:25:46 -0700 Subject: [PATCH] Fix handle translation when ddi table fallback - When enough drivers are removed that ddi table fallback is completed, then intercept_enabled needs to be set to false such that handle translation is done correctly. Signed-off-by: Neil R. Spruit --- source/lib/ze_lib.cpp | 2 ++ source/loader/ze_loader_api.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/lib/ze_lib.cpp b/source/lib/ze_lib.cpp index 859af68..8789e7a 100644 --- a/source/lib/ze_lib.cpp +++ b/source/lib/ze_lib.cpp @@ -126,6 +126,8 @@ namespace ze_lib { result = zetDdiTableInit(); } + // Disable intercept_enabled if requireDdiReinit such that calls to ze handle translation are skipped. + loader::context->intercept_enabled = false; } if (sysmanOnly || sysmanEnv) { // reInit the ZES DDI Tables diff --git a/source/loader/ze_loader_api.cpp b/source/loader/ze_loader_api.cpp index d86d92c..93918a5 100644 --- a/source/loader/ze_loader_api.cpp +++ b/source/loader/ze_loader_api.cpp @@ -77,7 +77,7 @@ zelLoaderGetVersionsInternal( ZE_DLLEXPORT ze_result_t ZE_APICALL zelLoaderTranslateHandleInternal( zel_handle_type_t handleType, - void *handleIn, + void *handleIn, void **handleOut) {