ROCm SMI CLI: Fix --showproductname bug

This patch fixes a --showproductname bug, which is related to the
device's SKU. If a device with a VBIOS value that cannot be decoded
is used, that device's SKU cannot be parsed out of the VBIOS string.

Now, when the VBIOS value cannot be decoded, an error will be
printed instead of crashing with an 'UnboundLocalError' message.

Signed-off-by: Ori Messinger <Ori.Messinger@amd.com>
Change-Id: I680a182e94107e782235b8a2477ab165988f7703


[ROCm/amdsmi commit: 56f9d6bfc0]
Este cometimento está contido em:
Ori Messinger cometeu 2023-02-02 14:52:13 -05:00
1 ascendente 34370a2639
cometimento f9ad5fe706
1 ficheiro modificado
+3 -1
+3 -1
Ver ficheiro
@@ -2069,7 +2069,9 @@ def showProductName(deviceList):
device_sku = vbios.value.decode().split('-')[1]
else:
device_sku = 'unknown'
printLog(device, 'Card SKU', '\t\t' + device_sku)
printLog(device, 'Card SKU', '\t\t' + device_sku)
else:
printErrLog(device, "Unable to decode VBIOS value for device SKU")
else:
printLog(device, 'Incompatible device.\n' \
'GPU[%s]\t\t: Expected vendor name: Advanced Micro Devices, Inc. [AMD/ATI]\n' \