nvmlDeviceClearAccountingPids (3)
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:
-
- *
- NVML_SUCCESS if accounting information has been cleared
- *
- NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- *
- NVML_ERROR_INVALID_ARGUMENT if device are invalid
- *
- NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- *
- NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- *
- 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:
-
- *
- NVML_SUCCESS if buffer size was successfully retrieved
- *
- NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- *
- NVML_ERROR_INVALID_ARGUMENT if device is invalid or bufferSize is NULL
- *
- NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature or accounting mode is disabled
- *
- 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:
-
- *
- NVML_SUCCESS if the mode has been successfully retrieved
- *
- NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- *
- NVML_ERROR_INVALID_ARGUMENT if device is invalid or mode are NULL
- *
- NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- *
- 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:
-
- *
- NVML_SUCCESS if pids were successfully retrieved
- *
- NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- *
- NVML_ERROR_INVALID_ARGUMENT if device is invalid or count is NULL
- *
- NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature or accounting mode is disabled
- *
- NVML_ERROR_INSUFFICIENT_SIZE if count is too small (count is set to expected value)
- *
- 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:
-
- *
- NVML_SUCCESS if stats have been successfully retrieved
- *
- NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- *
- NVML_ERROR_INVALID_ARGUMENT if device is invalid or stats are NULL
- *
- NVML_ERROR_NOT_FOUND if process stats were not found
- *
- NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature or accounting mode is disabled
- *
- 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:
-
- *
- NVML_SUCCESS if the new mode has been set
- *
- NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- *
- NVML_ERROR_INVALID_ARGUMENT if device or mode are invalid
- *
- NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature
- *
- NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation
- *
- NVML_ERROR_UNKNOWN on any unexpected error
Author
Generated automatically by Doxygen for NVML from the source code.