From a28df4a24266c736bcf2554eba4b1c6855392ec7 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Sun, 24 Sep 2023 02:54:06 -0500 Subject: [PATCH] Added all option to gpu selection Change-Id: Ifcb49d66239c54fd3a214f4782321bbcc59e057a Signed-off-by: Maisam Arif --- amdsmi_cli/amdsmi_helpers.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/amdsmi_cli/amdsmi_helpers.py b/amdsmi_cli/amdsmi_helpers.py index fc25e42eb5..8b88c10c05 100644 --- a/amdsmi_cli/amdsmi_helpers.py +++ b/amdsmi_cli/amdsmi_helpers.py @@ -151,7 +151,11 @@ class AMDSMIHelpers(): "UUID": uuid, "Device Handle": device_handle, } - gpu_choices_str += f"ID:{gpu_id:<2} | BDF:{bdf} | UUID:{uuid}\n" + gpu_choices_str += f"ID:{gpu_id} | BDF:{bdf} | UUID:{uuid}\n" + + # Add the all option to the gpu_choices + gpu_choices["all"] = "all" + gpu_choices_str += " all | Selects all devices\n" return (gpu_choices, gpu_choices_str) @@ -168,6 +172,9 @@ class AMDSMIHelpers(): amdsmi device_handles (False, str): Return False, and the first input that failed to be converted """ + if gpu_selections == ["all"]: + return (True, amdsmi_interface.amdsmi_get_processor_handles()) + if isinstance(gpu_selections, str): gpu_selections = [gpu_selections]