From 827a7098a8d3df91465f582170fe0b9610612f3d Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Tue, 27 Aug 2024 10:50:53 -0700 Subject: [PATCH] Fix handle translation when ddi table fallback (#185) - 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/lib/ze_lib.cpp b/source/lib/ze_lib.cpp index 859af68e..2f93997b 100644 --- a/source/lib/ze_lib.cpp +++ b/source/lib/ze_lib.cpp @@ -126,6 +126,10 @@ namespace ze_lib { result = zetDdiTableInit(); } + // If ze/zet ddi tables have been reinit and no longer use the intercept layer, then handles passed to zelLoaderTranslateHandleInternal do not require translation. + // Setting intercept_enabled==false changes the behavior of zelLoaderTranslateHandleInternal to avoid translation. + // Translation is only required if the intercept layer is enabled for the ZE handle types. + loader::context->intercept_enabled = false; } if (sysmanOnly || sysmanEnv) { // reInit the ZES DDI Tables