mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
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>
57 lines
1.9 KiB
C++
57 lines
1.9 KiB
C++
/*
|
|
* Copyright (C) 2019-2021 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "shared/source/command_stream/create_command_stream_impl.h"
|
|
#include "shared/source/execution_environment/execution_environment.h"
|
|
#include "shared/source/execution_environment/root_device_environment.h"
|
|
|
|
namespace NEO {
|
|
|
|
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;
|
|
}
|
|
|
|
if (returnValue) {
|
|
auto i = 0u;
|
|
while (i < executionEnvironment.rootDeviceEnvironments.size()) {
|
|
bool unsupportedDeviceDetected = false;
|
|
|
|
auto &featureTable = executionEnvironment.rootDeviceEnvironments[i]->getHardwareInfo()->featureTable;
|
|
if (!featureTable.ftrRcsNode && !featureTable.ftrCCSNode) {
|
|
unsupportedDeviceDetected = true;
|
|
}
|
|
|
|
if (unsupportedDeviceDetected) {
|
|
executionEnvironment.rootDeviceEnvironments.erase(executionEnvironment.rootDeviceEnvironments.begin() + i);
|
|
} else {
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
|
|
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
|