fix: query engine info prior to query topology

don't setup l3 bank count in default gt sys info

Related-To: NEO-12073
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski 2024-07-25 14:35:48 +00:00 committed by Compute-Runtime-Automation
parent 3d3dff8dc2
commit 1fa7e14d0b
6 changed files with 23 additions and 20 deletions

View File

@ -65,16 +65,6 @@ Drm *Drm::create(std::unique_ptr<HwDeviceIdDrm> &&hwDeviceId, RootDeviceEnvironm
printDebugString(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to request OCL Turbo Boost\n");
}
if (!drm->queryMemoryInfo()) {
drm->setPerContextVMRequired(true);
printDebugString(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to query memory info\n");
}
if (!drm->queryEngineInfo()) {
drm->setPerContextVMRequired(true);
printDebugString(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to query engine info\n");
}
drm->checkContextDebugSupport();
drm->queryPageFaultSupport();

View File

@ -146,7 +146,6 @@ void setupDefaultGtSysInfo(HardwareInfo *hwInfo, const ReleaseHelper *releaseHel
gtSysInfo->MaxSlicesSupported = gtSysInfo->SliceCount;
gtSysInfo->MaxSubSlicesSupported = gtSysInfo->SubSliceCount;
gtSysInfo->MaxDualSubSlicesSupported = gtSysInfo->DualSubSliceCount;
gtSysInfo->L3BankCount = 1;
}
if (releaseHelper->getL3BankCount() > 0) {

View File

@ -42,6 +42,7 @@
#include "shared/source/os_interface/os_environment.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/source/release_helper/release_helper.h"
#include "shared/source/utilities/api_intercept.h"
#include "shared/source/utilities/directory.h"
#include "shared/source/utilities/io_functions.h"
@ -485,6 +486,18 @@ int Drm::setupHardwareInfo(const DeviceDescriptor *device, bool setupFeatureTabl
ioctlHelper->setupIpVersion();
rootDeviceEnvironment.initReleaseHelper();
auto releaseHelper = rootDeviceEnvironment.getReleaseHelper();
device->setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper);
if (!queryMemoryInfo()) {
setPerContextVMRequired(true);
printDebugString(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to query memory info\n");
}
if (!queryEngineInfo()) {
setPerContextVMRequired(true);
printDebugString(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to query engine info\n");
}
DrmQueryTopologyData topologyData = {};
bool status = queryTopology(*hwInfo, topologyData);
@ -508,7 +521,12 @@ int Drm::setupHardwareInfo(const DeviceDescriptor *device, bool setupFeatureTabl
hwInfo->gtSystemInfo.SliceCount = static_cast<uint32_t>(topologyData.sliceCount);
hwInfo->gtSystemInfo.SubSliceCount = static_cast<uint32_t>(topologyData.subSliceCount);
hwInfo->gtSystemInfo.DualSubSliceCount = static_cast<uint32_t>(topologyData.subSliceCount);
hwInfo->gtSystemInfo.EUCount = static_cast<uint32_t>(topologyData.euCount);
auto numThreadsPerEu = releaseHelper ? releaseHelper->getNumThreadsPerEu() : 7u;
hwInfo->gtSystemInfo.ThreadCount = numThreadsPerEu * hwInfo->gtSystemInfo.EUCount;
if (topologyData.maxSlices * topologyData.maxSubSlicesPerSlice > 0) {
hwInfo->gtSystemInfo.MaxSubSlicesSupported = static_cast<uint32_t>(topologyData.maxSlices * topologyData.maxSubSlicesPerSlice);
hwInfo->gtSystemInfo.MaxDualSubSlicesSupported = static_cast<uint32_t>(topologyData.maxSlices * topologyData.maxSubSlicesPerSlice);
@ -525,8 +543,6 @@ int Drm::setupHardwareInfo(const DeviceDescriptor *device, bool setupFeatureTabl
}
status = querySystemInfo();
auto releaseHelper = rootDeviceEnvironment.getReleaseHelper();
device->setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper);
rootDeviceEnvironment.setRcsExposure();
if (status) {

View File

@ -20,7 +20,7 @@ TEST(HwInfoTest, givenReleaseHelperWithL3BankConfigWhenSetupDefaultHwInfoThenL3C
setupDefaultGtSysInfo(&hwInfo, &releaseHelper);
EXPECT_EQ_VAL(1u, hwInfo.gtSystemInfo.L3BankCount);
EXPECT_EQ_VAL(0u, hwInfo.gtSystemInfo.L3BankCount);
EXPECT_EQ_VAL(1u, hwInfo.gtSystemInfo.L3CacheSizeInKb);
releaseHelper.getL3BankCountResult = 0;
@ -28,8 +28,8 @@ TEST(HwInfoTest, givenReleaseHelperWithL3BankConfigWhenSetupDefaultHwInfoThenL3C
setupDefaultGtSysInfo(&hwInfo, &releaseHelper);
EXPECT_EQ_VAL(1u, hwInfo.gtSystemInfo.L3BankCount);
EXPECT_EQ_VAL(4u, hwInfo.gtSystemInfo.L3CacheSizeInKb);
EXPECT_EQ_VAL(0u, hwInfo.gtSystemInfo.L3BankCount);
EXPECT_EQ_VAL(0u, hwInfo.gtSystemInfo.L3CacheSizeInKb);
releaseHelper.getL3BankCountResult = 2;
releaseHelper.getL3CacheBankSizeInKbResult = 0;

View File

@ -84,7 +84,7 @@ TEST(DrmSystemInfoTest, givenSetupHardwareInfoWhenQuerySystemInfoFalseThenSystem
EXPECT_EQ(nullptr, drm.getSystemInfo());
EXPECT_TRUE(isEmpty(::testing::internal::GetCapturedStdout()));
EXPECT_TRUE(isEmpty(::testing::internal::GetCapturedStderr()));
EXPECT_FALSE(isEmpty(::testing::internal::GetCapturedStderr()));
}
TEST(DrmSystemInfoTest, whenSetupHardwareInfoThenReleaseHelperContainsCorrectIpVersion) {
@ -233,7 +233,7 @@ TEST(DrmSystemInfoTest, givenSetupHardwareInfoWhenQuerySystemInfoFailsThenSystem
if (productHelper.isPlatformQuerySupported()) {
EXPECT_TRUE(hasSubstr(::testing::internal::GetCapturedStderr(), "Size got from PRELIM_DRM_I915_QUERY_HW_IP_VERSION query does not match PrelimI915::prelim_drm_i915_query_hw_ip_version size\n"));
} else {
EXPECT_TRUE(::testing::internal::GetCapturedStderr().empty());
EXPECT_FALSE(::testing::internal::GetCapturedStderr().empty());
}
}

View File

@ -167,8 +167,6 @@ HWTEST2_F(XeLpgHwInfoTests, GivenEmptyHwInfoForUnitTestsWhenSetupHardwareInfoIsC
EXPECT_GT_VAL(gtSystemInfo.MaxSlicesSupported, 0u);
EXPECT_GT_VAL(gtSystemInfo.MaxSubSlicesSupported, 0u);
EXPECT_GT_VAL(gtSystemInfo.L3BankCount, 0u);
EXPECT_TRUE(gtSystemInfo.CCSInfo.IsValid);
EXPECT_GT_VAL(gtSystemInfo.CCSInfo.NumberOfCCSEnabled, 0u);