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] procs a 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_items A 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, ifprocs
is non-NULL, this will be updated with the number amdsmi_process_info_t structs actually written. Ifprocs
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] pid The process ID for which process information is being requested [in,out] proc a 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] pid The process id of the process for which the number of gpus currently being used is requested [in,out] dv_indices a 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_devices A 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, ifprocessor_handleices
is non-NULL, this will be updated with the number uint32_t's actually written. Ifprocessor_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