mem_use_pct uninitialized error
Initialize mem_use_pct if the memory info is not available.
Change-Id: Id8e285050149c51077356826c8f99719b473060d
[ROCm/amdsmi commit: fcb6afa289]
Этот коммит содержится в:
@@ -1542,13 +1542,12 @@ def showAllConcise(deviceList):
|
||||
else:
|
||||
gpu_busy = 'Unsupported'
|
||||
memInfo = getMemInfo(device, 'vram')
|
||||
if memInfo[0] == None or memInfo[1] == None or float(memInfo[1]) == 0:
|
||||
mem_use = 'N/A'
|
||||
else:
|
||||
mem_use_pct = 0
|
||||
if memInfo[0] != None and memInfo[1] != None and float(memInfo[1]) != 0:
|
||||
mem_use_pct = '% 3.0f%%' % (100 * (float(memInfo[0]) / float(memInfo[1])))
|
||||
values['card%s' % (str(device))] = [device, temp, avgPwr, sclk, mclk, fan, str(perf).lower(), pwrCap,
|
||||
mem_use_pct, gpu_busy]
|
||||
val_widths = {}
|
||||
val_widths = {}
|
||||
for device in deviceList:
|
||||
val_widths[device] = [len(str(val)) + 2 for val in values['card%s' % (str(device))]]
|
||||
max_widths = head_widths
|
||||
|
||||
Ссылка в новой задаче
Block a user