Skip to content

Commit df6d57d

Browse files
committed
[UR][L0] Add L0 teardown notification support and simply teardown with proxy loader support
- Add support for L0 teardown notification in the static L0 loader. - Add loading of the L0 dynamic loader in the windows proxy loader to ensure that the L0 dynamic loader is usable during teardown. Signed-off-by: Neil R. Spruit <[email protected]>
1 parent 73a4920 commit df6d57d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

sycl/ur_win_proxy_loader/ur_win_proxy_loader.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ void preloadLibraries() {
146146
loadAdapter(UR_LIBRARY_NAME(adapter_cuda));
147147
loadAdapter(UR_LIBRARY_NAME(adapter_hip));
148148
loadAdapter(UR_LIBRARY_NAME(adapter_native_cpu));
149+
// Load the Level Zero loader dynamic library to ensure it is loaded during
150+
// the runtime. This is necessary to avoid the level zero loader from being
151+
// unloaded prematurely. the Only trusted loader is the one that is loaded
152+
// from the system32 directory.
153+
LoadLibraryExW(L"ze_loader.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
149154

150155
// Restore system error handling.
151156
(void)SetErrorMode(SavedMode);

unified-runtime/cmake/FetchLevelZero.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
4747
set(UR_LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git")
4848
endif()
4949
if (UR_LEVEL_ZERO_LOADER_TAG STREQUAL "")
50-
set(UR_LEVEL_ZERO_LOADER_TAG abc68a57e5d536a449a5e45f1aef85285fa70088)
50+
set(UR_LEVEL_ZERO_LOADER_TAG 35c037cdf4aa9a2e6df34b6f1ce1bdc86ac5422f)
5151
endif()
5252

5353
# Disable due to a bug https://github.com/oneapi-src/level-zero/issues/104

0 commit comments

Comments
 (0)