fix: ignore read error when getting bandwidth for DG2

Related-To: NEO-9038
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-10-12 09:24:02 +00:00
committed by Compute-Runtime-Automation
parent a420e34b10
commit 4be1a8f615
3 changed files with 12 additions and 17 deletions

View File

@@ -188,10 +188,13 @@ ze_result_t LinuxMemoryImp::getBandwidthForDg2(zes_mem_bandwidth_t *pBandwidth)
pBandwidth->maxBandwidth = 0u;
const std::string maxBwFile = "prelim_lmem_max_bw_Mbps";
uint64_t maxBw = 0;
pSysfsAccess->read(maxBwFile, maxBw);
result = pSysfsAccess->read(maxBwFile, maxBw);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s():pSysfsAccess->read returning error:0x%x \n", __FUNCTION__, result);
}
pBandwidth->maxBandwidth = maxBw * MbpsToBytesPerSecond;
pBandwidth->timestamp = SysmanDevice::getSysmanTimestamp();
return result;
return ZE_RESULT_SUCCESS;
}
ze_result_t LinuxMemoryImp::getHbmBandwidthPVC(uint32_t numHbmModules, zes_mem_bandwidth_t *pBandwidth) {

View File

@@ -501,10 +501,8 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemo
}
}
TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemoryGetBandwidthForDg2PlatformIfIdiReadFailsTheFailureIsReturned) {
HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemoryGetBandwidthForDg2PlatformIfIdiReadFailsTheFailureIsReturned, IsDG2) {
setLocalSupportedAndReinit(true);
auto hwInfo = pLinuxSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironment().getMutableHardwareInfo();
hwInfo->platform.eProductFamily = IGFX_DG2;
auto handles = getMemoryHandles(memoryHandleComponentCount);
for (auto handle : handles) {
@@ -521,13 +519,6 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemo
HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemoryGetBandwidthForDg2PlatformAndReadingMaxBwFailsThenMaxBwIsReturnedAsZero, IsDG2) {
setLocalSupportedAndReinit(true);
// auto hwInfo = *NEO::defaultHwInfo.get();
// hwInfo.platform.eProductFamily = IGFX_DG2;
// pLinuxSysmanImp->getDeviceHandle()->getNEODevice()->getRootDeviceEnvironmentRef().setHwInfoAndInitHelpers(&hwInfo);
auto hwInfo = pSysmanDeviceImp->getHardwareInfo();
hwInfo.platform.eProductFamily = IGFX_DG2;
auto handles = getMemoryHandles(memoryHandleComponentCount);
for (const auto &handle : handles) {
@@ -542,11 +533,9 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM
}
}
TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemoryGetBandwidthForDg2PlatformIfIdiWriteFailsTheFailureIsReturned) {
HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemoryGetBandwidthForDg2PlatformIfIdiWriteFailsTheFailureIsReturned, IsDG2) {
setLocalSupportedAndReinit(true);
auto hwInfo = pLinuxSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironment().getMutableHardwareInfo();
hwInfo->platform.eProductFamily = IGFX_DG2;
auto handles = getMemoryHandles(memoryHandleComponentCount);
for (auto handle : handles) {

View File

@@ -194,10 +194,13 @@ ze_result_t LinuxMemoryImp::getBandwidthForDg2(zes_mem_bandwidth_t *pBandwidth)
pBandwidth->maxBandwidth = 0u;
const std::string maxBwFile = "prelim_lmem_max_bw_Mbps";
uint64_t maxBw = 0;
pSysfsAccess->read(maxBwFile, maxBw);
result = pSysfsAccess->read(maxBwFile, maxBw);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s():pSysfsAccess->read returning error:0x%x \n", __FUNCTION__, result);
}
pBandwidth->maxBandwidth = maxBw * MbpsToBytesPerSecond;
pBandwidth->timestamp = SysmanDevice::getSysmanTimestamp();
return result;
return ZE_RESULT_SUCCESS;
}
ze_result_t LinuxMemoryImp::getHbmBandwidth(uint32_t numHbmModules, zes_mem_bandwidth_t *pBandwidth) {