Check FRU-based product information if available

WKS and server cards have an FRU with product information, so try to use
that for product name and product SKU if it exists.

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I40bbd3bf62f4cb02e96015ed1630112691cacbc3


[ROCm/rocm_smi_lib commit: df7c3434cd]
Bu işleme şunda yer alıyor:
Kent Russell
2020-09-23 13:40:47 -04:00
ebeveyn 624f906f07
işleme e432b4e9e3
5 değiştirilmiş dosya ile 79 ekleme ve 9 silme
+9 -7
Dosyayı Görüntüle
@@ -1621,13 +1621,15 @@ def showProductName(deviceList):
device_model = model.value.decode()
printLog(device, 'Card model', '\t\t' + device_model)
printLog(device, 'Card vendor', '\t\t' + device_vendor)
# Retrieve the device SKU from VBIOS
ret = rocmsmi.rsmi_dev_vbios_version_get(device, vbios, 256)
if rsmi_ret_ok(ret, device) and vbios.value.decode():
# Device SKU is just 6 characters after the first occurance of '-' in vbios_version
# TODO: Use Product Info sysfs where possible
device_sku = vbios.value.decode().split('-')[1][:6]
printLog(device, 'Card SKU', '\t\t' + device_sku)
# Retrieve the SKU
ret = rocmsmi.rsmi_dev_sku_get(device, device_sku, 256)
if not rsmi_ret_ok(ret, device) or not device_sku.value.decode():
# Retrieve the device SKU from VBIOS if product_number doesn't exist
ret = rocmsmi.rsmi_dev_vbios_version_get(device, vbios, 256)
if rsmi_ret_ok(ret, device) and vbios.value.decode():
# Device SKU is just 6 characters after the first occurance of '-' in vbios_version
device_sku = vbios.value.decode().split('-')[1][:6]
printLog(device, 'Card SKU', '\t\t' + device_sku)
else:
printLog(device, 'Incompatible device.\n' \
'GPU[%s]\t\t: Expected vendor name: Advanced Micro Devices, Inc. [AMD/ATI]\n'\