Skip to content

Commit 8f1f54e

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 8f1f54e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sycl/ur_win_proxy_loader/ur_win_proxy_loader.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ 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 the runtime.
150+
// This is necessary to avoid the level zero loader from being unloaded prematurely.
151+
// the Only trusted loader is the one that is loaded from the system32 directory.
152+
LoadLibraryExW(L"ze_loader.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
149153

150154
// Restore system error handling.
151155
(void)SetErrorMode(SavedMode);

unified-runtime/cmake/FetchLevelZero.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
4444
set(BUILD_STATIC ON)
4545

4646
if (UR_LEVEL_ZERO_LOADER_REPO STREQUAL "")
47-
set(UR_LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git")
47+
set(UR_LEVEL_ZERO_LOADER_REPO "https://github.com/nrspruit/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 dbdd143a024e515e670d8be8a96fe0fc3e7fc7bc)
5151
endif()
5252

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

0 commit comments

Comments
 (0)