From f707990d4946f19065ae62e85eeb353e723359d6 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Thu, 5 Dec 2024 15:18:13 -0600 Subject: [PATCH] Added gpu_metrics table debug logs in monitor Signed-off-by: Maisam Arif Change-Id: I8aa96629a65df7a2d52ef9ed42a884732d097a54 [ROCm/amdsmi commit: bc3ac61641f58491b29330dd9f3683e6a6927fb7] --- projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index 79971db3a4..1632d6a6fc 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -4717,6 +4717,23 @@ class AMDSMICommands(): self.logger.store_output(args.gpu, 'timestamp', int(time.time())) self.logger.table_header = 'TIMESTAMP'.rjust(10) + ' ' + self.logger.table_header + if args.loglevel == "DEBUG": + try: + # Get GPU Metrics table version + gpu_metric_version_info = amdsmi_interface.amdsmi_get_gpu_metrics_header_info(args.gpu) + gpu_metric_version_str = json.dumps(gpu_metric_version_info, indent=4) + logging.debug("GPU Metrics table Version for GPU %s | %s", gpu_id, gpu_metric_version_str) + except amdsmi_exception.AmdSmiLibraryException as e: + logging.debug("Unable to load GPU Metrics table version for %s | %s", gpu_id, e.err_info) + + try: + # Get GPU Metrics table + gpu_metric_debug_info = amdsmi_interface.amdsmi_get_gpu_metrics_info(args.gpu) + gpu_metric_str = json.dumps(gpu_metric_debug_info, indent=4) + logging.debug("GPU Metrics table for GPU %s | %s", gpu_id, str(gpu_metric_str)) + except amdsmi_exception.AmdSmiLibraryException as e: + logging.debug("Unable to load GPU Metrics table for %s | %s", gpu_id, e.err_info) + # Store the pcie_bw values due to possible increase in bandwidth due to repeated gpu_metrics calls if args.pcie: try: