Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix layer init with multiple drivers, perform driver check before init #163

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions source/lib/ze_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ namespace ze_lib
ze_lib::context->zesDdiTable.exchange(&ze_lib::context->initialzesDdiTable);
}


// Check which drivers and layers are functional by checking which can be loaded.
// This check needs to be done before all inits to avoid overwriting the layer ddi table pointers.
if( ZE_RESULT_SUCCESS == result && !sysmanOnly)
{
//Check which drivers support the ze_driver_flag_t specified
//No need to check if only initializing sysman
result = zelLoaderDriverCheck(flags);
}

if( ZE_RESULT_SUCCESS == result )
{
result = zeInit();
Expand All @@ -99,13 +109,6 @@ namespace ze_lib
result = zelLoaderTracingLayerInit(this->pTracingZeDdiTable, this->pTracingZetDdiTable, this->pTracingZesDdiTable);
}

if( ZE_RESULT_SUCCESS == result && !sysmanOnly)
{
//Check which drivers support the ze_driver_flag_t specified
//No need to check if only initializing sysman
result = zelLoaderDriverCheck(flags);
}

if( ZE_RESULT_SUCCESS == result )
{
isInitialized = true;
Expand Down
Loading