From 35b9c40c7dcc214b9519bd0b739383719be362a1 Mon Sep 17 00:00:00 2001 From: AravindanC Date: Thu, 30 Mar 2023 08:08:41 -0700 Subject: [PATCH 1/2] SWDEV-351540 - ASAN packaging for amd-smi added amdsmi_cli and py-interface under dev comp Change-Id: Ifa7a2e5e280f2d0ef8868c63cd4ba94ca75a3468 --- amdsmi_cli/CMakeLists.txt | 9 ++++++--- py-interface/CMakeLists.txt | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/amdsmi_cli/CMakeLists.txt b/amdsmi_cli/CMakeLists.txt index 5abe1e4599..02ebc213f7 100644 --- a/amdsmi_cli/CMakeLists.txt +++ b/amdsmi_cli/CMakeLists.txt @@ -48,11 +48,13 @@ add_custom_target( install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PY_PACKAGE_DIR} - DESTINATION ${PY_CLI_INSTALL_DIR}) + DESTINATION ${PY_CLI_INSTALL_DIR} + COMPONENT dev) install( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PY_PACKAGE_DIR}/amdsmi_cli.py - DESTINATION ${PY_CLI_INSTALL_DIR}/${PY_PACKAGE_DIR}) + DESTINATION ${PY_CLI_INSTALL_DIR}/${PY_PACKAGE_DIR} + COMPONENT dev) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) @@ -73,4 +75,5 @@ add_custom_target( install( FILES ${CMAKE_CURRENT_BINARY_DIR}/bin/amd-smi ${CMAKE_CURRENT_BINARY_DIR}/bin/gpuv-smi - DESTINATION ${CMAKE_INSTALL_BINDIR}) + DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT dev) diff --git a/py-interface/CMakeLists.txt b/py-interface/CMakeLists.txt index 666293f39f..2c2ebd5e89 100644 --- a/py-interface/CMakeLists.txt +++ b/py-interface/CMakeLists.txt @@ -103,8 +103,10 @@ add_custom_target( install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${PY_BUILD_DIR}/pyproject.toml - DESTINATION ${PY_WRAPPER_INSTALL_DIR}) + DESTINATION ${PY_WRAPPER_INSTALL_DIR} + COMPONENT dev) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PY_PACKAGE_DIR} - DESTINATION ${PY_WRAPPER_INSTALL_DIR}) + DESTINATION ${PY_WRAPPER_INSTALL_DIR} + COMPONENT dev) From 452bffb6b4533a06252029769ce7566e472244d1 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Thu, 30 Mar 2023 10:07:46 -0500 Subject: [PATCH 2/2] CI Build directory fix Signed-off-by: Maisam Arif Change-Id: I7600c3c4c2fd45ca240ee8ec04de55dc29c26365 --- amdsmi_cli/amdsmi_commands.py | 40 +++++++++++++++++------------------ amdsmi_cli/amdsmi_parser.py | 1 + py-interface/_version.py | 2 +- src/CMakeLists.txt | 2 +- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/amdsmi_cli/amdsmi_commands.py b/amdsmi_cli/amdsmi_commands.py index 2e4281e76e..257d956745 100644 --- a/amdsmi_cli/amdsmi_commands.py +++ b/amdsmi_cli/amdsmi_commands.py @@ -113,9 +113,9 @@ class AMDSMICommands(): # Handle multiple GPUs handled_multiple_gpus, device_handle = self.helpers.handle_gpus(args, self.logger, self.discovery) if handled_multiple_gpus: - return - else: - args.gpu = device_handle + return # This function is recursive + + args.gpu = device_handle try: bdf = amdsmi_interface.amdsmi_get_device_bdf(args.gpu) @@ -197,9 +197,9 @@ class AMDSMICommands(): # Handle multiple GPUs handled_multiple_gpus, device_handle = self.helpers.handle_gpus(args, self.logger, self.static) if handled_multiple_gpus: - return - else: - args.gpu = device_handle + return # This function is recursive + + args.gpu = device_handle # If all arguments are False, it means that no argument was passed and the entire static should be printed if not any([args.asic, args.bus, args.vbios, args.limit, args.driver, args.caps, args.ras, args.board]): @@ -375,9 +375,9 @@ class AMDSMICommands(): # Handle multiple GPUs handled_multiple_gpus, device_handle = self.helpers.handle_gpus(args, self.logger, self.firmware) if handled_multiple_gpus: - return - else: - args.gpu = device_handle + return # This function is recursive + + args.gpu = device_handle values_dict = {} @@ -453,9 +453,9 @@ class AMDSMICommands(): # Handle multiple GPUs handled_multiple_gpus, device_handle = self.helpers.handle_gpus(args, self.logger, self.bad_pages) if handled_multiple_gpus: - return - else: - args.gpu = device_handle + return # This function is recursive + + args.gpu = device_handle # If all arguments are False, the print all bad_page information if not any([args.retired, args.pending, args.un_res]): @@ -846,7 +846,7 @@ class AMDSMICommands(): od_volt = amdsmi_interface.amdsmi_dev_get_od_volt_info(args.gpu) voltage_curve_error = False except amdsmi_exception.AmdSmiLibraryException as e: - od_volt = None; + od_volt = None values_dict["voltage_curve"] = e.get_error_info() voltage_curve_error = True @@ -1140,7 +1140,7 @@ class AMDSMICommands(): print('EVENT LISTENING:\n') print('Press q and hit ENTER when you want to stop (listening will stop inside 10 seconds)') - threads = list() + threads = [] for i in range(len(self.device_handles)): x = threading.Thread(target=self._event_thread, args=(self, i)) threads.append(x) @@ -1304,9 +1304,9 @@ class AMDSMICommands(): # Handle multiple GPUs handled_multiple_gpus, device_handle = self.helpers.handle_gpus(args, self.logger, self.set_value) if handled_multiple_gpus: - return - else: - args.gpu = device_handle + return # This function is recursive + + args.gpu = device_handle if args.clock: clock_type, freq_bitmask = args.clock @@ -1591,9 +1591,9 @@ class AMDSMICommands(): # Handle multiple GPUs handled_multiple_gpus, device_handle = self.helpers.handle_gpus(args, self.logger, self.reset) if handled_multiple_gpus: - return - else: - args.gpu = device_handle + return # This function is recursive + + args.gpu = device_handle if args.gpureset: if self.helpers.is_amd_device(args.gpu): diff --git a/amdsmi_cli/amdsmi_parser.py b/amdsmi_cli/amdsmi_parser.py index 0e234ea338..26ea86070e 100644 --- a/amdsmi_cli/amdsmi_parser.py +++ b/amdsmi_cli/amdsmi_parser.py @@ -539,6 +539,7 @@ class AMDSMIParser(argparse.ArgumentParser): def _add_topology_parser(self, subparsers, func): + return if not(self.amdsmi_helpers.is_baremetal() and self.amdsmi_helpers.is_linux()): # This subparser is only applicable to Baremetal Linux return diff --git a/py-interface/_version.py b/py-interface/_version.py index b3c06d4883..a0235ce508 100644 --- a/py-interface/_version.py +++ b/py-interface/_version.py @@ -1 +1 @@ -__version__ = "0.0.1" \ No newline at end of file +__version__ = "0.0.2" \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 908502098c..48cc43ecc6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -120,7 +120,7 @@ install( install( FILES ${PROJECT_SOURCE_DIR}/include/amd_smi/amdsmi.h - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amd_smii + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amd_smi COMPONENT dev) install( FILES ${PROJECT_SOURCE_DIR}/include/amd_smi/${AMD_SMI_TARGET}Config.h