Add fix to display correct GPU Memory Activity and GFX Activity value.

Driver mem fills in 0xFF for all for the metrices not supported for that ASIC.
So if 0xFF is detected, return RSMI_STATUS_NOT_SUPPORTED

Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: I86a38148c7a288ea0db94893f685560eaac098ab


[ROCm/amdsmi commit: 7b1daaef96]
This commit is contained in:
Divya Shikre
2021-11-24 13:49:43 -05:00
parent 73f8cb0c71
commit 58b5a538a7
2 changed files with 14 additions and 3 deletions
+6 -1
View File
@@ -1604,7 +1604,7 @@ def getCoarseGrainUtil(device, typeName=None):
utilization_counters[i].type = c_int(i)
ret = rocmsmi.rsmi_utilization_count_get(device, utilization_counters, length, byref(timestamp))
if rsmi_ret_ok(ret, device):
if rsmi_ret_ok(ret, device, typeName, True):
return utilization_counters
return -1
@@ -1624,6 +1624,9 @@ def showGpuUse(deviceList):
if util_counters != -1:
for ut_counter in util_counters:
printLog(device, utilization_counter_name[ut_counter.type], ut_counter.val)
else:
printLog(device, 'GFX Activity', 'N/A')
printLogSpacer()
@@ -1713,6 +1716,8 @@ def showMemUse(deviceList):
if util_counters != -1:
for ut_counter in util_counters:
printLog(device, utilization_counter_name[ut_counter.type], ut_counter.val)
else:
printLog(device, 'Memory Activity', 'N/A')
printLogSpacer()