99// ===----------------------------------------------------------------------===//
1010
1111#include " adapter.hpp"
12+ #include " common.hpp"
1213#include " ur_level_zero.hpp"
1314#include < iomanip>
1415
@@ -162,7 +163,7 @@ ur_result_t initPlatforms(PlatformVec &platforms,
162163 ZE2UR_CALL (zeDriverGet, (&ZeDriverGetCount, ZeDriverGetHandles.data ()));
163164 }
164165 if (ZeDriverGetCount == 0 && GlobalAdapter->ZeInitDriversCount == 0 ) {
165- logger::debug (" \n No Valid L0 Drivers found.\n " );
166+ logger::error (" \n No Valid L0 Drivers found.\n " );
166167 return UR_RESULT_SUCCESS;
167168 }
168169
@@ -376,7 +377,9 @@ ur_adapter_handle_t_::ur_adapter_handle_t_()
376377 static_cast <int >(L0InitFlags));
377378 GlobalAdapter->ZeInitResult = ZE_CALL_NOCHECK (zeInit, (L0InitFlags));
378379 if (GlobalAdapter->ZeInitResult != ZE_RESULT_SUCCESS) {
379- logger::debug (" \n zeInit failed with {}\n " , GlobalAdapter->ZeInitResult );
380+ const char *ErrorString = " Unknown" ;
381+ zeParseError (GlobalAdapter->ZeInitResult , ErrorString);
382+ logger::error (" \n zeInit failed with {}\n " , ErrorString);
380383 }
381384
382385 bool useInitDrivers = false ;
@@ -422,8 +425,9 @@ ur_adapter_handle_t_::ur_adapter_handle_t_()
422425 if (GlobalAdapter->ZeInitDriversResult == ZE_RESULT_SUCCESS) {
423426 GlobalAdapter->InitDriversSupported = true ;
424427 } else {
425- logger::debug (" \n zeInitDrivers failed with {}\n " ,
426- GlobalAdapter->ZeInitDriversResult );
428+ const char *ErrorString = " Unknown" ;
429+ zeParseError (GlobalAdapter->ZeInitDriversResult , ErrorString);
430+ logger::error (" \n zeInitDrivers failed with {}\n " , ErrorString);
427431 }
428432 }
429433 }
@@ -441,6 +445,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_()
441445
442446 // Absorb the ZE_RESULT_ERROR_UNINITIALIZED and just return 0 Platforms.
443447 if (*GlobalAdapter->ZeResult == ZE_RESULT_ERROR_UNINITIALIZED) {
448+ logger::error (" Level Zero Uninitialized\n " );
444449 result = std::move (platforms);
445450 return ;
446451 }
0 commit comments