diff --git a/projects/amdsmi/python_smi_tools/rocm_smi.py b/projects/amdsmi/python_smi_tools/rocm_smi.py index bd9fc76edf..73016599e0 100755 --- a/projects/amdsmi/python_smi_tools/rocm_smi.py +++ b/projects/amdsmi/python_smi_tools/rocm_smi.py @@ -2425,6 +2425,8 @@ def showWeightTopology(deviceList): gpu_links_weight[srcdevice][destdevice] = weight else: printErrLog(srcdevice, 'Cannot read Link Weight: Not supported on this machine') + gpu_links_weight[srcdevice][destdevice] = None + if PRINT_JSON: formatMatrixToJSON(deviceList, gpu_links_weight, "(Topology) Weight between DRM devices {} and {}") @@ -2441,6 +2443,8 @@ def showWeightTopology(deviceList): for gpu2 in deviceList: if (gpu1 == gpu2): printTableRow('%-12s', '0') + elif (gpu_links_weight[gpu1][gpu2] == None): + printTableRow('%-12s', 'N/A') else: printTableRow('%-12s', gpu_links_weight[gpu1][gpu2].value) printEmptyLine() @@ -2468,6 +2472,7 @@ def showHopsTopology(deviceList): gpu_links_hops[srcdevice][destdevice] = hops else: printErrLog(srcdevice, 'Cannot read Link Hops: Not supported on this machine') + gpu_links_hops[srcdevice][destdevice] = None if PRINT_JSON: formatMatrixToJSON(deviceList, gpu_links_hops, "(Topology) Hops between DRM devices {} and {}") @@ -2484,6 +2489,8 @@ def showHopsTopology(deviceList): for gpu2 in deviceList: if (gpu1 == gpu2): printTableRow('%-12s', '0') + elif (gpu_links_hops[gpu1][gpu2] == None): + printTableRow('%-12s', 'N/A') else: printTableRow('%-12s', gpu_links_hops[gpu1][gpu2].value) printEmptyLine() @@ -2516,6 +2523,8 @@ def showTypeTopology(deviceList): gpu_links_type[srcdevice][destdevice] = "XXXX" else: printErrLog(srcdevice, 'Cannot read Link Type: Not supported on this machine') + gpu_links_type[srcdevice][destdevice] = "XXXX" + if PRINT_JSON: formatMatrixToJSON(deviceList, gpu_links_type, "(Topology) Link type between DRM devices {} and {}") return