mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
fix: setup initial l3 bank count before querying topology
Resolves: NEO-12169 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b6bea06c3a
commit
382584067a
@@ -505,6 +505,10 @@ int Drm::setupHardwareInfo(const DeviceDescriptor *device, bool setupFeatureTabl
|
|||||||
printDebugString(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to query engine info\n");
|
printDebugString(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to query engine info\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!hwInfo->gtSystemInfo.L3BankCount) {
|
||||||
|
hwInfo->gtSystemInfo.L3BankCount = hwInfo->gtSystemInfo.MaxDualSubSlicesSupported;
|
||||||
|
}
|
||||||
|
|
||||||
DrmQueryTopologyData topologyData = {};
|
DrmQueryTopologyData topologyData = {};
|
||||||
|
|
||||||
if (!queryTopology(*hwInfo, topologyData)) {
|
if (!queryTopology(*hwInfo, topologyData)) {
|
||||||
@@ -567,9 +571,7 @@ int Drm::setupHardwareInfo(const DeviceDescriptor *device, bool setupFeatureTabl
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (systemInfo) {
|
if (systemInfo) {
|
||||||
uint32_t bankCount = (hwInfo->gtSystemInfo.L3BankCount > 0) ? hwInfo->gtSystemInfo.L3BankCount : hwInfo->gtSystemInfo.MaxDualSubSlicesSupported;
|
hwInfo->gtSystemInfo.L3CacheSizeInKb = systemInfo->getL3BankSizeInKb() * hwInfo->gtSystemInfo.L3BankCount;
|
||||||
|
|
||||||
hwInfo->gtSystemInfo.L3CacheSizeInKb = systemInfo->getL3BankSizeInKb() * bankCount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rootDeviceEnvironment.setRcsExposure();
|
rootDeviceEnvironment.setRcsExposure();
|
||||||
|
|||||||
@@ -360,7 +360,7 @@ TEST(DrmSystemInfoTest, givenZeroBankCountWhenCreatingSystemInfoThenUseDualSubsl
|
|||||||
EXPECT_NE(nullptr, drm.getSystemInfo());
|
EXPECT_NE(nullptr, drm.getSystemInfo());
|
||||||
const auto >SystemInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->gtSystemInfo;
|
const auto >SystemInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->gtSystemInfo;
|
||||||
|
|
||||||
EXPECT_EQ(0u, gtSystemInfo.L3BankCount);
|
EXPECT_EQ(gtSystemInfo.MaxDualSubSlicesSupported, gtSystemInfo.L3BankCount);
|
||||||
|
|
||||||
uint64_t expectedL3Size = gtSystemInfo.MaxDualSubSlicesSupported * drm.getSystemInfo()->getL3BankSizeInKb();
|
uint64_t expectedL3Size = gtSystemInfo.MaxDualSubSlicesSupported * drm.getSystemInfo()->getL3BankSizeInKb();
|
||||||
uint64_t calculatedL3Size = gtSystemInfo.L3CacheSizeInKb;
|
uint64_t calculatedL3Size = gtSystemInfo.L3CacheSizeInKb;
|
||||||
|
|||||||
@@ -1794,6 +1794,42 @@ TEST(DrmHwInfoTest, givenTopologyDataWithoutSystemInfoWhenSettingHwInfoThenCorre
|
|||||||
EXPECT_EQ(hwInfo->gtSystemInfo.MaxDualSubSlicesSupported, 16u);
|
EXPECT_EQ(hwInfo->gtSystemInfo.MaxDualSubSlicesSupported, 16u);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(DrmHwInfoTest, givenTopologyDataWithoutL3BankCountWhenSettingHwInfoThenL3BankCountIsSetBasedOnMaxDualSubslicesBeforeQueryTopology) {
|
||||||
|
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||||
|
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||||
|
|
||||||
|
drm.ioctlHelper = std::make_unique<MockIoctlHelper>(drm);
|
||||||
|
|
||||||
|
auto ioctlHelper = static_cast<MockIoctlHelper *>(drm.ioctlHelper.get());
|
||||||
|
|
||||||
|
ioctlHelper->topologyDataToSet.sliceCount = 1;
|
||||||
|
ioctlHelper->topologyDataToSet.subSliceCount = 1;
|
||||||
|
ioctlHelper->topologyDataToSet.maxEusPerSubSlice = 1;
|
||||||
|
ioctlHelper->topologyDataToSet.euCount = 1;
|
||||||
|
ioctlHelper->topologyDataToSet.maxSlices = 1;
|
||||||
|
ioctlHelper->topologyDataToSet.maxSubSlicesPerSlice = 16;
|
||||||
|
|
||||||
|
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo();
|
||||||
|
|
||||||
|
hwInfo->gtSystemInfo = {};
|
||||||
|
|
||||||
|
auto setupHardwareInfo = [](HardwareInfo *hwInfo, bool, const ReleaseHelper *) {
|
||||||
|
hwInfo->gtSystemInfo.MaxSubSlicesSupported = 8;
|
||||||
|
hwInfo->gtSystemInfo.MaxDualSubSlicesSupported = 8;
|
||||||
|
};
|
||||||
|
DeviceDescriptor device = {0, hwInfo, setupHardwareInfo};
|
||||||
|
|
||||||
|
drm.systemInfoQueried = true;
|
||||||
|
EXPECT_EQ(nullptr, drm.systemInfo.get());
|
||||||
|
EXPECT_EQ(0, drm.setupHardwareInfo(&device, false));
|
||||||
|
EXPECT_EQ(nullptr, drm.systemInfo.get());
|
||||||
|
|
||||||
|
EXPECT_EQ(hwInfo->gtSystemInfo.L3BankCount, 8u);
|
||||||
|
|
||||||
|
EXPECT_EQ(hwInfo->gtSystemInfo.MaxSubSlicesSupported, 16u);
|
||||||
|
EXPECT_EQ(hwInfo->gtSystemInfo.MaxDualSubSlicesSupported, 16u);
|
||||||
|
}
|
||||||
|
|
||||||
TEST(DrmWrapperTest, givenEAgainOrEIntrOrEBusyWhenCheckingIfReinvokeRequiredThenTrueIsReturned) {
|
TEST(DrmWrapperTest, givenEAgainOrEIntrOrEBusyWhenCheckingIfReinvokeRequiredThenTrueIsReturned) {
|
||||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||||
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||||
|
|||||||
Reference in New Issue
Block a user