NVML API Reference Guide (PDF) - v535 (older) - Last updated January 31, 2024 - Send Feedback

4.19. 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

struct 

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 )

Typedefs

typedef nvmlEventSet_st * nvmlEventSet_t

Handle to an event set

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

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:

Event Types

nvmlDeviceRegisterEvents

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

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:

Event Types

nvmlDeviceGetSupportedEventTypes

nvmlEventSetWait

nvmlEventSetFree

nvmlReturn_t nvmlEventSetCreate ( nvmlEventSet_t* set )
Parameters
set
Reference in which to return the event handle
Returns

Description

Create an empty set of events. Event set should be freed by nvmlEventSetFree

For Fermi or newer fully supported devices.

See also:

nvmlEventSetFree

nvmlReturn_t nvmlEventSetFree ( nvmlEventSet_t set )
Parameters
set
Reference to events to be released
Returns

Description

Releases events in the set

For Fermi or newer fully supported devices.

See also:

nvmlDeviceRegisterEvents

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

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:

Event Types

nvmlDeviceRegisterEvents

Event Types


NVML API Reference Guide (PDF) - v535 (older) - Last updated January 31, 2024 - Send Feedback