From a6183e3ca7f72228837d67a0d96d5c53e157c02f Mon Sep 17 00:00:00 2001 From: Dmitrii <19967783+dmitrii-galantsev@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:59:20 -0600 Subject: [PATCH] [amdsmi] Dont crash on node handle error (#2206) Signed-off-by: Galantsev, Dmitrii --- projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index 411b348b83..fed4a538e6 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -82,13 +82,11 @@ class AMDSMICommands(): nh = amdsmi_interface.amdsmi_get_node_handle(dev) if nh is not None: self.node_handle = nh - continue + # Only need one handle, break after first success + break except amdsmi_exception.AmdSmiLibraryException as e: - if e.err_code in (amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_NOT_SUPPORTED, - amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_INVAL): - logging.debug("Unable to get node handle: %s", e.get_error_info()) - else: - raise e + logging.debug("Unable to get node handle: %s", e.get_error_info()) + # Node handle functionality is optional, so don't raise an error if self.helpers.is_amd_hsmp_initialized(): try: