Skip TestFrequenciesReadWrite for unsupported ASICs

For ASICs NAVI10 and above setting display clock [DCEFCLK] is not supported and the sysfs entry is
read-only. As a result, the test falsely fails for these ASICs. ROCm SMI Lib is ASIC independent.
So Display clock set cannot be selectively disabled for these ASICs.

As a compromise if the set (write to sysfs entry) fails due to permission error and euid is root,
assume that set feature is not supported and skip the test.

Change-Id: I7a273878cbf1465b01728705323e8a92a42378dd


[ROCm/rocm_smi_lib commit: c6f695f5a9]
Этот коммит содержится в:
Sreekant Somasekharan
2021-11-22 14:36:29 -05:00
коммит произвёл Sreekant Somasekharan
родитель c23694e66a
Коммит 835f43311a
+8 -1
Просмотреть файл
@@ -141,8 +141,15 @@ void TestFrequenciesReadWrite::Run(void) {
std::endl;
}
ret = rsmi_dev_gpu_clk_freq_set(dv_ind, rsmi_clk, freq_bitmask);
//Certain ASICs does not allow to set particular clocks. If set function for a clock returns
//permission error despite root access, manually set ret value to success and return
if (ret == RSMI_STATUS_PERMISSION && geteuid() == 0) {
std::cout << "\t**Set " << FreqEnumToStr(rsmi_clk) <<
": Not supported on this machine. Skipping..." << std::endl;
ret = RSMI_STATUS_SUCCESS;
return;
}
CHK_ERR_ASRT(ret)
ret = rsmi_dev_gpu_clk_freq_get(dv_ind, rsmi_clk, &f);
if (ret != RSMI_STATUS_SUCCESS) {
return;