fix: correct number of slices based on GuC info

KMD exposes flat subslice info without indicating slice index
This commit calculates slice count based on total subslice count and
max subslice per slice count that we have from device blob

Related-To: NEO-12073
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-07-17 16:43:04 +00:00
committed by Compute-Runtime-Automation
parent b8eabdd4ce
commit b6a56bcdde
3 changed files with 36 additions and 4 deletions

View File

@@ -12,7 +12,7 @@
static constexpr uint32_t dummyDeviceBlobData[] = {
NEO::DeviceBlobConstants::maxSlicesSupported,
1,
0x01,
0x02,
NEO::DeviceBlobConstants::maxDualSubSlicesSupported,
1,
0x04,

View File

@@ -160,7 +160,7 @@ TEST(DrmSystemInfoTest, givenSystemInfoCreatedFromDeviceBlobWhenQueryingSpecific
EXPECT_EQ(0x0Au, systemInfo.getMaxMemoryChannels());
EXPECT_EQ(0x0Bu, systemInfo.getMemoryType());
EXPECT_EQ(0x03u, systemInfo.getMaxEuPerDualSubSlice());
EXPECT_EQ(0x01u, systemInfo.getMaxSlicesSupported());
EXPECT_EQ(0x02u, systemInfo.getMaxSlicesSupported());
EXPECT_EQ(0x04u, systemInfo.getMaxDualSubSlicesSupported());
EXPECT_EQ(0x17u, systemInfo.getMaxRCS());
EXPECT_EQ(0x18u, systemInfo.getMaxCCS());
@@ -495,3 +495,30 @@ TEST(DrmSystemInfoTest, givenTopologyWithMoreEuPerDssThanInDeviceBlobWhenSetupHa
EXPECT_EQ(hwInfo.gtSystemInfo.SubSliceCount * drm.getSystemInfo()->getMaxEuPerDualSubSlice(), gtSystemInfo.EUCount);
EXPECT_EQ(hwInfo.gtSystemInfo.EUCount * drm.getSystemInfo()->getNumThreadsPerEu(), gtSystemInfo.ThreadCount);
}
TEST(DrmSystemInfoTest, givenFlatSubsliceInfoRepresentationWhenSetupHardwareInfoThenCorrectTopologyBasedOnMaxSubslicePerSliceCount) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
HardwareInfo &hwInfo = *executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo();
const auto &gtSystemInfo = hwInfo.gtSystemInfo;
DrmMockEngine drm(*executionEnvironment->rootDeviceEnvironments[0]);
drm.querySystemInfo();
auto systemInfo = drm.getSystemInfo();
EXPECT_NE(nullptr, systemInfo);
drm.storedSSVal = systemInfo->getMaxDualSubSlicesSupported() - 1;
drm.storedEUVal = drm.storedSSVal * systemInfo->getMaxEuPerDualSubSlice();
auto setupHardwareInfo = [](HardwareInfo *, bool, const ReleaseHelper *) {};
DeviceDescriptor device = {0, &hwInfo, setupHardwareInfo};
int ret = drm.setupHardwareInfo(&device, false);
EXPECT_EQ(ret, 0);
systemInfo = drm.getSystemInfo();
EXPECT_NE(nullptr, systemInfo);
EXPECT_EQ(gtSystemInfo.SliceCount, systemInfo->getMaxSlicesSupported());
EXPECT_EQ(gtSystemInfo.SubSliceCount, systemInfo->getMaxDualSubSlicesSupported() - 1);
EXPECT_EQ(gtSystemInfo.DualSubSliceCount, systemInfo->getMaxDualSubSlicesSupported() - 1);
}