From 4992a7b2bd52ed104ccddd0065b60a8e3cf266be Mon Sep 17 00:00:00 2001 From: "Pham, Gabriel" Date: Mon, 28 Apr 2025 14:35:42 -0500 Subject: [PATCH] [SWDEV-522336] Enabled Topology command in Guest (#304) Enabled Topology command in Guest --------- Signed-off-by: gabrpham_amdeng [ROCm/amdsmi commit: 34678cc0aef632d306846722aba0bae09c7b7bd1] --- projects/amdsmi/CHANGELOG.md | 3 +++ projects/amdsmi/amdsmi_cli/amdsmi_parser.py | 12 ++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/projects/amdsmi/CHANGELOG.md b/projects/amdsmi/CHANGELOG.md index a9f3b6a1f7..169b0c9d9c 100644 --- a/projects/amdsmi/CHANGELOG.md +++ b/projects/amdsmi/CHANGELOG.md @@ -13,6 +13,9 @@ Full documentation for amd_smi_lib is available at [https://rocm.docs.amd.com/pr ### Changed +- **The `amd-smi topology` command has been enabled for Guest environments**. + - `amd-smi topology` is now availabe in Guest environments. This includes full functionality so users can use the command just as they would in Bare Metal environments. + ### Removed ### Optimized diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_parser.py b/projects/amdsmi/amdsmi_cli/amdsmi_parser.py index 5a5e3d2687..0788d988c7 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_parser.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_parser.py @@ -1076,10 +1076,6 @@ class AMDSMIParser(argparse.ArgumentParser): def _add_topology_parser(self, subparsers: argparse._SubParsersAction, func): - if not(self.helpers.is_baremetal() and self.helpers.is_linux()): - # This subparser is only applicable to Baremetal Linux - return - if not self.helpers.is_amdgpu_initialized(): # The topology subcommand is only applicable to systems with amdgpu initialized return @@ -1107,6 +1103,10 @@ class AMDSMIParser(argparse.ArgumentParser): topology_parser.formatter_class=lambda prog: AMDSMISubparserHelpFormatter(prog) topology_parser.set_defaults(func=func) + # Add Universal Arguments + self._add_command_modifiers(topology_parser) + self._add_device_arguments(topology_parser, required=False) + # Optional Args topology_parser.add_argument('-a', '--access', action='store_true', required=False, help=access_help) topology_parser.add_argument('-w', '--weight', action='store_true', required=False, help=weight_help) @@ -1118,10 +1118,6 @@ class AMDSMIParser(argparse.ArgumentParser): topology_parser.add_argument('-d', '--dma', action='store_true', required=False, help=dma_help) topology_parser.add_argument('-z', '--bi-dir', action='store_true', required=False, help=bi_dir_help) - # Add Universal Arguments - self._add_device_arguments(topology_parser, required=False) - self._add_command_modifiers(topology_parser) - def _add_set_value_parser(self, subparsers: argparse._SubParsersAction, func): if not self.helpers.is_linux():