zesSysmanDeviceReset: Reinitialize device after device reset

Before performing gpu device reset, first all level zero resources
and gpu device specific resources have to be cleaned up. Also as
after device reset, state of gpu device would be lost.
Hence after performing gpu device reset, level zero device have
to be reinitialized by querying gpu device again.
This change is aimed at reinitializing the level zero resources
after gpu device reset, so that user could continue using level zero
devices after device reset.

Related-To: LOCI-2627

Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
This commit is contained in:
Jitendra Sharma
2021-10-11 15:34:03 +00:00
committed by Compute-Runtime-Automation
parent 06eaef0352
commit 1186c1aae3
26 changed files with 373 additions and 44 deletions

View File

@@ -11,8 +11,13 @@
namespace NEO {
bool prepareDeviceEnvironments(ExecutionEnvironment &executionEnvironment) {
auto returnValue = prepareDeviceEnvironmentsImpl(executionEnvironment);
bool prepareDeviceEnvironments(ExecutionEnvironment &executionEnvironment, std::string &osPciPath, const uint32_t rootDeviceIndex) {
bool returnValue = false;
if (osPciPath.empty()) {
returnValue = prepareDeviceEnvironmentsImpl(executionEnvironment);
} else {
returnValue = prepareDeviceEnvironmentImpl(executionEnvironment, osPciPath, rootDeviceIndex);
}
if (DebugManager.flags.Force32BitDriverSupport.get() != -1) {
return returnValue;
@@ -39,4 +44,13 @@ bool prepareDeviceEnvironments(ExecutionEnvironment &executionEnvironment) {
return returnValue && executionEnvironment.rootDeviceEnvironments.size() > 0;
}
bool prepareDeviceEnvironments(ExecutionEnvironment &executionEnvironment) {
std::string path = "";
return prepareDeviceEnvironments(executionEnvironment, path, 0u);
}
bool prepareDeviceEnvironment(ExecutionEnvironment &executionEnvironment, std::string &osPciPath, const uint32_t rootDeviceIndex) {
return prepareDeviceEnvironments(executionEnvironment, osPciPath, rootDeviceIndex);
}
} // namespace NEO