fix(sysman): Disable Supported Diagnostics Tests

The Supported Diagnostics Tests are disabled resulting into no handle
creation for Diagnostics module

Related-To: NEO-13819

Signed-off-by: Pratik Bari <pratik.bari@intel.com>
This commit is contained in:
Pratik Bari
2025-01-30 15:01:02 +00:00
committed by Compute-Runtime-Automation
parent d37943da29
commit 4327f8c832
10 changed files with 38 additions and 141 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2024 Intel Corporation
* Copyright (C) 2023-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -23,16 +23,7 @@ const std::string LinuxDiagnosticsImp::deviceDir("device");
const std::string LinuxDiagnosticsImp::invalidateLmemFile("invalidate_lmem_mmaps");
// the sysfs node will be at /sys/class/drm/card<n>/quiesce_gpu
const std::string LinuxDiagnosticsImp::quiescentGpuFile("quiesce_gpu");
void OsDiagnostics::getSupportedDiagTestsFromFW(void *pOsSysman, std::vector<std::string> &supportedDiagTests) {
LinuxSysmanImp *pLinuxSysmanImp = static_cast<LinuxSysmanImp *>(pOsSysman);
auto pSysmanProductHelper = pLinuxSysmanImp->getSysmanProductHelper();
if (pSysmanProductHelper->isDiagnosticsSupported()) {
FirmwareUtil *pFwInterface = pLinuxSysmanImp->getFwUtilInterface();
if (pFwInterface != nullptr) {
static_cast<FirmwareUtil *>(pFwInterface)->fwSupportedDiagTests(supportedDiagTests);
}
}
}
void OsDiagnostics::getSupportedDiagTestsFromFW(void *pOsSysman, std::vector<std::string> &supportedDiagTests) {}
// before running diagnostics need to close all active workloads
// writing 1 to /sys/class/drm/card<n>/quiesce_gpu will signal KMD

View File

@@ -81,9 +81,6 @@ class SysmanProductHelper {
virtual std::string getCardCriticalPowerLimitFile() = 0;
virtual SysfsValueUnit getCardCriticalPowerLimitNativeUnit() = 0;
// Diagnostics
virtual bool isDiagnosticsSupported() = 0;
// standby
virtual bool isStandbySupported(SysmanKmdInterface *pSysmanKmdInterface) = 0;

View File

@@ -56,9 +56,6 @@ class SysmanProductHelperHw : public SysmanProductHelper {
std::string getCardCriticalPowerLimitFile() override;
SysfsValueUnit getCardCriticalPowerLimitNativeUnit() override;
// Diagnostics
bool isDiagnosticsSupported() override;
// standby
bool isStandbySupported(SysmanKmdInterface *pSysmanKmdInterface) override;

View File

@@ -276,11 +276,6 @@ SysfsValueUnit SysmanProductHelperHw<gfxProduct>::getCardCriticalPowerLimitNativ
return SysfsValueUnit::micro;
}
template <PRODUCT_FAMILY gfxProduct>
bool SysmanProductHelperHw<gfxProduct>::isDiagnosticsSupported() {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
bool SysmanProductHelperHw<gfxProduct>::isStandbySupported(SysmanKmdInterface *pSysmanKmdInterface) {
return pSysmanKmdInterface->isStandbyModeControlAvailable();

View File

@@ -463,11 +463,6 @@ SysfsValueUnit SysmanProductHelperHw<gfxProduct>::getCardCriticalPowerLimitNativ
return SysfsValueUnit::milli;
}
template <>
bool SysmanProductHelperHw<gfxProduct>::isDiagnosticsSupported() {
return true;
}
template <>
bool SysmanProductHelperHw<gfxProduct>::isUpstreamPortConnected() {
return true;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2024 Intel Corporation
* Copyright (C) 2023-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -14,7 +14,6 @@ namespace L0 {
namespace Sysman {
namespace ult {
uint32_t mockDiagHandleCount = 2;
const std::string mockQuiescentGpuFile("quiesce_gpu");
const std::string mockinvalidateLmemFile("invalidate_lmem_mmaps");
const std::vector<std::string> mockSupportedDiagTypes = {"MOCKSUITE1", "MOCKSUITE2"};

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 Intel Corporation
* Copyright (C) 2023-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -156,7 +156,9 @@ class ZesDiagnosticsFixture : public SysmanDeviceFixture {
}
};
HWTEST2_F(ZesDiagnosticsFixture, GivenComponentCountZeroWhenCallingzesDeviceEnumDiagnosticTestSuitesThenZeroCountIsReturnedAndVerifyzesDeviceEnumDiagnosticTestSuitesCallSucceeds, IsPVC) {
TEST_F(ZesDiagnosticsFixture, GivenComponentCountZeroWhenCallingZesDeviceEnumDiagnosticTestSuitesThenZeroCountIsReturnedAndVerifyZesDeviceEnumDiagnosticTestSuitesCallSucceeds) {
constexpr uint32_t mockDiagHandleCount = 0;
std::vector<zes_diag_handle_t> diagnosticsHandle{};
uint32_t count = 0;
@@ -177,15 +179,20 @@ HWTEST2_F(ZesDiagnosticsFixture, GivenComponentCountZeroWhenCallingzesDeviceEnum
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(count, mockDiagHandleCount);
}
std::unique_ptr<L0::Sysman::DiagnosticsImp> ptestDiagnosticsImp = std::make_unique<L0::Sysman::DiagnosticsImp>(pSysmanDeviceImp->pDiagnosticsHandleContext->pOsSysman, mockSupportedDiagTypes[0]);
pSysmanDeviceImp->pDiagnosticsHandleContext->handleList.push_back(std::move(ptestDiagnosticsImp));
result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, nullptr);
TEST_F(ZesDiagnosticsFixture, GivenOneSupportedDiagnosticTestWhenCallingZesDeviceEnumDiagnosticTestSuitesThenOneCountIsReturnedAndVerifyZesDeviceEnumDiagnosticTestSuitesCallSucceeds) {
constexpr uint32_t mockDiagHandleCount = 1;
std::vector<zes_diag_handle_t> diagnosticsHandle{};
uint32_t count = 0;
pSysmanDeviceImp->pDiagnosticsHandleContext->supportedDiagTests.push_back(mockSupportedDiagTypes[0]);
ze_result_t result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(count, mockDiagHandleCount);
testCount = count;
uint32_t testCount = count;
diagnosticsHandle.resize(testCount);
result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &testCount, diagnosticsHandle.data());
@@ -197,30 +204,6 @@ HWTEST2_F(ZesDiagnosticsFixture, GivenComponentCountZeroWhenCallingzesDeviceEnum
pSysmanDeviceImp->pDiagnosticsHandleContext->handleList.pop_back();
}
HWTEST2_F(ZesDiagnosticsFixture, GivenComponentCountZeroWhenCallingzesDeviceEnumDiagnosticTestSuitesThenZeroCountIsReturnedAndVerifyzesDeviceEnumDiagnosticTestSuitesCallSucceeds, IsNotPVC) {
mockDiagHandleCount = 0;
std::vector<zes_diag_handle_t> diagnosticsHandle{};
uint32_t count = 0;
ze_result_t result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(count, mockDiagHandleCount);
uint32_t testCount = count + 1;
result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &testCount, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(testCount, count);
diagnosticsHandle.resize(count);
result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, diagnosticsHandle.data());
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(count, mockDiagHandleCount);
}
TEST_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleWhenGettingDiagnosticsPropertiesThenCallSucceeds) {
clearAndReinitHandles();
@@ -727,7 +710,9 @@ TEST_F(ZesDiagnosticsFixture, GivenValidSysmanImpPointerWhenCallingReleaseSysman
EXPECT_EQ(ZE_RESULT_SUCCESS, pLinuxSysmanImp->reInitSysmanDeviceResources());
}
HWTEST2_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleAndHandleCountZeroWhenCallingReInitThenValidCountIsReturnedAndVerifyzesDeviceEnumDiagnosticTestSuitesSucceeds, IsPVC) {
TEST_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleAndHandleCountZeroWhenCallingReInitThenZeroCountIsReturnedAndVerifyZesDeviceEnumDiagnosticTestSuitesSucceeds) {
constexpr uint32_t mockDiagHandleCount = 0;
uint32_t count = 0;
ze_result_t result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
@@ -745,25 +730,6 @@ HWTEST2_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleAndHandleCountZeroWh
EXPECT_EQ(count, mockDiagHandleCount);
}
HWTEST2_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleAndHandleCountZeroWhenCallingReInitThenValidCountIsReturnedAndVerifyzesDeviceEnumDiagnosticTestSuitesSucceeds, IsNotPVC) {
uint32_t count = 0;
mockDiagHandleCount = 0;
ze_result_t result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(count, mockDiagHandleCount);
pSysmanDeviceImp->pDiagnosticsHandleContext->handleList.clear();
pSysmanDeviceImp->pDiagnosticsHandleContext->supportedDiagTests.clear();
pLinuxSysmanImp->diagnosticsReset = false;
pLinuxSysmanImp->reInitSysmanDeviceResources();
count = 0;
result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(count, mockDiagHandleCount);
}
} // namespace ult
} // namespace Sysman
} // namespace L0

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -21,15 +21,7 @@ const std::string LinuxDiagnosticsImp::deviceDir("device");
const std::string LinuxDiagnosticsImp::invalidateLmemFile("invalidate_lmem_mmaps");
// the sysfs node will be at /sys/class/drm/card<n>/quiesce_gpu
const std::string LinuxDiagnosticsImp::quiescentGpuFile("quiesce_gpu");
void OsDiagnostics::getSupportedDiagTestsFromFW(void *pOsSysman, std::vector<std::string> &supportedDiagTests) {
LinuxSysmanImp *pLinuxSysmanImp = static_cast<LinuxSysmanImp *>(pOsSysman);
if (IGFX_PVC == SysmanDeviceImp::getProductFamily(pLinuxSysmanImp->getDeviceHandle())) {
FirmwareUtil *pFwInterface = pLinuxSysmanImp->getFwUtilInterface();
if (pFwInterface != nullptr) {
static_cast<FirmwareUtil *>(pFwInterface)->fwSupportedDiagTests(supportedDiagTests);
}
}
}
void OsDiagnostics::getSupportedDiagTestsFromFW(void *pOsSysman, std::vector<std::string> &supportedDiagTests) {}
// before running diagnostics need to close all active workloads
// writing 1 to /sys/class/drm/card<n>/quiesce_gpu will signal KMD

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2024 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -12,7 +12,6 @@
namespace L0 {
namespace ult {
uint32_t mockDiagHandleCount = 2;
const std::string mockQuiescentGpuFile("quiesce_gpu");
const std::string mockinvalidateLmemFile("invalidate_lmem_mmaps");
const std::vector<std::string> mockSupportedDiagTypes = {"MOCKSUITE1", "MOCKSUITE2"};

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2024 Intel Corporation
* Copyright (C) 2020-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -160,7 +160,9 @@ class ZesDiagnosticsFixture : public SysmanDeviceFixture {
}
};
HWTEST2_F(ZesDiagnosticsFixture, GivenComponentCountZeroWhenCallingzesDeviceEnumDiagnosticTestSuitesThenZeroCountIsReturnedAndVerifyzesDeviceEnumDiagnosticTestSuitesCallSucceeds, IsPVC) {
TEST_F(ZesDiagnosticsFixture, GivenComponentCountZeroWhenCallingZesDeviceEnumDiagnosticTestSuitesThenZeroCountIsReturnedAndVerifyZesDeviceEnumDiagnosticTestSuitesCallSucceeds) {
constexpr uint32_t mockDiagHandleCount = 0;
std::vector<zes_diag_handle_t> diagnosticsHandle{};
uint32_t count = 0;
@@ -181,15 +183,20 @@ HWTEST2_F(ZesDiagnosticsFixture, GivenComponentCountZeroWhenCallingzesDeviceEnum
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(count, mockDiagHandleCount);
}
std::unique_ptr<DiagnosticsImp> ptestDiagnosticsImp = std::make_unique<DiagnosticsImp>(pSysmanDeviceImp->pDiagnosticsHandleContext->pOsSysman, mockSupportedDiagTypes[0]);
pSysmanDeviceImp->pDiagnosticsHandleContext->handleList.push_back(std::move(ptestDiagnosticsImp));
result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, nullptr);
TEST_F(ZesDiagnosticsFixture, GivenOneSupportedDiagnosticTestWhenCallingZesDeviceEnumDiagnosticTestSuitesThenOneCountIsReturnedAndVerifyZesDeviceEnumDiagnosticTestSuitesCallSucceeds) {
constexpr uint32_t mockDiagHandleCount = 1;
std::vector<zes_diag_handle_t> diagnosticsHandle{};
uint32_t count = 0;
pSysmanDeviceImp->pDiagnosticsHandleContext->supportedDiagTests.push_back(mockSupportedDiagTypes[0]);
ze_result_t result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(count, mockDiagHandleCount);
testCount = count;
uint32_t testCount = count;
diagnosticsHandle.resize(testCount);
result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &testCount, diagnosticsHandle.data());
@@ -201,30 +208,6 @@ HWTEST2_F(ZesDiagnosticsFixture, GivenComponentCountZeroWhenCallingzesDeviceEnum
pSysmanDeviceImp->pDiagnosticsHandleContext->handleList.pop_back();
}
HWTEST2_F(ZesDiagnosticsFixture, GivenComponentCountZeroWhenCallingzesDeviceEnumDiagnosticTestSuitesThenZeroCountIsReturnedAndVerifyzesDeviceEnumDiagnosticTestSuitesCallSucceeds, IsNotPVC) {
mockDiagHandleCount = 0;
std::vector<zes_diag_handle_t> diagnosticsHandle{};
uint32_t count = 0;
ze_result_t result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(count, mockDiagHandleCount);
uint32_t testCount = count + 1;
result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &testCount, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(testCount, count);
diagnosticsHandle.resize(count);
result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, diagnosticsHandle.data());
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(count, mockDiagHandleCount);
}
TEST_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleWhenGettingDiagnosticsPropertiesThenCallSucceeds) {
clearAndReinitHandles();
@@ -777,7 +760,9 @@ TEST_F(ZesDiagnosticsFixture, GivenSysmanImpPointerWhenCallingReleaseResourcesTh
EXPECT_NE(nullptr, executionEnvironment->memoryManager->getGfxPartition(rootIndex));
}
HWTEST2_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleAndHandleCountZeroWhenCallingReInitThenValidCountIsReturnedAndVerifyzesDeviceEnumDiagnosticTestSuitesSucceeds, IsPVC) {
TEST_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleAndHandleCountZeroWhenCallingReInitThenZeroCountIsReturnedAndVerifyZesDeviceEnumDiagnosticTestSuitesSucceeds) {
constexpr uint32_t mockDiagHandleCount = 0;
uint32_t count = 0;
ze_result_t result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
@@ -795,24 +780,5 @@ HWTEST2_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleAndHandleCountZeroWh
EXPECT_EQ(count, mockDiagHandleCount);
}
HWTEST2_F(ZesDiagnosticsFixture, GivenValidDiagnosticsHandleAndHandleCountZeroWhenCallingReInitThenValidCountIsReturnedAndVerifyzesDeviceEnumDiagnosticTestSuitesSucceeds, IsNotPVC) {
uint32_t count = 0;
mockDiagHandleCount = 0;
ze_result_t result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(count, mockDiagHandleCount);
pSysmanDeviceImp->pDiagnosticsHandleContext->handleList.clear();
pSysmanDeviceImp->pDiagnosticsHandleContext->supportedDiagTests.clear();
pLinuxSysmanImp->diagnosticsReset = false;
pLinuxSysmanImp->reInitSysmanDeviceResources();
count = 0;
result = zesDeviceEnumDiagnosticTestSuites(device->toHandle(), &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(count, mockDiagHandleCount);
}
}; // namespace ult
}; // namespace L0