Skip to content

Commit de7cdce

Browse files
nrspruitKornevNikita
authored andcommitted
[UR][L0] Add L0 teardown notification support and simply teardown with proxy loader support (#18496)
- 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 5486149 commit de7cdce

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
@@ -43,7 +43,7 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
4343
set(UR_LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git")
4444
endif()
4545
if (UR_LEVEL_ZERO_LOADER_TAG STREQUAL "")
46-
set(UR_LEVEL_ZERO_LOADER_TAG ecfe375b30cc04265b20ac1b7996a85d0910f3ed)
46+
set(UR_LEVEL_ZERO_LOADER_TAG 35c037cdf4aa9a2e6df34b6f1ce1bdc86ac5422f)
4747
endif()
4848

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

0 commit comments

Comments
 (0)