fix: update slm size in capability table based on gt system info

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski 2024-07-05 13:32:22 +00:00 committed by Compute-Runtime-Automation
parent ac1ba09911
commit e624a4b0ab
4 changed files with 17 additions and 1 deletions

View File

@ -930,6 +930,10 @@ void Drm::setupSystemInfo(HardwareInfo *hwInfo, SystemInfo *sysInfo) {
gtSysInfo->MaxDualSubSlicesSupported = sysInfo->getMaxDualSubSlicesSupported();
gtSysInfo->CsrSizeInMb = sysInfo->getCsrSizeInMb();
gtSysInfo->SLMSizeInKb = sysInfo->getSlmSizePerDss();
if (gtSysInfo->SLMSizeInKb) {
hwInfo->capabilityTable.slmSize = gtSysInfo->SLMSizeInKb;
}
}
void Drm::setupCacheInfo(const HardwareInfo &hwInfo) {

View File

@ -110,6 +110,7 @@ bool Wddm::init() {
hardwareInfo->capabilityTable.instrumentationEnabled =
(hardwareInfo->capabilityTable.instrumentationEnabled && instrumentationEnabled);
hardwareInfo->capabilityTable.slmSize = gtSystemInfo->SLMSizeInKb;
rootDeviceEnvironment.initProductHelper();
rootDeviceEnvironment.initCompilerProductHelper();
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();

View File

@ -245,13 +245,16 @@ TEST(DrmSystemInfoTest, givenSetupHardwareInfoWhenQuerySystemInfoSucceedsThenSys
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.slmSize = 0x1234678u;
auto setupHardwareInfo = [](HardwareInfo *, bool, const ReleaseHelper *) {};
DeviceDescriptor device = {0, &hwInfo, setupHardwareInfo};
int ret = drm.setupHardwareInfo(&device, false);
EXPECT_EQ(ret, 0);
EXPECT_NE(nullptr, drm.getSystemInfo());
const auto &gtSystemInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->gtSystemInfo;
const auto &newHwInfo = *executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
const auto &gtSystemInfo = newHwInfo.gtSystemInfo;
EXPECT_GT(gtSystemInfo.MaxEuPerSubSlice, 0u);
EXPECT_GT(gtSystemInfo.MaxSlicesSupported, 0u);
@ -260,6 +263,8 @@ TEST(DrmSystemInfoTest, givenSetupHardwareInfoWhenQuerySystemInfoSucceedsThenSys
EXPECT_GT(gtSystemInfo.MemoryType, 0u);
EXPECT_EQ(gtSystemInfo.CsrSizeInMb, drm.getSystemInfo()->getCsrSizeInMb());
EXPECT_EQ(gtSystemInfo.SLMSizeInKb, drm.getSystemInfo()->getSlmSizePerDss());
EXPECT_NE(newHwInfo.capabilityTable.slmSize, hwInfo.capabilityTable.slmSize);
EXPECT_EQ(newHwInfo.capabilityTable.slmSize, drm.getSystemInfo()->getSlmSizePerDss());
}
TEST(DrmSystemInfoTest, givenSetupHardwareInfoWhenQuerySystemInfoSucceedsThenSystemInfoIsCreatedAndHardwareInfoSetProperlyBasedOnBlobData) {

View File

@ -72,6 +72,12 @@ TEST_F(Wddm20Tests, GivenExisitingContextWhenInitializingWddmThenCreateContextRe
EXPECT_EQ(1u, wddm->createContextResult.called);
}
TEST_F(Wddm20Tests, whenInitializingWddmThenSlmSizeInCapabilityTableIsSameAsInGtSystemInfo) {
wddm->init();
auto hwInfo = rootDeviceEnvironment->getHardwareInfo();
EXPECT_EQ(hwInfo->gtSystemInfo.SLMSizeInKb, hwInfo->capabilityTable.slmSize);
}
TEST_F(Wddm20Tests, givenNullPageTableManagerAndCompressedResourceWhenMappingGpuVaThenDontUpdateAuxTable) {
GmmRequirements gmmRequirements{};
gmmRequirements.allowLargePages = true;