Process information

Process information#

AMD SMI: Process information
Process information

Functions

amdsmi_status_t amdsmi_get_gpu_process_list (amdsmi_processor_handle processor_handle, uint32_t *max_processes, amdsmi_proc_info_t *list)
 Returns the list of processes running on a given GPU including itself. More...
 

Detailed Description

Function Documentation

◆ amdsmi_get_gpu_process_list()

amdsmi_status_t amdsmi_get_gpu_process_list ( amdsmi_processor_handle  processor_handle,
uint32_t *  max_processes,
amdsmi_proc_info_t list 
)

Returns the list of processes running on a given GPU including itself.

Platform:

gpu_bm_linux

guest_1vf

guest_mvf

guest_windows

Note
The user provides a buffer to store the list and the maximum number of processes that can be returned. If the user sets max_processes to 0, the current total number of processes will replace max_processes param. After that, the function needs to be called again, with updated max_processes, to successfully fill the process list, which was previously allocated with max_processes
Parameters
[in]processor_handleDevice which to query
[in,out]max_processesReference to the size of the list buffer in number of elements. Returns the return number of elements in list or the number of running processes if equal to 0, and if given value in param max_processes is less than number of processes currently running, AMDSMI_STATUS_OUT_OF_RESOURCES will be returned.

For cases where max_process is not zero (0), it specifies the list's size limit. That is, the maximum size this list will be able to hold. After the list is built internally, as a return status, we will have AMDSMI_STATUS_OUT_OF_RESOURCES when the original size limit is smaller than the actual list of processes running. Hence, the caller is aware the list size needs to be resized, or AMDSMI_STATUS_SUCCESS otherwise. 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.

Parameters
[out]listReference to a user-provided buffer where the process list will be returned. This buffer must contain at least max_processes entries of type amd_proc_info_list_t. Must be allocated by user.
Returns
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.