From 5e4f1bb2452fbf05ab4423c412447e6766e02163 Mon Sep 17 00:00:00 2001 From: "Arif, Maisam" Date: Fri, 21 Feb 2025 19:15:18 -0600 Subject: [PATCH] Updated amdsmi_get_driver_info() to handle empty strings (#126) Signed-off-by: Maisam Arif [ROCm/amdsmi commit: 9d2bbcf14d1fb4335682f542c361af953a71f397] --- projects/amdsmi/amdsmi_cli/amdsmi_parser.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_parser.py b/projects/amdsmi/amdsmi_cli/amdsmi_parser.py index f7ec51f3b6..f88c787e4d 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_parser.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_parser.py @@ -817,7 +817,7 @@ class AMDSMIParser(argparse.ArgumentParser): perf_level_help = "Current DPM performance level" xgmi_err_help = "XGMI error information since last read" energy_help = "Amount of energy consumed" - throttle_help = "Displays throttle accumulators; Only available for MI300 or newer ASICs" + throttle_help = "Displays throttle accumulators;\n Only available for MI300 or newer ASICs" # Help text for Arguments only on Hypervisors schedule_help = "All scheduling information" diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 3dded49a90..91c18858c2 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2297,12 +2297,18 @@ def amdsmi_get_gpu_driver_info( ) ) - return { + driver_info = { "driver_name": info.driver_name.decode("utf-8"), "driver_version": info.driver_version.decode("utf-8"), "driver_date": info.driver_date.decode("utf-8") } + for key, value in driver_info.items(): + if value == "": + driver_info[key] = "N/A" + + return driver_info + def amdsmi_get_power_info( processor_handle: amdsmi_wrapper.amdsmi_processor_handle,