diff --git a/amdsmi_cli/amdsmi_commands.py b/amdsmi_cli/amdsmi_commands.py index 6a078ffbe6..7ea9ae2573 100644 --- a/amdsmi_cli/amdsmi_commands.py +++ b/amdsmi_cli/amdsmi_commands.py @@ -2631,8 +2631,6 @@ class AMDSMICommands(): try: process_list = amdsmi_interface.amdsmi_get_gpu_process_list(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: - if e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_NO_PERM: - raise PermissionError('Command requires elevation') from e logging.debug("Failed to get process list for gpu %s | %s", gpu_id, e.get_error_info()) raise e diff --git a/include/amd_smi/amdsmi.h b/include/amd_smi/amdsmi.h index 4a1a80721a..df2137f66a 100644 --- a/include/amd_smi/amdsmi.h +++ b/include/amd_smi/amdsmi.h @@ -4830,10 +4830,6 @@ amdsmi_get_gpu_vram_usage(amdsmi_processor_handle processor_handle, amdsmi_vram_ * Holding a copy of max_process before it is passed in will be helpful for monitoring * the allocations done upon each call since the max_process will permanently be changed * to reflect the actual number of processes running. - * Note: For the specific cases where the return status is AMDSMI_STATUS_NO_PERM only. - * The list of process and size are AMDSMI_STATUS_SUCCESS, however there are - * processes details not fully retrieved due to permissions. - * * * @param[out] list Reference to a user-provided buffer where the process * list will be returned. This buffer must contain at least @@ -4841,17 +4837,16 @@ amdsmi_get_gpu_vram_usage(amdsmi_processor_handle processor_handle, amdsmi_vram_ * by user. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, - * | ::AMDSMI_STATUS_NO_PERM on success, but not all details from process retrieved, * | ::AMDSMI_STATUS_OUT_OF_RESOURCES, filled list buffer with data, but number of * actual running processes is larger than the size provided. * */ - // Note: If the reserved size for processes is smaller than the number of - // actual processes running. The AMDSMI_STATUS_OUT_OF_RESOURCES is - // an indication the caller should handle the situation (resize). - // The max_processes is always changed to reflect the actual size of - // list of processes running, so the caller knows where it is at. - // + // Note: If the reserved size for processes is smaller than the number of + // actual processes running. The AMDSMI_STATUS_OUT_OF_RESOURCES is + // an indication the caller should handle the situation (resize). + // The max_processes is always changed to reflect the actual size of + // list of processes running, so the caller knows where it is at. + // amdsmi_status_t amdsmi_get_gpu_process_list(amdsmi_processor_handle processor_handle, uint32_t *max_processes, amdsmi_proc_info_t *list); diff --git a/src/amd_smi/amd_smi.cc b/src/amd_smi/amd_smi.cc index 0d5443eaff..0ae2114762 100644 --- a/src/amd_smi/amd_smi.cc +++ b/src/amd_smi/amd_smi.cc @@ -1889,15 +1889,9 @@ amdsmi_get_gpu_process_list(amdsmi_processor_handle processor_handle, uint32_t * const auto max_processes_original_size(*max_processes); auto idx = uint32_t(0); - auto is_required_previlegies_required(false); for (auto& process : compute_process_list) { if (idx < *max_processes) { list[idx++] = static_cast(process.second); - // Note: If we could not read the process info for an existing process, - // that is likely a permission error. - if (!is_required_previlegies_required && std::string(process.second.name).empty()) { - is_required_previlegies_required = true; - } } else { break; } @@ -1910,11 +1904,9 @@ amdsmi_get_gpu_process_list(amdsmi_processor_handle processor_handle, uint32_t * // list of processes running, so the caller knows where it is at. // Holding a copy of max_process before it is passed in will be helpful // for the caller. - status_code = is_required_previlegies_required - ? amdsmi_status_t::AMDSMI_STATUS_NO_PERM : AMDSMI_STATUS_SUCCESS; *max_processes = static_cast(compute_process_list.size()); return (max_processes_original_size >= static_cast(compute_process_list.size())) - ? status_code : amdsmi_status_t::AMDSMI_STATUS_OUT_OF_RESOURCES; + ? AMDSMI_STATUS_SUCCESS : amdsmi_status_t::AMDSMI_STATUS_OUT_OF_RESOURCES; } amdsmi_status_t