From ca07577907027c259754d8fd47892d0552010d09 Mon Sep 17 00:00:00 2001 From: Alex Sierra Date: Fri, 26 Aug 2022 20:51:24 +0000 Subject: [PATCH] Consider invalid peer link type during topology report Invalid peer links are labeled as N/A during topology report creation. This invalid link type could be triggered by having a configuration with CPU XGMI iolinks and disable XGMI peer to peer access. This can be done by setting the driver parameter 'use_xgmi_p2p = 0'. Signed-off-by: Alex Sierra Change-Id: Ifb09a8f3266a3f07686615dfb45781d6cfe55e83 [ROCm/amdsmi commit: 03fab6b2b63a74e55659ed3a92d987c68a9d4bd2] --- projects/amdsmi/python_smi_tools/rocm_smi.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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