Linux repositories inspector

nvmlAccountingStats(3)

Version 1.1
8 Feb 2019
Aliases: nvmlDeviceClearAccountingPids(3), nvmlDeviceClearAccountingPids(3), nvmlDeviceGetAccountingBufferSize(3), nvmlDeviceGetAccountingBufferSize(3), nvmlDeviceGetAccountingMode(3), nvmlDeviceGetAccountingMode(3), nvmlDeviceGetAccountingPids(3), nvmlDeviceGetAccountingPids(3), nvmlDeviceGetAccountingStats(3), nvmlDeviceGetAccountingStats(3), nvmlDeviceSetAccountingMode(3), nvmlDeviceSetAccountingMode(3)

nvidia-cuda-dev

NVIDIA CUDA development files

cuda

NVIDIA's GPU programming toolkit

NAME

Accounting Statistics -

Data Structures

struct nvmlAccountingStats_t

Functions

nvmlReturn_t DECLDIR nvmlDeviceGetAccountingMode (nvmlDevice_t device, nvmlEnableState_t *mode)
nvmlReturn_t DECLDIR nvmlDeviceGetAccountingStats (nvmlDevice_t device, unsigned int pid, nvmlAccountingStats_t *stats)
nvmlReturn_t DECLDIR nvmlDeviceGetAccountingPids (nvmlDevice_t device, unsigned int *count, unsigned int *pids)
nvmlReturn_t DECLDIR nvmlDeviceGetAccountingBufferSize (nvmlDevice_t device, unsigned int *bufferSize)
nvmlReturn_t DECLDIR nvmlDeviceSetAccountingMode (nvmlDevice_t device, nvmlEnableState_t mode)
nvmlReturn_t DECLDIR nvmlDeviceClearAccountingPids (nvmlDevice_t device)

Detailed Description

Set of APIs designed to provide per process information about usage of GPU.
Note:
All accounting statistics and accounting mode live in nvidia driver and reset to default (Disabled) when driver unloads. It is advised to run with persistence mode enabled.
Enabling accounting mode has no negative impact on the GPU performance.

Function Documentation

nvmlReturn_t DECLDIR nvmlDeviceClearAccountingPids (nvmlDevice_t device)

Clears accounting information about all processes that have already terminated.
For Kepler (TM) or newer fully supported devices. Requires root/admin permissions.
See nvmlDeviceGetAccountingMode See nvmlDeviceGetAccountingStats See nvmlDeviceSetAccountingMode
Parameters:
device The identifier of the target device
Returns:
o NVML_SUCCESS if accounting information has been cleared
o NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
o NVML_ERROR_INVALID_ARGUMENT if device are invalid
o NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature
o NVML_ERROR_NO_PERMISSION if the user doesn’t have permission to perform this operation
o NVML_ERROR_UNKNOWN on any unexpected error

nvmlReturn_t DECLDIR nvmlDeviceGetAccountingBufferSize (nvmlDevice_t device, unsigned int * bufferSize)

Returns the number of processes that the circular buffer with accounting pids can hold.
For Kepler (TM) or newer fully supported devices.
This is the maximum number of processes that accounting information will be stored for before information about oldest processes will get overwritten by information about new processes.
Parameters:
device The identifier of the target device
bufferSize Reference in which to provide the size (in number of elements) of the circular buffer for accounting stats.
Returns:
o NVML_SUCCESS if buffer size was successfully retrieved
o NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
o NVML_ERROR_INVALID_ARGUMENT if device is invalid or bufferSize is NULL
o NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature or accounting mode is disabled
o NVML_ERROR_UNKNOWN on any unexpected error
See also:
nvmlDeviceGetAccountingStats
nvmlDeviceGetAccountingPids

nvmlReturn_t DECLDIR nvmlDeviceGetAccountingMode (nvmlDevice_t device, nvmlEnableState_t * mode)

Queries the state of per process accounting mode.
For Kepler (TM) or newer fully supported devices.
See nvmlDeviceGetAccountingStats for more details. See nvmlDeviceSetAccountingMode
Parameters:
device The identifier of the target device
mode Reference in which to return the current accounting mode
Returns:
o NVML_SUCCESS if the mode has been successfully retrieved
o NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
o NVML_ERROR_INVALID_ARGUMENT if device is invalid or mode are NULL
o NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature
o NVML_ERROR_UNKNOWN on any unexpected error

nvmlReturn_t DECLDIR nvmlDeviceGetAccountingPids (nvmlDevice_t device, unsigned int * count, unsigned int * pids)

Queries list of processes that can be queried for accounting stats. The list of processes returned can be in running or terminated state.
For Kepler (TM) or newer fully supported devices.
To just query the number of processes ready to be queried, call this function with *count = 0 and pids=NULL. The return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if list is empty.
For more details see nvmlDeviceGetAccountingStats.
Note:
In case of PID collision some processes might not be accessible before the circular buffer is full.
Parameters:
device The identifier of the target device
count Reference in which to provide the pids array size, and to return the number of elements ready to be queried
pids Reference in which to return list of process ids
Returns:
o NVML_SUCCESS if pids were successfully retrieved
o NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
o NVML_ERROR_INVALID_ARGUMENT if device is invalid or count is NULL
o NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature or accounting mode is disabled
o NVML_ERROR_INSUFFICIENT_SIZE if count is too small (count is set to expected value)
o NVML_ERROR_UNKNOWN on any unexpected error
See also:
nvmlDeviceGetAccountingBufferSize

nvmlReturn_t DECLDIR nvmlDeviceGetAccountingStats (nvmlDevice_t device, unsigned int pid, nvmlAccountingStats_t * stats)

Queries process’s accounting stats.
For Kepler (TM) or newer fully supported devices.
Accounting stats capture GPU utilization and other statistics across the lifetime of a process. Accounting stats can be queried during life time of the process and after its termination. The time field in nvmlAccountingStats_t is reported as 0 during the lifetime of the process and updated to actual running time after its termination. Accounting stats are kept in a circular buffer, newly created processes overwrite information about old processes.
See nvmlAccountingStats_t for description of each returned metric. List of processes that can be queried can be retrieved from nvmlDeviceGetAccountingPids.
Note:
Accounting Mode needs to be on. See nvmlDeviceGetAccountingMode.
Only compute and graphics applications stats can be queried. Monitoring applications stats can’t be queried since they don’t contribute to GPU utilization.
In case of pid collision stats of only the latest process (that terminated last) will be reported
Warning:
On Kepler devices per process statistics are accurate only if there’s one process running on a GPU.
Parameters:
device The identifier of the target device
pid Process Id of the target process to query stats for
stats Reference in which to return the process’s accounting stats
Returns:
o NVML_SUCCESS if stats have been successfully retrieved
o NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
o NVML_ERROR_INVALID_ARGUMENT if device is invalid or stats are NULL
o NVML_ERROR_NOT_FOUND if process stats were not found
o NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature or accounting mode is disabled
o NVML_ERROR_UNKNOWN on any unexpected error
See also:
nvmlDeviceGetAccountingBufferSize

nvmlReturn_t DECLDIR nvmlDeviceSetAccountingMode (nvmlDevice_t device, nvmlEnableState_t mode)

Enables or disables per process accounting.
For Kepler (TM) or newer fully supported devices. Requires root/admin permissions.
Note:
This setting is not persistent and will default to disabled after driver unloads. Enable persistence mode to be sure the setting doesn’t switch off to disabled.
Enabling accounting mode has no negative impact on the GPU performance.
Disabling accounting clears all accounting pids information.
See nvmlDeviceGetAccountingMode See nvmlDeviceGetAccountingStats See nvmlDeviceClearAccountingPids
Parameters:
device The identifier of the target device
mode The target accounting mode
Returns:
o NVML_SUCCESS if the new mode has been set
o NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
o NVML_ERROR_INVALID_ARGUMENT if device or mode are invalid
o NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature
o NVML_ERROR_NO_PERMISSION if the user doesn’t have permission to perform this operation
o NVML_ERROR_UNKNOWN on any unexpected error

Author

Generated automatically by Doxygen for NVML from the source code.
⇧ Top