4.20. Event Handling Methods
This chapter describes methods that NVML can perform against each device to register and wait for some event to occur.
Modules
Classes
Typedefs
- typedef nvmlEventSet_st * nvmlEventSet_t
Functions
- nvmlReturn_t nvmlDeviceGetSupportedEventTypes ( nvmlDevice_t device, unsigned long long* eventTypes )
- nvmlReturn_t nvmlDeviceRegisterEvents ( nvmlDevice_t device, unsigned long long eventTypes, nvmlEventSet_t set )
- nvmlReturn_t nvmlEventSetCreate ( nvmlEventSet_t* set )
- nvmlReturn_t nvmlEventSetFree ( nvmlEventSet_t set )
- nvmlReturn_t nvmlEventSetWait_v2 ( nvmlEventSet_t set, nvmlEventData_t* data, unsigned int timeoutms )
Functions
- nvmlReturn_t nvmlDeviceGetSupportedEventTypes ( nvmlDevice_t device, unsigned long long* eventTypes )
-
Parameters
- device
- The identifier of the target device
- eventTypes
- Reference in which to return bitmask of supported events
Returns
- NVML_SUCCESS if the eventTypes has been set
- NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- NVML_ERROR_INVALID_ARGUMENT if eventType is NULL
- NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- NVML_ERROR_UNKNOWN on any unexpected error
Description
Returns information about events supported on device
For Fermi or newer fully supported devices.
Events are not supported on Windows. So this function returns an empty mask in eventTypes on Windows.
See also:
- nvmlReturn_t nvmlDeviceRegisterEvents ( nvmlDevice_t device, unsigned long long eventTypes, nvmlEventSet_t set )
-
Parameters
- device
- The identifier of the target device
- eventTypes
- Bitmask of Event Types to record
- set
- Set to which add new event types
Returns
- NVML_SUCCESS if the event has been set
- NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- NVML_ERROR_INVALID_ARGUMENT if eventTypes is invalid or set is NULL
- NVML_ERROR_NOT_SUPPORTED if the platform does not support this feature or some of requested event types
- NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible
- NVML_ERROR_UNKNOWN on any unexpected error
Description
Starts recording of events on a specified devices and add the events to specified nvmlEventSet_t
For Fermi or newer fully supported devices. Ecc events are available only on ECC enabled devices (see nvmlDeviceGetTotalEccErrors) Power capping events are available only on Power Management enabled devices (see nvmlDeviceGetPowerManagementMode)
For Linux only.
IMPORTANT: Operations on set are not thread safe
This call starts recording of events on specific device. All events that occurred before this call are not recorded. Checking if some event occurred can be done with nvmlEventSetWait_v2
If function reports NVML_ERROR_UNKNOWN, event set is in undefined state and should be freed. If function reports NVML_ERROR_NOT_SUPPORTED, event set can still be used. None of the requested eventTypes are registered in that case.
See also:
nvmlDeviceGetSupportedEventTypes
nvmlEventSetWait
- nvmlReturn_t nvmlEventSetCreate ( nvmlEventSet_t* set )
-
Parameters
- set
- Reference in which to return the event handle
Returns
- NVML_SUCCESS if the event has been set
- NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- NVML_ERROR_INVALID_ARGUMENT if set is NULL
- NVML_ERROR_UNKNOWN on any unexpected error
Description
Create an empty set of events. Event set should be freed by nvmlEventSetFree
For Fermi or newer fully supported devices.
See also:
- nvmlReturn_t nvmlEventSetFree ( nvmlEventSet_t set )
-
Parameters
- set
- Reference to events to be released
Returns
- NVML_SUCCESS if the event has been successfully released
- NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- NVML_ERROR_UNKNOWN on any unexpected error
Description
Releases events in the set
For Fermi or newer fully supported devices.
See also:
- nvmlReturn_t nvmlEventSetWait_v2 ( nvmlEventSet_t set, nvmlEventData_t* data, unsigned int timeoutms )
-
Parameters
- set
- Reference to set of events to wait on
- data
- Reference in which to return event data
- timeoutms
- Maximum amount of wait time in milliseconds for registered event
Returns
- NVML_SUCCESS if the data has been set
- NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
- NVML_ERROR_INVALID_ARGUMENT if data is NULL
- NVML_ERROR_TIMEOUT if no event arrived in specified timeout or interrupt arrived
- NVML_ERROR_GPU_IS_LOST if a GPU has fallen off the bus or is otherwise inaccessible
- NVML_ERROR_UNKNOWN on any unexpected error
Description
Waits on events and delivers events
For Fermi or newer fully supported devices.
If some events are ready to be delivered at the time of the call, function returns immediately. If there are no events ready to be delivered, function sleeps till event arrives but not longer than specified timeout. This function in certain conditions can return before specified timeout passes (e.g. when interrupt arrives)
On Windows, in case of xid error, the function returns the most recent xid error type seen by the system. If there are multiple xid errors generated before nvmlEventSetWait is invoked then the last seen xid error type is returned for all xid error events.
On Linux, every xid error event would return the associated event data and other information if applicable.
In MIG mode, if device handle is provided, the API reports all the events for the available instances, only if the caller has appropriate privileges. In absence of required privileges, only the events which affect all the instances (i.e. whole device) are reported.
This API does not currently support per-instance event reporting using MIG device handles.
See also: