[SWDEV-520754] Fixed unboundLocalError for Mulit-VF (#225)

Change-Id: Ib1c0826342a5882fde6ddd4f06f058462226b82d

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>

[ROCm/amdsmi commit: 307de69149]
Этот коммит содержится в:
Arif, Maisam
2025-04-01 11:21:56 -05:00
коммит произвёл GitHub
родитель 0114eca2b1
Коммит 2ea49b6b33
+7 -7
Просмотреть файл
@@ -1516,7 +1516,7 @@ class AMDSMICommands():
gpu_metric_version_str = json.dumps(gpu_metric_version_info, indent=4)
logging.debug("GPU Metrics table Version for GPU %s | %s", gpu_id, gpu_metric_version_str)
except amdsmi_exception.AmdSmiLibraryException as e:
logging.debug("Unable to load GPU Metrics table version for %s | %s", gpu_id, e.err_info)
logging.debug("Unable to load GPU Metrics table version for GPU %s | %s", gpu_id, e.err_info)
try:
# Get GPU Metrics table
@@ -1844,7 +1844,7 @@ class AMDSMICommands():
clocks[gfx_index]["clk_locked"] = "ENABLED"
else:
clocks[gfx_index]["clk_locked"] = "DISABLED"
except KeyError as e:
except Exception as e:
logging.debug("Failed to get current_gfxclks for gpu %s | %s", gpu_id, e)
# Populate MEM clock value
@@ -1854,7 +1854,7 @@ class AMDSMICommands():
clocks["mem_0"]["clk"] = self.helpers.unit_format(self.logger,
current_mem_clock,
clock_unit)
except KeyError as e:
except Exception as e:
logging.debug("Failed to get current_uclk for gpu %s | %s", gpu_id, e)
# Populate VCLK clock values
@@ -1869,7 +1869,7 @@ class AMDSMICommands():
clocks[vclk_index]["clk"] = self.helpers.unit_format(self.logger,
current_vclk_clock,
clock_unit)
except KeyError as e:
except Exception as e:
logging.debug("Failed to get current_vclk0s for gpu %s | %s", gpu_id, e)
# Populate DCLK clock values
@@ -1884,7 +1884,7 @@ class AMDSMICommands():
clocks[dclk_index]["clk"] = self.helpers.unit_format(self.logger,
current_dclk_clock,
clock_unit)
except KeyError as e:
except Exception as e:
logging.debug("Failed to get current_dclk0s for gpu %s | %s", gpu_id, e)
# Populate FCLK clock value; fclk not present in gpu_metrics so use amdsmi_get_clk_freq
@@ -1904,7 +1904,7 @@ class AMDSMICommands():
clocks["socclk_0"]["clk"] = self.helpers.unit_format(self.logger,
current_socclk_clock,
clock_unit)
except KeyError as e:
except Exception as e:
logging.debug("Failed to get current_socclk for gpu %s | %s", gpu_id, e)
# Populate the max and min clock values from sysfs
@@ -5063,7 +5063,7 @@ class AMDSMICommands():
gpu_metric_version_str = json.dumps(gpu_metric_version_info, indent=4)
logging.debug("GPU Metrics table Version for GPU %s | %s", gpu_id, gpu_metric_version_str)
except amdsmi_exception.AmdSmiLibraryException as e:
logging.debug("Unable to load GPU Metrics table version for %s | %s", gpu_id, e.err_info)
logging.debug("Unable to load GPU Metrics table version for GPU %s | %s", gpu_id, e.err_info)
try:
# Get GPU Metrics table