From a803e0030addd0b6acdae1a6d81d3089600a2510 Mon Sep 17 00:00:00 2001 From: Krzysztof Swiecicki Date: Tue, 15 Sep 2026 13:54:10 +0000 Subject: [PATCH] [L0v2] Fix end graph capture function null-check PR #22988 introduced a workaround for a problem occuring with some level-zero & compute-runtime version combinations. In some cases, the workaround checked wrong function pointer retrieved from the L0 driver. --- .../source/adapters/level_zero/common/platform.hpp | 6 ++++++ .../source/adapters/level_zero/v2/command_list_manager.cpp | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/unified-runtime/source/adapters/level_zero/common/platform.hpp b/unified-runtime/source/adapters/level_zero/common/platform.hpp index 473e5ab826378..6d25ab8febfe4 100644 --- a/unified-runtime/source/adapters/level_zero/common/platform.hpp +++ b/unified-runtime/source/adapters/level_zero/common/platform.hpp @@ -254,6 +254,12 @@ struct ur_platform_handle_t_ : ur::level_zero::ur_object_t, public ur_platform { hGraph, pNext, phExecutableGraph); } + bool hasEndGraphCapture() const { + return UsesLegacyExperimentalApi + ? zeCommandListEndGraphCaptureExpLegacy != nullptr + : zeCommandListEndGraphCaptureExp != nullptr; + } + // Legacy experimental query results use different bit patterns than the // stable enumerators of the same name; translate to the stable ones. // Applied unconditionally: a known NEO bug makes the stable *Ext query diff --git a/unified-runtime/source/adapters/level_zero/v2/command_list_manager.cpp b/unified-runtime/source/adapters/level_zero/v2/command_list_manager.cpp index f8a2cf0614baa..8c97ade034533 100644 --- a/unified-runtime/source/adapters/level_zero/v2/command_list_manager.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/command_list_manager.cpp @@ -1377,8 +1377,7 @@ ur_command_list_manager::endGraphCapture(ur_exp_graph_handle_t *phGraph) { if (!checkGraphExtensionSupport(hContextInternal)) { return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - if (!hContextInternal->getPlatform() - ->ZeGraphExt.zeCommandListEndGraphCaptureExp) { + if (!hContextInternal->getPlatform()->ZeGraphExt.hasEndGraphCapture()) { return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; }