[SWDEV-543308] Fix xgmi_metrics_info initialization in xgmi

The xgmi_metrics_info variable was being referenced before
assignment when no destination GPUs were found or when the API
call failed. This caused an UnboundLocalError. Fixed this by
initializing xgmi_metrics_info with empty links structure.

Signed-off-by: Bindhiya Kanangot Balakrishnan <Bindhiya.KanangotBalakrishnan@amd.com>


[ROCm/amdsmi commit: f0453c2c75]
Tento commit je obsažen v:
Bindhiya Kanangot Balakrishnan authored and Arif, Maisam committed 2025-08-07 16:19:10 -05:00
1 rodič 79ce271d1f
revize 82a2c0dffc
1 file changed
+1
+1
Zobrazit soubor
@@ -6345,6 +6345,7 @@ class AMDSMICommands():
"link_type" : "N/A",
"links" : []
}
xgmi_metrics_info = {"links": []}
try:
xgmi_metrics_info = amdsmi_interface.amdsmi_get_link_metrics(src_gpu)