From 9b6873607440ffdaabe9c20bb0a87373d73adab9 Mon Sep 17 00:00:00 2001 From: Brandon Yates Date: Fri, 13 Sep 2024 19:34:05 +0000 Subject: [PATCH] fix: Fix check for sysfs entry at debugger init time Related-to: NEO-12656 Signed-off-by: Brandon Yates --- shared/source/device/device.cpp | 1 + shared/source/dll/linux/debugger_l0_dll_linux.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index 9b9cb793a9..59651cad28 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -264,6 +264,7 @@ void Device::initializeCommonResources() { if (rootDeviceEnvironment->debugger == nullptr) { NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Debug mode is not enabled in the system.\n"); + getExecutionEnvironment()->setDebuggingMode(DebuggingMode::disabled); } } diff --git a/shared/source/dll/linux/debugger_l0_dll_linux.cpp b/shared/source/dll/linux/debugger_l0_dll_linux.cpp index 7a395ba9b9..b662d2e616 100644 --- a/shared/source/dll/linux/debugger_l0_dll_linux.cpp +++ b/shared/source/dll/linux/debugger_l0_dll_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,6 +18,11 @@ std::unique_ptr DebuggerL0::create(NEO::Device *device) { if (!hwInfo.capabilityTable.l0DebuggerSupported) { return nullptr; } + auto osInterface = device->getRootDeviceEnvironment().osInterface.get(); + if (!osInterface || !osInterface->isDebugAttachAvailable()) { + return nullptr; + } + auto success = initDebuggingInOs(device->getRootDeviceEnvironment().osInterface.get()); if (success) { auto debugger = debuggerL0Factory[device->getHardwareInfo().platform.eRenderCoreFamily](device);