fix: ignore ZET_ENABLE_PROGRAM_DEBUGGING when system misconfigured

- if debug not enabled in the system, ignore env var for enabling
debugging

Resolves: NEO-10370

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2024-02-16 13:33:15 +00:00
committed by Compute-Runtime-Automation
parent f56babb2a9
commit d9b662a735
3 changed files with 36 additions and 13 deletions

View File

@@ -231,6 +231,13 @@ ze_result_t DriverHandleImp::initialize(std::vector<std::unique_ptr<NEO::Device>
const auto rootDeviceIndex = neoDevice->getRootDeviceIndex();
auto osInterface = neoDevice->getRootDeviceEnvironment().osInterface.get();
if (osInterface && !osInterface->isDebugAttachAvailable() && enableProgramDebugging != NEO::DebuggingMode::disabled) {
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr,
"Debug mode is not enabled in the system.\n");
enableProgramDebugging = NEO::DebuggingMode::disabled;
}
enableRootDeviceDebugger(neoDevice);
this->rootDeviceIndices.pushUnique(rootDeviceIndex);
@@ -242,13 +249,6 @@ ze_result_t DriverHandleImp::initialize(std::vector<std::unique_ptr<NEO::Device>
auto device = Device::create(this, pNeoDevice, false, &returnValue);
this->devices.push_back(device);
auto osInterface = device->getNEODevice()->getRootDeviceEnvironment().osInterface.get();
if (osInterface && !osInterface->isDebugAttachAvailable() && enableProgramDebugging != NEO::DebuggingMode::disabled) {
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr,
"Debug mode is not enabled in the system.\n");
return ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE;
}
multiOsContextDriver |= device->isImplicitScalingCapable();
if (returnValue != ZE_RESULT_SUCCESS) {
return returnValue;