diff --git a/level_zero/tools/test/black_box_tests/zello_sysman.cpp b/level_zero/tools/test/black_box_tests/zello_sysman.cpp index 2bb012e9a0..b1e519c0b5 100644 --- a/level_zero/tools/test/black_box_tests/zello_sysman.cpp +++ b/level_zero/tools/test/black_box_tests/zello_sysman.cpp @@ -8,11 +8,13 @@ #include #include +#include #include #include #include #include #include +#include #if defined(_WIN32) || defined(_WIN64) #include #include @@ -100,8 +102,7 @@ inline bool isParamEnabled(int argc, char *argv[], const char *shortName, const } while (0); void usage() { - std::cout << "\n set Env variable ZES_ENABLE_SYSMAN=1" - "\n" + std::cout << "\n" "\n zello_sysman [OPTIONS]" "\n" "\n OPTIONS:" @@ -132,8 +133,7 @@ void usage() { "\n"; } -void getDeviceHandles(ze_driver_handle_t &driverHandle, std::vector &devices, int argc, char *argv[]) { - +void getDeviceHandles(ze_driver_handle_t &driverHandle, std::vector &devices) { VALIDATECALL(zeInit(ZE_INIT_FLAG_GPU_ONLY)); uint32_t driverCount = 0; @@ -156,13 +156,33 @@ void getDeviceHandles(ze_driver_handle_t &driverHandle, std::vector devices; ze_driver_handle_t driver; - if (!validateGetenv("ZES_ENABLE_SYSMAN")) { - std::cout << "setting environment variable ZES_ENABLE_SYSMAN=1" << std::endl; - if (enableSysman() != 0) { - std::cout << "Must set environment variable ZES_ENABLE_SYSMAN=1" << std::endl; - exit(0); + if (validateGetenv("ZELLO_SYSMAN_USE_ZESINIT")) { + if (validateGetenv("ZES_ENABLE_SYSMAN")) { + std::cout << "ZES_ENABLE_SYSMAN environment variable Set" << std::endl; } + + else { + std::cout << "ZES_ENABLE_SYSMAN environment variable Not Set" << std::endl; + } + getSysmanDeviceHandles(driver, devices); + std::cout << "Sysman Initialization done via zesInit" << std::endl; + } + + else { + if (validateGetenv("ZES_ENABLE_SYSMAN")) { + std::cout << "ZES_ENABLE_SYSMAN environment variable Set" << std::endl; + } + + else { + std::cout << "ZES_ENABLE_SYSMAN environment variable Not Set" << std::endl; + std::cout << "Setting the environment variable ZES_ENABLE_SYSMAN " << std::endl; + if (enableSysman()) { + return 0; + } + std::cout << "ZES_ENABLE_SYSMAN environment variable Set" << std::endl; + } + getDeviceHandles(driver, devices); + std::cout << "Sysman Initialization done via zeInit" << std::endl; } - getDeviceHandles(driver, devices, argc, argv); bool force = false; bool pFactorIsSet = true;