Skip to content

Commit c33c52a

Browse files
fix hw config linux: set slice info based on slice count
Related-To: NEO-7622 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com> Source: 5b2e1f6
1 parent 0fa30e5 commit c33c52a

File tree

5 files changed

+28
-16
lines changed

5 files changed

+28
-16
lines changed

level_zero/tools/test/unit_tests/sources/debug/linux/debug_session_fixtures_linux.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ void DebugApiLinuxFixture::setUp(NEO::HardwareInfo *hwInfo) {
3232
}
3333
NEO::Drm::QueryTopologyData topologyData = {};
3434
mockDrm->queryTopology(neoDevice->getHardwareInfo(), topologyData);
35+
auto &rootDeviceEnvironment = *neoDevice->executionEnvironment->rootDeviceEnvironments[0];
36+
auto gtSystemInfo = &rootDeviceEnvironment.getMutableHardwareInfo()->gtSystemInfo;
37+
for (uint32_t slice = 0; slice < GT_MAX_SLICE; slice++) {
38+
gtSystemInfo->SliceInfo[slice].Enabled = slice < gtSystemInfo->SliceCount;
39+
}
3540

36-
neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface);
37-
neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(mockDrm));
41+
rootDeviceEnvironment.osInterface.reset(new NEO::OSInterface);
42+
rootDeviceEnvironment.osInterface->setDriverModel(std::unique_ptr<DriverModel>(mockDrm));
3843
}
3944

4045
void DebugApiLinuxMultiDeviceFixture::setUp() {
@@ -58,9 +63,14 @@ void DebugApiLinuxMultiDeviceFixture::setUp() {
5863

5964
NEO::Drm::QueryTopologyData topologyData = {};
6065
mockDrm->queryTopology(neoDevice->getHardwareInfo(), topologyData);
66+
auto &rootDeviceEnvironment = *neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0];
67+
auto gtSystemInfo = &rootDeviceEnvironment.getMutableHardwareInfo()->gtSystemInfo;
68+
for (uint32_t slice = 0; slice < GT_MAX_SLICE; slice++) {
69+
gtSystemInfo->SliceInfo[slice].Enabled = slice < gtSystemInfo->SliceCount;
70+
}
6171

62-
neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface);
63-
neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(mockDrm));
72+
rootDeviceEnvironment.osInterface.reset(new NEO::OSInterface);
73+
rootDeviceEnvironment.osInterface->setDriverModel(std::unique_ptr<DriverModel>(mockDrm));
6474
}
6575

6676
TileDebugSessionLinux *MockDebugSessionLinux::createTileSession(const zet_debug_config_t &config, L0::Device *device, L0::DebugSessionImp *rootDebugSession) {

shared/source/os_interface/linux/hw_info_config_drm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ int ProductHelper::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo
113113
gtSystemInfo->MaxDualSubSlicesSupported = gtSystemInfo->MaxSubSlicesSupported;
114114

115115
gtSystemInfo->IsDynamicallyPopulated = true;
116-
for (uint32_t slice = 0; slice < gtSystemInfo->SliceCount; slice++) {
117-
gtSystemInfo->SliceInfo[slice].Enabled = true;
116+
for (uint32_t slice = 0; slice < GT_MAX_SLICE; slice++) {
117+
gtSystemInfo->SliceInfo[slice].Enabled = slice < gtSystemInfo->SliceCount;
118118
}
119119

120120
uint64_t gttSizeQuery = 0;

shared/source/xe_hpg_core/hw_info_dg2.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,17 @@ void Dg2HwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTable
165165
gtSysInfo->MaxEuPerSubSlice = gtSysInfo->EUCount / gtSysInfo->SubSliceCount;
166166
gtSysInfo->MaxSlicesSupported = gtSysInfo->SliceCount;
167167
gtSysInfo->MaxSubSlicesSupported = gtSysInfo->SubSliceCount;
168+
gtSysInfo->IsDynamicallyPopulated = true;
169+
}
170+
gtSysInfo->L3CacheSizeInKb = 1;
171+
gtSysInfo->L3BankCount = 1;
168172

169-
gtSysInfo->L3CacheSizeInKb = 1;
170-
gtSysInfo->L3BankCount = 1;
171-
172-
gtSysInfo->CCSInfo.IsValid = true;
173-
gtSysInfo->CCSInfo.NumberOfCCSEnabled = 1;
173+
gtSysInfo->CCSInfo.IsValid = true;
174+
gtSysInfo->CCSInfo.NumberOfCCSEnabled = 1;
174175

175-
hwInfo->featureTable.ftrBcsInfo = 1;
176-
gtSysInfo->IsDynamicallyPopulated = true;
177-
for (uint32_t slice = 0; slice < gtSysInfo->SliceCount; slice++) {
178-
gtSysInfo->SliceInfo[slice].Enabled = true;
179-
}
176+
hwInfo->featureTable.ftrBcsInfo = 1;
177+
for (uint32_t slice = 0; slice < gtSysInfo->SliceCount; slice++) {
178+
gtSysInfo->SliceInfo[slice].Enabled = true;
180179
}
181180

182181
adjustHardwareInfo(hwInfo);

shared/test/common/tests_configuration.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ void adjustHwInfoForTests(HardwareInfo &hwInfoForTests, uint32_t euPerSubSlice,
3434

3535
gtSystemInfo.SliceCount = sliceCount;
3636
gtSystemInfo.SubSliceCount = gtSystemInfo.SliceCount * subSlicePerSliceCount;
37+
gtSystemInfo.DualSubSliceCount = gtSystemInfo.SubSliceCount;
3738
gtSystemInfo.EUCount = gtSystemInfo.SubSliceCount * euPerSubSlice - dieRecovery;
3839
gtSystemInfo.ThreadCount = gtSystemInfo.EUCount * threadsPerEu;
3940
gtSystemInfo.MaxEuPerSubSlice = std::max(gtSystemInfo.MaxEuPerSubSlice, euPerSubSlice);

shared/test/unit_test/xe_hpg_core/dg2/test_encode_dispatch_kernel_dg2.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include "shared/source/command_container/command_encoder.h"
9+
#include "shared/source/helpers/compiler_product_helper.h"
910
#include "shared/source/helpers/gfx_core_helper.h"
1011
#include "shared/source/kernel/dispatch_kernel_encoder_interface.h"
1112
#include "shared/source/os_interface/hw_info_config.h"
@@ -93,6 +94,7 @@ DG2TEST_F(CommandEncodeStatesDg2Test, GivenVariousSlmTotalSizesAndSettingRevIDTo
9394
for (auto deviceId : {dg2G10DeviceIds[0], dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) {
9495
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
9596
hwInfo.platform.usDeviceID = deviceId;
97+
setHwInfoValuesFromConfig(0x200040005, hwInfo);
9698
if (DG2::isG10(hwInfo) && (revision < REVISION_B)) {
9799
verifyPreferredSlmValues<FamilyType>(valuesToTestForDg2G10AStep, rootDeviceEnvironment);
98100
} else {

0 commit comments

Comments
 (0)