System Information Functions

System Information Functions#

AMD SMI: System Information Functions
System Information Functions

Functions

amdsmi_status_t amdsmi_get_gpu_compute_process_info (amdsmi_process_info_t *procs, uint32_t *num_items)
 Get process information about processes currently using GPU. More...
 
amdsmi_status_t amdsmi_get_gpu_compute_process_info_by_pid (uint32_t pid, amdsmi_process_info_t *proc)
 Get process information about a specific process. More...
 
amdsmi_status_t amdsmi_get_gpu_compute_process_gpus (uint32_t pid, uint32_t *dv_indices, uint32_t *num_devices)
 Get the device indices currently being used by a process. More...
 

Detailed Description

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

Function Documentation

◆ amdsmi_get_gpu_compute_process_info()

amdsmi_status_t amdsmi_get_gpu_compute_process_info ( amdsmi_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 amdsmi_process_info_t's, of length *num_items, this function will write up to *num_items instances of amdsmi_process_info_t to the memory pointed to by procs. These instances contain information about each process utilizing a GPU. 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 amdsmi_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 amdsmi_process_info_t structs actually written. If procs is NULL, this argument will be updated with the number processes for which there is information.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_gpu_compute_process_info_by_pid()

amdsmi_status_t amdsmi_get_gpu_compute_process_info_by_pid ( uint32_t  pid,
amdsmi_process_info_t proc 
)

Get process information about a specific process.

Given a pointer to an amdsmi_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 amdsmi_process_info_t to which process information for pid will be written if it is found.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_gpu_compute_process_gpus()

amdsmi_status_t amdsmi_get_gpu_compute_process_gpus ( 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 processor_handleices of length *num_devices, this function will write up to num_devices device indices to the memory pointed to by processor_handleices. If processor_handleices is not NULL, num_devices will be updated with the number of gpu's currently being used by process pid. If processor_handleices is NULL, processor_handleices 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 processor_handleices 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 processor_handleices argument. On output, if processor_handleices is non-NULL, this will be updated with the number uint32_t's actually written. If processor_handleices is NULL, this argument will be updated with the number devices being used.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail