Skip to content

Commit 9402907

Browse files
authored
Enable DDI Driver Path by Default (#361)
Signed-off-by: Neil R. Spruit <[email protected]>
1 parent 7563955 commit 9402907

File tree

5 files changed

+22
-5
lines changed

5 files changed

+22
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Level zero loader changelog
2+
## v1.24.0
3+
* Enable DDI Driver Extension path by default.
24
## v1.23.2
35
* fix: Avoid invalid casting into loader objects when DDI extension is supported
46
* Fix potential SIOF issue with checker layers

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if(MSVC AND (MSVC_VERSION LESS 1900))
1313
endif()
1414

1515
# This project follows semantic versioning (https://semver.org/)
16-
project(level-zero VERSION 1.23.2)
16+
project(level-zero VERSION 1.24.0)
1717

1818
include(GNUInstallDirs)
1919

PRODUCT_GUID.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1.23.2
2-
7a2306e5-ca56-4ead-9c90-28db3a445afd
1+
1.24.0
2+
2ba535f4-fef9-45e1-9ff6-66c4e0f629ff

source/lib/ze_lib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ namespace ze_lib
397397
debug_trace_message(message, to_string(register_teardown_result));
398398
} else {
399399
loaderTeardownRegistrationEnabled = true;
400-
std::string message = "ze_lib Context Init() zelRegisterTeardownCallback completed for the static loader with";
400+
std::string message = "ze_lib Context Init() zelRegisterTeardownCallback completed for the static loader with ";
401401
debug_trace_message(message, to_string(register_teardown_result));
402402
}
403403
}

source/loader/ze_loader.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,18 @@ namespace loader
459459
loader::loaderZetDdiTable = new zet_dditable_t();
460460
loader::loaderZesDdiTable = new zes_dditable_t();
461461
debugTraceEnabled = getenv_tobool( "ZE_ENABLE_LOADER_DEBUG_TRACE" );
462-
driverDDIPathDefault = getenv_tobool( "ZE_ENABLE_LOADER_DRIVER_DDI_PATH" );
462+
// DDI Driver Extension Path is enabled by default.
463+
// This can be overridden by the environment variable ZE_ENABLE_LOADER_DRIVER_DDI_PATH.
464+
std::string ddiPathConfig = getenv_string("ZE_ENABLE_LOADER_DRIVER_DDI_PATH");
465+
if (ddiPathConfig.empty()) {
466+
driverDDIPathDefault = true;
467+
} else if (strcmp(ddiPathConfig.c_str(), "1") == 0 || strcmp(ddiPathConfig.c_str(), "true") == 0) {
468+
driverDDIPathDefault = true;
469+
} else if (strcmp(ddiPathConfig.c_str(), "0") == 0 || strcmp(ddiPathConfig.c_str(), "false") == 0) {
470+
driverDDIPathDefault = false;
471+
} else {
472+
driverDDIPathDefault = true; // fallback to the default for any other value
473+
}
463474
auto discoveredDrivers = discoverEnabledDrivers();
464475
std::string loadLibraryErrorValue;
465476

@@ -487,6 +498,10 @@ namespace loader
487498
if (debugTraceEnabled)
488499
debug_trace_message("Using Loader Library Path: ", loaderLibraryPath);
489500

501+
if (debugTraceEnabled && driverDDIPathDefault) {
502+
debug_trace_message("DDI Driver Extension Path is Enabled", "");
503+
}
504+
490505
// To allow for two different sets of drivers to be in use between sysman and core/tools, we use and store the drivers in two vectors.
491506
// alldrivers stores all the drivers for cleanup when the library exits.
492507
zeDrivers.reserve( discoveredDrivers.size() + getenv_tobool( "ZE_ENABLE_NULL_DRIVER" ) );

0 commit comments

Comments
 (0)