Always init device with first submission

Resolves: NEO-7642

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2023-01-17 12:25:30 +00:00
committed by Compute-Runtime-Automation
parent e692246315
commit 831e2eebcd
8 changed files with 29 additions and 8 deletions

View File

@@ -388,7 +388,7 @@ bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsa
if (!defaultEngineAlreadySet) {
defaultEngineIndex = deviceCsrIndex;
if (osContext->isDebuggableContext()) {
if (Device::isInitDeviceWithFirstSubmissionEnabled()) {
if (SubmissionStatus::SUCCESS != commandStreamReceiver->initializeDeviceWithFirstSubmission()) {
return false;
}
@@ -405,6 +405,7 @@ bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsa
if (engineUsage == EngineUsage::Regular) {
addEngineToEngineGroup(engine);
}
commandStreamReceivers.push_back(std::move(commandStreamReceiver));
return true;

View File

@@ -107,6 +107,7 @@ class Device : public ReferenceTrackedObject<Device> {
RootDeviceEnvironment &getRootDeviceEnvironmentRef() const;
bool isFullRangeSvm() const;
static bool isBlitSplitEnabled();
static bool isInitDeviceWithFirstSubmissionEnabled();
bool isBcsSplitSupported();
bool areSharedSystemAllocationsAllowed() const;
template <typename SpecializedDeviceT>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Intel Corporation
* Copyright (C) 2022-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -13,4 +13,8 @@ bool Device::isBlitSplitEnabled() {
return true;
}
bool Device::isInitDeviceWithFirstSubmissionEnabled() {
return true;
}
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -36,7 +36,7 @@ void NEO::BaseUltConfigListener::OnTestEnd(const ::testing::TestInfo &) {
// Ensure that global state is restored
UltHwConfig expectedState{};
static_assert(sizeof(UltHwConfig) == 13 * sizeof(bool), ""); // Ensure that there is no internal padding
static_assert(sizeof(UltHwConfig) == 14 * sizeof(bool), ""); // Ensure that there is no internal padding
EXPECT_EQ(0, memcmp(&expectedState, &ultHwConfig, sizeof(UltHwConfig)));
EXPECT_EQ(0, memcmp(&referencedHwInfo.platform, &defaultHwInfo->platform, sizeof(PLATFORM)));

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -14,6 +14,7 @@ struct UltHwConfig {
bool forceOsAgnosticMemoryManager = true;
bool useWaitForTimestamps = false;
bool useBlitSplit = false;
bool useFirstSubmissionInitDevice = false;
bool csrFailInitDirectSubmission = false;
bool csrBaseCallDirectSubmissionAvailable = false;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Intel Corporation
* Copyright (C) 2022-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -14,4 +14,8 @@ bool Device::isBlitSplitEnabled() {
return ultHwConfig.useBlitSplit;
}
bool Device::isInitDeviceWithFirstSubmissionEnabled() {
return ultHwConfig.useFirstSubmissionInitDevice;
}
} // namespace NEO

View File

@@ -669,6 +669,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZexNumberOfCssEnvVariableSetAmbig
}
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenDebuggableOsContextWhenDeviceCreatesEnginesThenDeviceIsInitializedWithFirstSubmission) {
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.useFirstSubmissionInitDevice = true;
auto hwInfo = *defaultHwInfo;
hardwareInfoSetup[hwInfo.platform.eProductFamily](&hwInfo, true, 0);
@@ -683,7 +686,10 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenDebuggableOsContextWhenDeviceCrea
EXPECT_EQ(1u, csr->peekLatestSentTaskCount());
}
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenNonDebuggableOsContextWhenDeviceCreatesEnginesThenDeviceIsNotInitializedWithFirstSubmission) {
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, whenDeviceCreatesEnginesThenDeviceIsInitializedWithFirstSubmission) {
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.useFirstSubmissionInitDevice = true;
auto hwInfo = *defaultHwInfo;
hardwareInfoSetup[hwInfo.platform.eProductFamily](&hwInfo, true, 0);
@@ -694,5 +700,5 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenNonDebuggableOsContextWhenDeviceC
auto device = deviceFactory.rootDevices[0];
auto csr = device->allEngines[device->defaultEngineIndex].commandStreamReceiver;
EXPECT_EQ(0u, csr->peekLatestSentTaskCount());
EXPECT_EQ(1u, csr->peekLatestSentTaskCount());
}