@@ -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