2
0

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
Este cometimento está contido em:
Divya Shikre
2021-11-24 13:49:43 -05:00
ascendente f61cb1b41d
cometimento 7b1daaef96
2 ficheiros modificados com 14 adições e 3 eliminações
+6 -1
Ver ficheiro
@@ -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()