Introduce Online, Offline, Disabled DebuggingModes

This change allows to set DebuggingMode via
ZET_ENABLE_PROGRAM_DEBUGGING env var
0: Disabled
1: Online
2: Offline

Related-To: NEO-7630
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
This commit is contained in:
Fabian Zwolinski
2023-03-16 12:03:21 +00:00
committed by Compute-Runtime-Automation
parent 9b35ba5e50
commit 65c73a690f
25 changed files with 245 additions and 78 deletions

View File

@@ -49,10 +49,9 @@ void DriverImp::initialize(ze_result_t *result) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
UNRECOVERABLE_IF(nullptr == executionEnvironment);
if (envVariables.programDebugging) {
if (!NEO::DebugManager.flags.ExperimentalEnableL0DebuggerForOpenCL.get()) {
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
}
if (!NEO::DebugManager.flags.ExperimentalEnableL0DebuggerForOpenCL.get()) {
const auto dbgMode = NEO::getDebuggingMode(envVariables.programDebugging);
executionEnvironment->setDebuggingMode(dbgMode);
}
if (envVariables.fp64Emulation) {

View File

@@ -48,7 +48,7 @@ void AUBFixtureL0::setUp(const NEO::HardwareInfo *hardwareInfo, bool debuggingEn
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
if (debuggingEnabled) {
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
}
neoDevice = NEO::MockDevice::createWithExecutionEnvironment<NEO::MockDevice>(&hwInfo, executionEnvironment, 0u);
@@ -74,7 +74,7 @@ void AUBFixtureL0::setUp(const NEO::HardwareInfo *hardwareInfo, bool debuggingEn
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
driverHandle = std::make_unique<ult::Mock<DriverHandleImp>>();
driverHandle->enableProgramDebugging = debuggingEnabled ? NEO::DebuggingMode::Enabled : NEO::DebuggingMode::Disabled;
driverHandle->enableProgramDebugging = debuggingEnabled ? NEO::DebuggingMode::Online : NEO::DebuggingMode::Disabled;
driverHandle->initialize(std::move(devices));

View File

@@ -49,7 +49,7 @@ struct ActiveDebuggerFixture {
debugger = new MockActiveSourceLevelDebugger(new MockOsLibrary);
executionEnvironment->rootDeviceEnvironments[0]->debugger.reset(debugger);
executionEnvironment->initializeMemoryManager();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
device = NEO::MockDevice::create<NEO::MockDevice>(executionEnvironment, 0u);
device->setDebuggerActive(true);

View File

@@ -30,7 +30,7 @@ struct L0DebuggerFixture {
executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns);
memoryOperationsHandler = new NEO::MockMemoryOperations();
executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface.reset(memoryOperationsHandler);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
hwInfo = *executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo();
@@ -50,7 +50,7 @@ struct L0DebuggerFixture {
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Online;
driverHandle->initialize(std::move(devices));
device = driverHandle->devices[0];

View File

@@ -36,7 +36,7 @@ struct L0DebuggerLinuxFixture {
auto executionEnvironment = new NEO::ExecutionEnvironment();
auto mockBuiltIns = new NEO::MockBuiltins();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(hwInfo ? hwInfo : defaultHwInfo.get());
executionEnvironment->initializeMemoryManager();
@@ -50,7 +50,7 @@ struct L0DebuggerLinuxFixture {
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Online;
driverHandle->initialize(std::move(devices));
device = driverHandle->devices[0];
@@ -122,7 +122,7 @@ TEST_F(L0DebuggerLinuxTest, givenLinuxOSWhenL0DebuggerIsCreatedAddressModeIsNotS
TEST(L0DebuggerLinux, givenVmBindAndPerContextVmEnabledInDrmWhenInitializingDebuggingInOsThenRegisterResourceClassesIsCalled) {
auto executionEnvironment = std::make_unique<NEO::MockExecutionEnvironment>();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->initializeMemoryManager();
auto osInterface = new OSInterface();
auto drmMock = new DrmMockResources(*executionEnvironment->rootDeviceEnvironments[0]);
@@ -141,7 +141,7 @@ TEST(L0DebuggerLinux, givenVmBindAndPerContextVmEnabledInDrmWhenInitializingDebu
TEST(L0DebuggerLinux, givenVmBindNotAvailableInDrmWhenInitializingDebuggingInOsThenRegisterResourceClassesIsNotCalled) {
auto executionEnvironment = std::make_unique<NEO::MockExecutionEnvironment>();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->initializeMemoryManager();
auto osInterface = new OSInterface();
auto drmMock = new DrmMockResources(*executionEnvironment->rootDeviceEnvironments[0]);
@@ -160,7 +160,7 @@ TEST(L0DebuggerLinux, givenVmBindNotAvailableInDrmWhenInitializingDebuggingInOsT
TEST(L0DebuggerLinux, givenPerContextVmNotEnabledWhenInitializingDebuggingInOsThenRegisterResourceClassesIsNotCalled) {
auto executionEnvironment = std::make_unique<NEO::MockExecutionEnvironment>();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->initializeMemoryManager();
auto osInterface = new OSInterface();
auto drmMock = new DrmMockResources(*executionEnvironment->rootDeviceEnvironments[0]);
@@ -311,7 +311,7 @@ HWTEST_F(L0DebuggerLinuxTest, givenDebuggingEnabledWhenCommandQueuesAreCreatedAn
HWTEST_F(L0DebuggerLinuxTest, givenDebuggingEnabledAndDebugAttachAvailableWhenInitializingDriverThenSuccessIsReturned) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->initializeMemoryManager();
auto osInterface = new OSInterface();
@@ -324,7 +324,7 @@ HWTEST_F(L0DebuggerLinuxTest, givenDebuggingEnabledAndDebugAttachAvailableWhenIn
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
auto driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Online;
drmMock->allowDebugAttach = true;
@@ -335,7 +335,7 @@ HWTEST_F(L0DebuggerLinuxTest, givenDebuggingEnabledAndDebugAttachAvailableWhenIn
HWTEST_F(L0DebuggerLinuxTest, givenDebuggingEnabledAndDebugAttachNotAvailableWhenInitializingDriverThenErrorIsReturned) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->initializeMemoryManager();
auto osInterface = new OSInterface();
@@ -348,7 +348,7 @@ HWTEST_F(L0DebuggerLinuxTest, givenDebuggingEnabledAndDebugAttachNotAvailableWhe
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
auto driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Online;
drmMock->allowDebugAttach = false;
@@ -461,7 +461,7 @@ HWTEST_F(L0DebuggerLinuxMultitileTest, givenSubDeviceFilteredByAffinityMaskWhenC
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->parseAffinityMask();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
executionEnvironment->initializeMemoryManager();
@@ -475,7 +475,7 @@ HWTEST_F(L0DebuggerLinuxMultitileTest, givenSubDeviceFilteredByAffinityMaskWhenC
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
auto driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Online;
driverHandle->initialize(std::move(devices));
auto device = driverHandle->devices[0];

View File

@@ -74,12 +74,12 @@ TEST_F(L0DebuggerTest, givenL0DebuggerWhenGettingStateSaveAreaHeaderThenValidSip
}
TEST_F(L0DebuggerTest, givenProgramDebuggingEnabledWhenDebuggerIsCreatedThenFusedEusAreDisabled) {
EXPECT_TRUE(driverHandle->enableProgramDebugging == NEO::DebuggingMode::Enabled);
EXPECT_TRUE(driverHandle->enableProgramDebugging == NEO::DebuggingMode::Online);
EXPECT_FALSE(neoDevice->getHardwareInfo().capabilityTable.fusedEuEnabled);
}
TEST_F(L0DebuggerTest, givenProgramDebuggingEnabledWhenDebuggerIsCreatedThenCompressionIsDisabled) {
EXPECT_TRUE(driverHandle->enableProgramDebugging == NEO::DebuggingMode::Enabled);
EXPECT_TRUE(driverHandle->enableProgramDebugging == NEO::DebuggingMode::Online);
EXPECT_FALSE(neoDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedBuffers);
EXPECT_FALSE(neoDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedImages);
}

View File

@@ -437,7 +437,7 @@ HWTEST_F(ModuleWithDebuggerL0MultiTileTest, GivenSubDeviceWhenCreatingModuleThen
auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions();
neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip);
neoDevice->getExecutionEnvironment()->setDebuggingMode(NEO::DebuggingMode::Enabled);
neoDevice->getExecutionEnvironment()->setDebuggingMode(NEO::DebuggingMode::Online);
neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->initDebuggerL0(neoDevice);
auto memoryOperationsHandler = new NEO::MockMemoryOperations();
neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->memoryOperationsInterface.reset(memoryOperationsHandler);

View File

@@ -295,14 +295,14 @@ TEST(Debugger, GivenLegacyDebuggerAndProgramDebuggingEnabledWhenInitializingDriv
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
executionEnvironment->initializeMemoryManager();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
auto neoDevice = NEO::MockDevice::create<NEO::MockDevice>(executionEnvironment, 0u);
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
auto driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Online;
EXPECT_THROW(driverHandle->initialize(std::move(devices)), std::exception);
std::string output = testing::internal::GetCapturedStderr();

View File

@@ -35,7 +35,7 @@ struct L0DebuggerWindowsFixture {
void setUp() {
executionEnvironment = new NEO::ExecutionEnvironment;
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get();
auto osEnvironment = new OsEnvironmentWin();
gdi = new MockGdi();
@@ -56,7 +56,7 @@ struct L0DebuggerWindowsFixture {
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Online;
driverHandle->initialize(std::move(devices));
device = driverHandle->devices[0];
@@ -198,7 +198,7 @@ TEST_F(L0DebuggerWindowsTest, givenDebuggerL0NotifyModuleDestroyCalledAndModuleD
TEST_F(L0DebuggerWindowsTest, givenProgramDebuggingEnabledAndDebugAttachAvailableWhenInitializingDriverThenSuccessIsReturned) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
auto hwInfo = *NEO::defaultHwInfo.get();
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
@@ -218,7 +218,7 @@ TEST_F(L0DebuggerWindowsTest, givenProgramDebuggingEnabledAndDebugAttachAvailabl
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
auto driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Online;
wddm->debugAttachAvailable = true;
ze_result_t result = driverHandle->initialize(std::move(devices));
@@ -228,7 +228,7 @@ TEST_F(L0DebuggerWindowsTest, givenProgramDebuggingEnabledAndDebugAttachAvailabl
TEST_F(L0DebuggerWindowsTest, givenProgramDebuggingEnabledAndDebugAttachNotAvailableWhenInitializingDriverThenErrorIsReturned) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
auto hwInfo = *NEO::defaultHwInfo.get();
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
@@ -248,7 +248,7 @@ TEST_F(L0DebuggerWindowsTest, givenProgramDebuggingEnabledAndDebugAttachNotAvail
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
auto driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Online;
wddm->debugAttachAvailable = false;
ze_result_t result = driverHandle->initialize(std::move(devices));

View File

@@ -211,7 +211,7 @@ TEST(L0DeviceTest, givenDebuggerEnabledButIGCNotReturnsSSAHThenSSAHIsNotCopied)
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
auto driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Online;
driverHandle->initialize(std::move(devices));
auto sipType = SipKernel::getSipKernelType(*neoDevice);

View File

@@ -419,6 +419,28 @@ TEST(DriverImpTest, givenEnabledProgramDebuggingWhenCreatingExecutionEnvironment
L0::GlobalDriver = nullptr;
}
TEST(DriverImpTest, givenEnableProgramDebuggingWithValue2WhenCreatingExecutionEnvironmentThenDebuggingEnabledIsTrue) {
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
hwInfo.capabilityTable.levelZeroSupported = true;
VariableBackup<uint32_t> mockGetenvCalledBackup(&IoFunctions::mockGetenvCalled, 0);
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZET_ENABLE_PROGRAM_DEBUGGING", "2"}};
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
ze_result_t result = ZE_RESULT_ERROR_UNINITIALIZED;
DriverImp driverImp;
driverImp.initialize(&result);
ASSERT_NE(nullptr, L0::GlobalDriver);
ASSERT_NE(0u, L0::GlobalDriver->numDevices);
EXPECT_TRUE(L0::GlobalDriver->devices[0]->getNEODevice()->getExecutionEnvironment()->isDebuggingEnabled());
delete L0::GlobalDriver;
L0::GlobalDriverHandle = nullptr;
L0::GlobalDriver = nullptr;
}
TEST(DriverImpTest, givenEnabledFP64EmulationWhenCreatingExecutionEnvironmentThenFP64EmulationIsEnabled) {
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
@@ -465,6 +487,30 @@ TEST(DriverImpTest, givenEnabledProgramDebuggingAndEnabledExperimentalOpenCLWhen
delete L0::GlobalDriver;
}
TEST(DriverImpTest, givenEnableProgramDebuggingWithValue2AndEnabledExperimentalOpenCLWhenCreatingExecutionEnvironmentThenDebuggingEnabledIsFalse) {
DebugManagerStateRestore restorer;
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
hwInfo.capabilityTable.levelZeroSupported = true;
NEO::DebugManager.flags.ExperimentalEnableL0DebuggerForOpenCL.set(true);
VariableBackup<uint32_t> mockGetenvCalledBackup(&IoFunctions::mockGetenvCalled, 0);
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZET_ENABLE_PROGRAM_DEBUGGING", "2"}};
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
VariableBackup<decltype(L0::GlobalDriverHandle)> mockableDriverHandle(&L0::GlobalDriverHandle);
VariableBackup<decltype(L0::GlobalDriver)> mockableDriver(&L0::GlobalDriver);
ze_result_t result = ZE_RESULT_ERROR_UNINITIALIZED;
DriverImp driverImp;
driverImp.initialize(&result);
ASSERT_NE(nullptr, L0::GlobalDriver);
ASSERT_NE(0u, L0::GlobalDriver->numDevices);
EXPECT_FALSE(L0::GlobalDriver->devices[0]->getNEODevice()->getExecutionEnvironment()->isDebuggingEnabled());
delete L0::GlobalDriver;
}
TEST(DriverImpTest, givenNoProgramDebuggingEnvVarWhenCreatingExecutionEnvironmentThenDebuggingEnabledIsFalse) {
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
@@ -483,7 +529,7 @@ TEST(DriverImpTest, givenNoProgramDebuggingEnvVarWhenCreatingExecutionEnvironmen
L0::GlobalDriver = nullptr;
}
TEST(DriverTest, givenProgramDebuggingEnvVarNonZeroWhenCreatingDriverThenEnableProgramDebuggingIsSetTrue) {
TEST(DriverTest, givenProgramDebuggingEnvVarValue1WhenCreatingDriverThenEnableProgramDebuggingIsSetToTrue) {
ze_result_t returnValue;
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
@@ -494,12 +540,34 @@ TEST(DriverTest, givenProgramDebuggingEnvVarNonZeroWhenCreatingDriverThenEnableP
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
L0EnvVariables envVariables = {};
envVariables.programDebugging = true;
envVariables.programDebugging = 1;
auto driverHandle = whiteboxCast(DriverHandle::create(std::move(devices), envVariables, &returnValue));
EXPECT_NE(nullptr, driverHandle);
EXPECT_TRUE(driverHandle->enableProgramDebugging == NEO::DebuggingMode::Enabled);
EXPECT_TRUE(driverHandle->enableProgramDebugging == NEO::DebuggingMode::Online);
delete driverHandle;
L0::GlobalDriver = nullptr;
}
TEST(DriverTest, givenProgramDebuggingEnvVarValue2WhenCreatingDriverThenEnableProgramDebuggingIsSetToTrue) {
ze_result_t returnValue;
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
hwInfo.capabilityTable.levelZeroSupported = true;
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
L0EnvVariables envVariables = {};
envVariables.programDebugging = 2;
auto driverHandle = whiteboxCast(DriverHandle::create(std::move(devices), envVariables, &returnValue));
EXPECT_NE(nullptr, driverHandle);
EXPECT_TRUE(driverHandle->enableProgramDebugging == NEO::DebuggingMode::Offline);
delete driverHandle;
L0::GlobalDriver = nullptr;
@@ -527,6 +595,28 @@ TEST(DriverTest, givenInvalidCompilerEnvironmentThenDependencyUnavailableErrorIs
ASSERT_EQ(nullptr, L0::GlobalDriver);
}
TEST(DriverTest, givenInvalidCompilerEnvironmentAndEnableProgramDebuggingWithValue2ThenDependencyUnavailableErrorIsReturned) {
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
hwInfo.capabilityTable.levelZeroSupported = true;
VariableBackup<uint32_t> mockGetenvCalledBackup(&IoFunctions::mockGetenvCalled, 0);
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZET_ENABLE_PROGRAM_DEBUGGING", "2"}};
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
ze_result_t result = ZE_RESULT_ERROR_UNINITIALIZED;
DriverImp driverImp;
auto oldFclDllName = Os::frontEndDllName;
auto oldIgcDllName = Os::igcDllName;
Os::frontEndDllName = "_invalidFCL";
Os::igcDllName = "_invalidIGC";
driverImp.initialize(&result);
EXPECT_EQ(result, ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE);
Os::igcDllName = oldIgcDllName;
Os::frontEndDllName = oldFclDllName;
ASSERT_EQ(nullptr, L0::GlobalDriver);
}
struct DriverTestMultipleFamilySupport : public ::testing::Test {
void SetUp() override {

View File

@@ -89,10 +89,9 @@ cl_int CL_API_CALL clGetPlatformIDs(cl_uint numEntries,
NEO::EnvironmentVariableReader envReader;
if (NEO::DebugManager.flags.ExperimentalEnableL0DebuggerForOpenCL.get()) {
auto programDebugging = envReader.getSetting("ZET_ENABLE_PROGRAM_DEBUGGING", 0);
if (programDebugging != 0) {
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
}
const auto programDebugging = envReader.getSetting("ZET_ENABLE_PROGRAM_DEBUGGING", 0);
const auto dbgMode = NEO::getDebuggingMode(programDebugging);
executionEnvironment->setDebuggingMode(dbgMode);
}
if (envReader.getSetting("NEO_FP64_EMULATION", false)) {
executionEnvironment->setFP64EmulationEnabled();

View File

@@ -155,7 +155,32 @@ TEST(clGetPlatformIDsTest, givenEnabledExperimentalSupportAndEnabledProgramDebug
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, platformsImpl);
auto executionEnvironment = platform()->peekExecutionEnvironment();
EXPECT_TRUE(executionEnvironment->isDebuggingEnabled());
platformsImpl->clear();
}
TEST(clGetPlatformIDsTest, givenEnabledExperimentalSupportAndEnableProgramDebuggingWithValue2WhenGettingPlatformIdsThenDebuggingEnabledIsSetInExecutionEnvironment) {
DebugManagerStateRestore stateRestore;
NEO::DebugManager.flags.ExperimentalEnableL0DebuggerForOpenCL.set(1);
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
hwInfo.capabilityTable.levelZeroSupported = true;
VariableBackup<uint32_t> mockGetenvCalledBackup(&IoFunctions::mockGetenvCalled, 0);
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZET_ENABLE_PROGRAM_DEBUGGING", "2"}};
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
cl_int retVal = CL_SUCCESS;
cl_platform_id platformRet = nullptr;
cl_uint numPlatforms = 0;
platformsImpl->clear();
retVal = clGetPlatformIDs(1, &platformRet, &numPlatforms);
EXPECT_EQ(CL_SUCCESS, retVal);
auto executionEnvironment = platform()->peekExecutionEnvironment();
EXPECT_TRUE(executionEnvironment->isDebuggingEnabled());
@@ -182,7 +207,32 @@ TEST(clGetPlatformIDsTest, givenNoExperimentalSupportAndEnabledProgramDebuggingW
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, platformsImpl);
auto executionEnvironment = platform()->peekExecutionEnvironment();
EXPECT_FALSE(executionEnvironment->isDebuggingEnabled());
platformsImpl->clear();
}
TEST(clGetPlatformIDsTest, givenNoExperimentalSupportAndEnableProgramDebuggingWithValue2WhenGettingPlatformIdsThenDebuggingEnabledIsNotSetInExecutionEnvironment) {
DebugManagerStateRestore stateRestore;
NEO::DebugManager.flags.ExperimentalEnableL0DebuggerForOpenCL.set(0);
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
hwInfo.capabilityTable.levelZeroSupported = true;
VariableBackup<uint32_t> mockGetenvCalledBackup(&IoFunctions::mockGetenvCalled, 0);
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZET_ENABLE_PROGRAM_DEBUGGING", "2"}};
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
cl_int retVal = CL_SUCCESS;
cl_platform_id platformRet = nullptr;
cl_uint numPlatforms = 0;
platformsImpl->clear();
retVal = clGetPlatformIDs(1, &platformRet, &numPlatforms);
EXPECT_EQ(CL_SUCCESS, retVal);
auto executionEnvironment = platform()->peekExecutionEnvironment();
EXPECT_FALSE(executionEnvironment->isDebuggingEnabled());
@@ -209,7 +259,6 @@ TEST(clGetPlatformIDsTest, givenEnabledExperimentalSupportAndZeroProgramDebuggin
EXPECT_EQ(CL_SUCCESS, retVal);
ASSERT_NE(nullptr, platformsImpl);
auto executionEnvironment = platform()->peekExecutionEnvironment();
EXPECT_FALSE(executionEnvironment->isDebuggingEnabled());

View File

@@ -30,7 +30,7 @@ struct DebuggerClFixture
void setUp() {
hardwareInfo = *NEO::defaultHwInfo.get();
auto executionEnvironment = MockClDevice::prepareExecutionEnvironment(&hardwareInfo, rootDeviceIndex);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
device = MockDevice::createWithExecutionEnvironment<MockDevice>(&hardwareInfo, executionEnvironment, rootDeviceIndex);
ASSERT_NE(nullptr, device);
clExecutionEnvironment = static_cast<MockClExecutionEnvironment *>(device->getExecutionEnvironment());

View File

@@ -723,7 +723,7 @@ TEST_F(DrmTests, givenDebuggingEnabledWhenDrmIsCreatedThenPerContextVMIsTrueGetV
DebugManager.flags.CreateMultipleSubDevices.set(2);
DebugManager.flags.UseVmBind.set(1);
rootDeviceEnvironment->executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
rootDeviceEnvironment->executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
auto drm = DrmWrap::createDrm(*rootDeviceEnvironment);
ASSERT_NE(drm, nullptr);
@@ -748,7 +748,7 @@ TEST_F(DrmTests, givenEnabledDebuggingAndVmBindNotAvailableWhenDrmIsCreatedThenP
DebugManager.flags.UseVmBind.set(0);
DebugManager.flags.PrintDebugMessages.set(true);
rootDeviceEnvironment->executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
rootDeviceEnvironment->executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
auto drm = DrmWrap::createDrm(*rootDeviceEnvironment);
EXPECT_NE(drm, nullptr);

View File

@@ -443,7 +443,7 @@ TEST(PlatformInitTest, givenSingleDeviceWithNonZeroRootDeviceIndexInPassedDevice
TEST(PlatformInitTest, GivenDebuggingEnabledWhenPlatformIsInitializedThenL0DebuggerIsCreated) {
std::vector<std::unique_ptr<Device>> devices;
auto executionEnvironment = new MockExecutionEnvironment(defaultHwInfo.get(), false, 1);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
devices.push_back(std::make_unique<MockDevice>(executionEnvironment, 0));
auto status = platform()->initialize(std::move(devices));
EXPECT_TRUE(status);

View File

@@ -46,8 +46,24 @@ class Debugger {
enum class DebuggingMode : uint32_t {
Disabled,
Enabled
Online,
Offline
};
inline DebuggingMode getDebuggingMode(uint32_t programDebugging) {
switch (programDebugging) {
case 1: {
return DebuggingMode::Online;
}
case 2: {
return DebuggingMode::Offline;
}
case 0:
default: {
return DebuggingMode::Disabled;
}
}
}
static_assert(std::is_standard_layout<Debugger::SbaAddresses>::value);
} // namespace NEO

View File

@@ -28,7 +28,7 @@ struct L0DebuggerSharedLinuxFixture {
void setUp(HardwareInfo *hwInfo) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(hwInfo ? hwInfo : defaultHwInfo.get());
executionEnvironment->initializeMemoryManager();
auto osInterface = new OSInterface();

View File

@@ -30,7 +30,7 @@ using namespace NEO;
TEST(Debugger, givenL0DebuggerWhenGettingL0DebuggerThenCorrectObjectIsReturned) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
auto hwInfo = *NEO::defaultHwInfo.get();
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
@@ -49,7 +49,7 @@ TEST(Debugger, givenL0DebuggerWhenGettingL0DebuggerThenCorrectObjectIsReturned)
TEST(Debugger, givenSourceLevelDebuggerWhenGettingL0DebuggerThenNullptrIsReturned) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
auto hwInfo = *NEO::defaultHwInfo.get();
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
@@ -103,7 +103,7 @@ TEST(Debugger, givenL0DebuggerOFFWhenGettingStateSaveAreaHeaderThenValidSipTypeI
TEST(Debugger, givenDebuggingEnabledInExecEnvWhenAllocatingIsaThenSingleBankIsUsed) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
auto hwInfo = *NEO::defaultHwInfo.get();
hwInfo.featureTable.flags.ftrLocalMemory = true;
@@ -131,7 +131,7 @@ TEST(Debugger, givenTileAttachAndDebuggingEnabledInExecEnvWhenAllocatingIsaThenM
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
auto hwInfo = *NEO::defaultHwInfo.get();
hwInfo.featureTable.flags.ftrLocalMemory = true;
@@ -163,7 +163,7 @@ TEST(Debugger, WhenInitializingDebuggerL0ThenCapabilitiesAreAdjustedAndDebuggerI
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
executionEnvironment->initializeMemoryManager();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
auto neoDevice = std::unique_ptr<MockDevice>(MockDevice::create<MockDevice>(executionEnvironment, 0u));
@@ -194,7 +194,7 @@ TEST(Debugger, GivenLegacyDebuggerWhenInitializingDebuggerL0ThenAbortIsCalledAft
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
executionEnvironment->initializeMemoryManager();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
auto neoDevice = std::unique_ptr<MockDevice>(MockDevice::create<MockDevice>(executionEnvironment, 0u));
@@ -312,6 +312,20 @@ HWTEST_F(L0DebuggerTest, givenUseBindlessDebugSipZeroWhenModuleHeapDebugAreaIsCr
EXPECT_EQ(1u, header->reserved1);
}
HWTEST_F(L0DebuggerTest, givenProgramDebuggingWhenGettingDebuggingModeThenCorrectModeIsReturned) {
DebuggingMode mode = NEO::getDebuggingMode(0);
EXPECT_TRUE(DebuggingMode::Disabled == mode);
mode = NEO::getDebuggingMode(1);
EXPECT_TRUE(DebuggingMode::Online == mode);
mode = NEO::getDebuggingMode(2);
EXPECT_TRUE(DebuggingMode::Offline == mode);
mode = NEO::getDebuggingMode(3);
EXPECT_TRUE(DebuggingMode::Disabled == mode);
}
TEST(Debugger, givenNonLegacyDebuggerWhenInitializingDeviceCapsThenUnrecoverableIsCalled) {
class MockDebugger : public NEO::Debugger {
public:

View File

@@ -367,7 +367,7 @@ TEST_F(DrmBufferObjectTest, givenDeleterWhenBufferObjectIsCreatedAndDeletedThenC
TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoCreatedThenBindInfoIsInitializedToOsContextCount) {
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
device->getRootDeviceEnvironment().executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
device->getRootDeviceEnvironment().executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
device->getExecutionEnvironment()->calculateMaxOsContextCount();
DrmMock drm(*(device->getExecutionEnvironment()->rootDeviceEnvironments[0].get()));
EXPECT_TRUE(drm.isPerContextVMRequired());
@@ -385,7 +385,7 @@ TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoCreatedThenBindInfoIsInitia
TEST(DrmBufferObject, givenDrmIoctlReturnsErrorNotSupportedThenBufferObjectReturnsError) {
auto executionEnvironment = new ExecutionEnvironment;
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -412,7 +412,7 @@ TEST(DrmBufferObject, givenDrmIoctlReturnsErrorNotSupportedThenBufferObjectRetur
TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoBoundAndUnboundThenCorrectBindInfoIsUpdated) {
auto executionEnvironment = new ExecutionEnvironment;
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -455,7 +455,7 @@ TEST(DrmBufferObject, givenPrintBOBindingResultWhenBOBindAndUnbindSucceedsThenPr
DebugManager.flags.PrintBOBindingResult.set(true);
auto executionEnvironment = new ExecutionEnvironment;
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -508,7 +508,7 @@ TEST(DrmBufferObject, givenPrintBOBindingResultWhenBOBindAndUnbindFailsThenPrint
DebugManager.flags.PrintBOBindingResult.set(true);
auto executionEnvironment = new ExecutionEnvironment;
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();

View File

@@ -194,7 +194,7 @@ TEST_F(DrmDebugPrelimTest, GivenDrmWhenRegisteringElfResourceWithoutDataThenRegi
TEST(DrmPrelimTest, givenContextDebugAvailableWhenCheckedForSupportThenTrueIsReturned) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -218,7 +218,7 @@ TEST(DrmPrelimTest, givenContextDebugAvailableWhenCheckedForSupportThenTrueIsRet
TEST(DrmPrelimTest, givenContextDebugNotAvailableWhenCheckedForSupportThenTrueIsReturned) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -314,7 +314,7 @@ HWTEST_F(DrmDebugPrelimTest, givenAddedBindExtHandlesInBoWhenUnbindingThenExtens
TEST(DrmPrelimTest, givenProgramDebuggingAndContextDebugAvailableAndCCSEnginesWhenCreatingContextThenDebugFlagSipParamIsSet) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -336,7 +336,7 @@ TEST(DrmPrelimTest, givenProgramDebuggingAndContextDebugAvailableAndCCSEnginesWh
TEST(DrmPrelimTest, givenProgramDebuggingAndContextDebugAvailableAndCCSEnginesWhenCreatingContextThenContextRunaloneIsSetOnlyIfCCSEnginesArePresent) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();

View File

@@ -312,7 +312,7 @@ TEST(DrmBufferObjectTestPrelim, givenDebuggingEnabledWithoutDisableScratchPagesF
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
uint32_t vmId = 0;
drm.createDrmVirtualMemory(vmId);
@@ -327,7 +327,7 @@ TEST(DrmBufferObjectTestPrelim, givenDisableScratchPagesAndDebuggingEnabledWhenC
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
uint32_t vmId = 0;
drm.createDrmVirtualMemory(vmId);

View File

@@ -669,7 +669,7 @@ TEST(DrmTest, givenDrmWhenCreatingOsContextThenCreateDrmContextWithVmId) {
TEST(DrmTest, givenDrmWithPerContextVMRequiredWhenCreatingOsContextsThenImplicitVmIdPerContextIsUsed) {
MockExecutionEnvironment executionEnvironment{};
auto &rootEnv = *executionEnvironment.rootDeviceEnvironments[0];
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
DrmMock drmMock(rootEnv);
EXPECT_TRUE(drmMock.requirePerContextVM);
@@ -684,7 +684,7 @@ TEST(DrmTest, givenDrmWithPerContextVMRequiredWhenCreatingOsContextsThenImplicit
TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextsThenImplicitVmIdPerContextIsQueriedAndStored) {
MockExecutionEnvironment executionEnvironment{};
auto &rootEnv = *executionEnvironment.rootDeviceEnvironments[0];
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
DrmMock drmMock(rootEnv);
EXPECT_TRUE(drmMock.requirePerContextVM);
@@ -704,7 +704,7 @@ TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextsThenImplicitVmIdPer
TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextForSubDeviceThenImplicitVmIdPerContextIsQueriedAndStoredAtSubDeviceIndex) {
MockExecutionEnvironment executionEnvironment{};
auto &rootEnv = *executionEnvironment.rootDeviceEnvironments[0];
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
DrmMock drmMock(rootEnv);
EXPECT_TRUE(drmMock.requirePerContextVM);
@@ -728,7 +728,7 @@ TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextForSubDeviceThenImpl
TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextsForRootDeviceThenImplicitVmIdsPerContextAreQueriedAndStoredAtSubDeviceIndices) {
MockExecutionEnvironment executionEnvironment{};
auto &rootEnv = *executionEnvironment.rootDeviceEnvironments[0];
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
DrmMock drmMock(rootEnv);
EXPECT_TRUE(drmMock.requirePerContextVM);
@@ -769,7 +769,7 @@ TEST(DrmTest, givenNoPerContextVmsDrmWhenCreatingOsContextsThenVmIdIsNotQueriedA
TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextThenSetContextDebugFlagIsCalled) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -789,7 +789,7 @@ TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextTh
TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextForInternalEngineThenSetContextDebugFlagIsNotCalled) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -825,7 +825,7 @@ TEST(DrmTest, givenNotEnabledDebuggingOrContextDebugUnsupportedWhenCreatingConte
EXPECT_FALSE(drmMock.capturedCooperativeContextRequest);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
drmMock.contextDebugSupported = false;
drmMock.callBaseCreateDrmContext = false;
drmMock.capturedCooperativeContextRequest = true;
@@ -881,7 +881,7 @@ TEST(DrmTest, givenPrintIoctlDebugFlagNotSetWhenGettingTimestampFrequencyThenCap
TEST(DrmTest, givenProgramDebuggingWhenCreatingContextThenUnrecoverableContextIsSet) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();

View File

@@ -496,7 +496,7 @@ TEST_F(IoctlHelperPrelimFixture, whenCreateDrmContextIsCalledThenIoctlIsCalledOn
}
TEST_F(IoctlHelperPrelimFixture, givenProgramDebuggingAndContextDebugSupportedWhenCreatingContextThenCooperativeFlagIsPassedToCreateDrmContextOnlyIfCCSEnginesArePresent) {
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
drm->contextDebugSupported = true;
drm->callBaseCreateDrmContext = false;

View File

@@ -88,7 +88,7 @@ TEST_F(WddmTests, whenftrEuDebugIsFalseThenDebuggingEnabledReturnsFalse) {
}
TEST_F(WddmTests, whenProgramDebugIsEnabledAndCreatingContextWithInternalEngineThenDebuggableContextReturnsFalse) {
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Online);
wddm->init();
OsContextWin osContext(*wddm, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::EngineType::ENGINE_RCS, EngineUsage::Internal}));
osContext.ensureContextInitialized();
@@ -181,7 +181,7 @@ TEST_F(WddmTests, GivengtSystemInfoSliceInfoHasEnabledSlicesAtHigherIndicesThenE
&hwInfo->gtSystemInfo,
hwInfo->capabilityTable.gpuAddressSpace));
wddm->rootDeviceEnvironment.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
wddm->rootDeviceEnvironment.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
EXPECT_TRUE(wddm->init());
const auto &topologyMap = wddm->getTopologyMap();
EXPECT_EQ(topologyMap.size(), 1u);
@@ -206,7 +206,7 @@ TEST_F(WddmTests, GivenProperTopologyDataAndDebugFlagsEnabledWhenInitializingWdd
&hwInfo->gtSystemInfo,
hwInfo->capabilityTable.gpuAddressSpace));
wddm->rootDeviceEnvironment.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
wddm->rootDeviceEnvironment.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
EXPECT_TRUE(wddm->init());
const auto &topologyMap = wddm->getTopologyMap();
EXPECT_EQ(topologyMap.size(), 1u);
@@ -227,7 +227,7 @@ TEST_F(WddmTests, GivenNoSubsliceEnabledAndDebugFlagsEnabledWhenInitializingWddm
&hwInfo->gtSystemInfo,
hwInfo->capabilityTable.gpuAddressSpace));
wddm->rootDeviceEnvironment.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
wddm->rootDeviceEnvironment.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Online);
EXPECT_FALSE(wddm->init());
const auto &topologyMap = wddm->getTopologyMap();
EXPECT_TRUE(topologyMap.empty());