Disable single tile engine instanced subdevices

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski 2021-09-27 12:36:04 +00:00 committed by Compute-Runtime-Automation
parent 470b22e8a0
commit c525ff7eb4
5 changed files with 50 additions and 2 deletions

View File

@ -1188,6 +1188,8 @@ HWTEST2_F(EngineInstancedDeviceExecuteTests, givenEngineInstancedDeviceWhenExecu
constexpr uint32_t genericDevicesCount = 1;
constexpr uint32_t ccsCount = 2;
DebugManager.flags.AllowSingleTileEngineInstancedSubDevices.set(true);
if (!createDevices(genericDevicesCount, ccsCount)) {
GTEST_SKIP();
}

View File

@ -394,6 +394,8 @@ TEST_F(EngineInstancedDeviceTests, givenDebugFlagSetAndMoreThanOneCcsWhenCreatin
constexpr uint32_t genericDevicesCount = 1;
constexpr uint32_t ccsCount = 2;
DebugManager.flags.AllowSingleTileEngineInstancedSubDevices.set(true);
if (!createDevices(genericDevicesCount, ccsCount)) {
GTEST_SKIP();
}
@ -417,6 +419,24 @@ TEST_F(EngineInstancedDeviceTests, givenDebugFlagSetAndMoreThanOneCcsWhenCreatin
}
}
TEST_F(EngineInstancedDeviceTests, givenDebugFlagNotSetAndMoreThanOneCcsWhenCreatingRootDeviceWithoutGenericSubDevicesThenDontCreateEngineInstanced) {
constexpr uint32_t genericDevicesCount = 1;
constexpr uint32_t ccsCount = 2;
if (!createDevices(genericDevicesCount, ccsCount)) {
GTEST_SKIP();
}
auto &hwInfo = rootDevice->getHardwareInfo();
EXPECT_EQ(ccsCount, hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
EXPECT_EQ(0u, rootDevice->getNumSubDevices());
EXPECT_EQ(0u, rootDevice->getNumGenericSubDevices());
EXPECT_FALSE(hasRootCsrOnly(rootDevice));
EXPECT_TRUE(hasAllEngines(rootDevice));
}
TEST_F(EngineInstancedDeviceTests, givenDebugFlagSetAndZeroCcsesWhenCreatingRootDeviceWithoutGenericSubDevicesThenCreateEngineInstanced) {
constexpr uint32_t genericDevicesCount = 1;
constexpr uint32_t ccsCount = 0;
@ -782,6 +802,8 @@ TEST_F(EngineInstancedDeviceTests, givenAffinityMaskForSecondLevelOnSingleTileDe
constexpr uint32_t genericDevicesCount = 1;
constexpr uint32_t ccsCount = 2;
DebugManager.flags.AllowSingleTileEngineInstancedSubDevices.set(true);
DebugManager.flags.ZE_AFFINITY_MASK.set("0.0");
if (!createDevices(genericDevicesCount, ccsCount)) {
@ -795,12 +817,30 @@ TEST_F(EngineInstancedDeviceTests, givenAffinityMaskForSecondLevelOnSingleTileDe
EXPECT_EQ(ccsCount, rootDevice->getNumSubDevices());
}
TEST_F(EngineInstancedDeviceTests, givenAffinityMaskForSecondLevelOnSingleTileDeviceWithoutDebugFlagWhenCreatingThenDontEnableAllEngineInstancedDevices) {
constexpr uint32_t genericDevicesCount = 1;
constexpr uint32_t ccsCount = 2;
DebugManager.flags.ZE_AFFINITY_MASK.set("0.0");
if (!createDevices(genericDevicesCount, ccsCount)) {
GTEST_SKIP();
}
EXPECT_FALSE(hasRootCsrOnly(rootDevice));
EXPECT_FALSE(rootDevice->isEngineInstanced());
EXPECT_EQ(0u, rootDevice->getNumGenericSubDevices());
EXPECT_EQ(0u, rootDevice->getNumSubDevices());
}
HWTEST2_F(EngineInstancedDeviceTests, givenEngineInstancedDeviceWhenProgrammingCfeStateThenSetSingleSliceDispatch, IsAtLeastXeHpCore) {
using CFE_STATE = typename FamilyType::CFE_STATE;
constexpr uint32_t genericDevicesCount = 1;
constexpr uint32_t ccsCount = 2;
DebugManager.flags.AllowSingleTileEngineInstancedSubDevices.set(true);
if (!createDevices(genericDevicesCount, ccsCount)) {
GTEST_SKIP();
}

View File

@ -332,3 +332,4 @@ AllowMixingRegularAndCooperativeKernels = 0
AllowPatchingVfeStateInCommandLists = 0
PrintMemoryRegionSizes = 0
OverrideDrmRegion = -1
AllowSingleTileEngineInstancedSubDevices = 0

View File

@ -262,6 +262,7 @@ DECLARE_DEBUG_VARIABLE(bool, EnableFormatQuery, true, "Enable sharing format que
DECLARE_DEBUG_VARIABLE(bool, EnableFreeMemory, false, "Enable freeMemory in memory manager")
DECLARE_DEBUG_VARIABLE(bool, ForceSamplerLowFilteringPrecision, false, "Force Low Filtering Precision Sampler mode")
DECLARE_DEBUG_VARIABLE(bool, EngineInstancedSubDevices, false, "Create subdevices assigned to specific engine")
DECLARE_DEBUG_VARIABLE(bool, AllowSingleTileEngineInstancedSubDevices, false, "Create subdevices assigned to specific engine on signle tile config")
DECLARE_DEBUG_VARIABLE(int32_t, EnableKernelTunning, -1, "Perform a tunning of enqueue kernel, -1:default(disabled), 0:disable, 1:enable simple kernel tunning, 2:enable full kernel tunning")
DECLARE_DEBUG_VARIABLE(int32_t, EnableBOMmapCreate, -1, "Create BOs using mmap, -1:default, 0:disable(GEM_USERPTR), 1:enable")
DECLARE_DEBUG_VARIABLE(int32_t, EnableGemCloseWorker, -1, "Use asynchronous gem object closing, -1:default, 0:disable, 1:enable")

View File

@ -83,8 +83,12 @@ bool Device::genericSubDevicesAllowed() {
}
bool Device::engineInstancedSubDevicesAllowed() {
if ((DebugManager.flags.EngineInstancedSubDevices.get() != 1) || engineInstanced ||
(getHardwareInfo().gtSystemInfo.CCSInfo.NumberOfCCSEnabled < 2)) {
bool notAllowed = !DebugManager.flags.EngineInstancedSubDevices.get();
notAllowed |= engineInstanced;
notAllowed |= (getHardwareInfo().gtSystemInfo.CCSInfo.NumberOfCCSEnabled < 2);
notAllowed |= ((HwHelper::getSubDevicesCount(&getHardwareInfo()) < 2) && (!DebugManager.flags.AllowSingleTileEngineInstancedSubDevices.get()));
if (notAllowed) {
return false;
}