System Information Functions

System Information Functions#

ROCmSMI: System Information Functions
System Information Functions

Functions

rsmi_status_t rsmi_compute_process_info_get (rsmi_process_info_t *procs, uint32_t *num_items)
 Get process information about processes currently using GPU. More...
 
rsmi_status_t rsmi_compute_process_info_by_pid_get (uint32_t pid, rsmi_process_info_t *proc)
 Get process information about a specific process. More...
 
rsmi_status_t rsmi_compute_process_gpus_get (uint32_t pid, uint32_t *dv_indices, uint32_t *num_devices)
 Get the device indices currently being used by a process. More...
 
rsmi_status_t rsmi_compute_process_info_by_device_get (uint32_t pid, uint32_t dv_ind, rsmi_process_info_t *proc)
 Get the info of a process on a specific device. More...
 

Detailed Description

These functions are used to configure, query and control performance counting.

Function Documentation

◆ rsmi_compute_process_info_get()

rsmi_status_t rsmi_compute_process_info_get ( rsmi_process_info_t procs,
uint32_t *  num_items 
)

Get process information about processes currently using GPU.

Given a non-NULL pointer to an array procs of rsmi_process_info_t's, of length *num_items, this function will write up to *num_items instances of rsmi_process_info_t to the memory pointed to by procs. These instances contain information about each GPU compute process and their PASID for further analysis or monitoring via rsmi_compute_process_info_by_pid_get(). If procs is not NULL, num_items will be updated with the number of processes actually written. If procs is NULL, num_items will be updated with the number of processes for which there is current process information. Calling this function with procs being NULL is a way to determine how much memory should be allocated for when procs is not NULL.

Parameters
[in,out]procsa pointer to memory provided by the caller to which process information will be written. This may be NULL in which case only num_items will be updated with the number of processes found.
[in,out]num_itemsA pointer to a uint32_t, which on input, should contain the amount of memory in rsmi_process_info_t's which have been provided by the procs argument. On output, if procs is non-NULL, this will be updated with the number rsmi_process_info_t structs actually written. If procs is NULL, this argument will be updated with the number processes for which there is information.
Return values
RSMI_STATUS_SUCCESSis returned upon successful call
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid
RSMI_STATUS_INSUFFICIENT_SIZEis returned if there were more processes for which information was available, but not enough space was provided as indicated by procs and num_items, on input.

◆ rsmi_compute_process_info_by_pid_get()

rsmi_status_t rsmi_compute_process_info_by_pid_get ( uint32_t  pid,
rsmi_process_info_t proc 
)

Get process information about a specific process.

Given a pointer to an rsmi_process_info_t proc and a process id pid, this function will write the process information for pid, if available, to the memory pointed to by proc.

Parameters
[in]pidThe process ID for which process information is being requested
[in,out]proca pointer to a rsmi_process_info_t to which process information for pid will be written if it is found.
Return values
RSMI_STATUS_SUCCESSis returned upon successful call
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid
RSMI_STATUS_NOT_FOUNDis returned if there was no process information found for the provided pid

◆ rsmi_compute_process_gpus_get()

rsmi_status_t rsmi_compute_process_gpus_get ( uint32_t  pid,
uint32_t *  dv_indices,
uint32_t *  num_devices 
)

Get the device indices currently being used by a process.

Given a process id pid, a non-NULL pointer to an array of uint32_t's dv_indices of length *num_devices, this function will write up to num_devices device indices to the memory pointed to by dv_indices. If dv_indices is not NULL, num_devices will be updated with the number of gpu's currently being used by process pid. If dv_indices is NULL, dv_indices will be updated with the number of gpus currently being used by pid. Calling this function with dv_indices being NULL is a way to determine how much memory is required for when dv_indices is not NULL.

Parameters
[in]pidThe process id of the process for which the number of gpus currently being used is requested
[in,out]dv_indicesa pointer to memory provided by the caller to which indices of devices currently being used by the process will be written. This may be NULL in which case only num_devices will be updated with the number of devices being used.
[in,out]num_devicesA pointer to a uint32_t, which on input, should contain the amount of memory in uint32_t's which have been provided by the dv_indices argument. On output, if dv_indices is non-NULL, this will be updated with the number uint32_t's actually written. If dv_indices is NULL, this argument will be updated with the number devices being used.
Return values
RSMI_STATUS_SUCCESSis returned upon successful call
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid
RSMI_STATUS_INSUFFICIENT_SIZEis returned if there were more gpu indices that could have been written, but not enough space was provided as indicated by dv_indices and num_devices, on input.

◆ rsmi_compute_process_info_by_device_get()

rsmi_status_t rsmi_compute_process_info_by_device_get ( uint32_t  pid,
uint32_t  dv_ind,
rsmi_process_info_t proc 
)

Get the info of a process on a specific device.

Given a process id pid, a dv_ind, this function will write the process information for pid on the device, if available, to the memory pointed to by proc.

Parameters
[in]pidThe process id of the process for which the gpu currently being used is requested.
[in]dv_inda device index where the process running on.
[in,out]proca pointer to memory provided by the caller to which process information will be written.
Return values
RSMI_STATUS_SUCCESSis returned upon successful call
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid