Skip to content

Commit c0bb6f9

Browse files
authored
Updated amdsmi_get_driver_info() to handle empty strings (#126)
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com> [ROCm/amdsmi commit: 9d2bbcf]
1 parent 57e94a6 commit c0bb6f9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

projects/amdsmi/amdsmi_cli/amdsmi_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ def _add_metric_parser(self, subparsers, func):
817817
perf_level_help = "Current DPM performance level"
818818
xgmi_err_help = "XGMI error information since last read"
819819
energy_help = "Amount of energy consumed"
820-
throttle_help = "Displays throttle accumulators; Only available for MI300 or newer ASICs"
820+
throttle_help = "Displays throttle accumulators;\n Only available for MI300 or newer ASICs"
821821

822822
# Help text for Arguments only on Hypervisors
823823
schedule_help = "All scheduling information"

projects/amdsmi/py-interface/amdsmi_interface.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2297,12 +2297,18 @@ def amdsmi_get_gpu_driver_info(
22972297
)
22982298
)
22992299

2300-
return {
2300+
driver_info = {
23012301
"driver_name": info.driver_name.decode("utf-8"),
23022302
"driver_version": info.driver_version.decode("utf-8"),
23032303
"driver_date": info.driver_date.decode("utf-8")
23042304
}
23052305

2306+
for key, value in driver_info.items():
2307+
if value == "":
2308+
driver_info[key] = "N/A"
2309+
2310+
return driver_info
2311+
23062312

23072313
def amdsmi_get_power_info(
23082314
processor_handle: amdsmi_wrapper.amdsmi_processor_handle,

0 commit comments

Comments
 (0)