diff --git a/amdsmi_cli/amdsmi_commands.py b/amdsmi_cli/amdsmi_commands.py index 2c356dd9bc..ac67a2aedd 100644 --- a/amdsmi_cli/amdsmi_commands.py +++ b/amdsmi_cli/amdsmi_commands.py @@ -5773,7 +5773,7 @@ class AMDSMICommands(): if 'cu_occupancy' in process_info: try: cu_occupancy = process_info['cu_occupancy'] - if num_compute_units != "N/A" and num_compute_units > 0: + if num_compute_units != "N/A" and num_compute_units > 0 and cu_occupancy != "N/A": cu_percentage = round((cu_occupancy / num_compute_units) * 100, 1) process_info['cu_occupancy'] = self.helpers.unit_format(self.logger, cu_percentage, diff --git a/py-interface/amdsmi_interface.py b/py-interface/amdsmi_interface.py index b6d27ac62f..ecf3b39e01 100644 --- a/py-interface/amdsmi_interface.py +++ b/py-interface/amdsmi_interface.py @@ -2690,7 +2690,7 @@ def amdsmi_get_gpu_process_list( "cpu_mem": process_list[index].memory_usage.cpu_mem, "vram_mem": process_list[index].memory_usage.vram_mem, }, - "cu_occupancy": process_list[index].cu_occupancy + "cu_occupancy": _validate_if_max_uint(process_list[index].cu_occupancy, MaxUIntegerTypes.UINT32_T) }) return result