--showtempgraph - Show N/A when no temp found
If temp in hwmon was missing - rocm-smi crashed.
e.g. /sys/class/drm/card1/device/hwmon/hwmon5/temp1_input
This change displays "N/A" for temp instead of crashing.
Change-Id: I02f84a466bd3acfbd9b65e7e4ca0f18e76606c3b
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
[ROCm/amdsmi commit: 713f85721b]
Этот коммит содержится в:
@@ -2563,8 +2563,12 @@ def printTempGraph(deviceList, delay):
|
||||
if terminalWidth < originalTerminalWidth:
|
||||
print('Terminal size cannot be decreased.\n\r')
|
||||
return
|
||||
if type(temp) == str:
|
||||
tempString = temp
|
||||
else:
|
||||
tempString = str(int(temp))
|
||||
# Two spare Spaces
|
||||
tempString = (str(int(temp)) + '°C').ljust(5)
|
||||
tempString = (tempString + '°C').ljust(5)
|
||||
printStrings.append('\033[2;30;47mGPU[%d] Temp %s|%s%s\x1b[0m%s' % (device, tempString, color, paddingSpace[1:], remainderSpace))
|
||||
originalTerminalWidth = terminalWidth
|
||||
time.sleep((delay / 1000))
|
||||
|
||||
Ссылка в новой задаче
Block a user