cuda.core.system.DeviceEvents#

class cuda.core.system.DeviceEvents(intptr_t device_handle: intptr_t, events: EventType | int | list[EventType | int])#

Represents a set of events that can be waited on for a specific device.

Methods

__init__(*args, **kwargs)#
wait(self, int timeout_ms: int = 0) EventData#

Wait for events in the event set.

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 until event arrives but not longer than specified timeout. If timeout passes, a cuda.core.system.TimeoutError is raised. 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 wait 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.

Parameters:

timeout_ms (int) – The timeout in milliseconds. A value of 0 means to wait indefinitely.

Raises:
  • cuda.core.system.TimeoutError – If the timeout expires before an event is received.

  • cuda.core.system.GpuIsLostError – If the GPU has fallen off the bus or is otherwise inaccessible.