From b47d028da2af7d83e79491fea483e171482b54d5 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Tue, 10 Oct 2023 10:32:20 -0500 Subject: [PATCH] Removed uncountable blocks from metric --ecc-block Signed-off-by: Maisam Arif Change-Id: Iab8ed3f80c8ebd7ffd3bfcf197e1a0b03782b498 --- amdsmi_cli/amdsmi_commands.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/amdsmi_cli/amdsmi_commands.py b/amdsmi_cli/amdsmi_commands.py index 9c5aa09f3e..a243adfd74 100644 --- a/amdsmi_cli/amdsmi_commands.py +++ b/amdsmi_cli/amdsmi_commands.py @@ -1003,19 +1003,22 @@ class AMDSMICommands(): values_dict['ecc'] = ecc_count if args.ecc_block: ecc_dict = {} + uncountable_blocks = ["ATHUB", "DF", "SMN", "SEM", "MP0", "MP1", "FUSE"] try: ras_states = amdsmi_interface.amdsmi_get_gpu_ras_block_features_enabled(args.gpu) for state in ras_states: if state['status'] == amdsmi_interface.AmdSmiRasErrState.ENABLED.name: gpu_block = amdsmi_interface.AmdSmiGpuBlock[state['block']] - try: - ecc_count = amdsmi_interface.amdsmi_get_gpu_ecc_count(args.gpu, gpu_block) - ecc_dict[state['block']] = {'correctable' : ecc_count['correctable_count'], - 'uncorrectable': ecc_count['uncorrectable_count']} - except amdsmi_exception.AmdSmiLibraryException as e: - ecc_dict[state['block']] = {'correctable' : "N/A", - 'uncorrectable': "N/A"} - logging.debug("Failed to get ecc count for gpu %s at block %s | %s", gpu_id, gpu_block, e.get_error_info()) + # if the blocks are uncountable do not add them at all. + if gpu_block.name not in uncountable_blocks: + try: + ecc_count = amdsmi_interface.amdsmi_get_gpu_ecc_count(args.gpu, gpu_block) + ecc_dict[state['block']] = {'correctable' : ecc_count['correctable_count'], + 'uncorrectable': ecc_count['uncorrectable_count']} + except amdsmi_exception.AmdSmiLibraryException as e: + ecc_dict[state['block']] = {'correctable' : "N/A", + 'uncorrectable': "N/A"} + logging.debug("Failed to get ecc count for gpu %s at block %s | %s", gpu_id, gpu_block, e.get_error_info()) values_dict['ecc_block'] = ecc_dict except amdsmi_exception.AmdSmiLibraryException as e: