Skip to main content

EventSet

Struct EventSet 

Source
pub struct EventSet(/* private fields */);

Implementations§

Source§

impl EventSet

Source

pub fn register_device( &self, device: Device, event_types: EventTypes, ) -> Result<()>

Starts recording the requested events for the specified device.

For Fermi or newer fully supported devices. ECC events are available only on ECC-enabled devices; power-capping events are available only on devices with power management support.

For Linux only.

All events that occurred before this call are not recorded. Use EventSet::wait to observe recorded events.

If NVML reports Status::Unknown, the event set is in an undefined state and must be freed. If NVML reports Status::NotSupported, the event set can still be used, but none of the requested event types are registered.

§Errors

Returns an error if the device is inaccessible, if NVML rejects the event set or event mask, if the platform or requested event types are not supported, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn wait(&self, timeout_ms: u32) -> Result<EventData>

Waits for and returns the next event.

For Fermi or newer fully supported devices.

If events are ready when this is called, it returns immediately. If no events are ready, it sleeps until an event arrives or timeout_ms expires. In some conditions, such as an interrupt, this can return before the timeout expires.

On Windows, after an Xid error, this method returns the most recent Xid error type seen by the system. If multiple Xid errors are generated before this wait call is made, the last seen Xid error type is returned for all Xid error events.

On Linux, every Xid error event returns the associated event data and other information if applicable.

In MIG mode, if a device handle is provided, NVML reports events for all available instances only when the caller has appropriate privileges. Without those privileges, only events affecting all instances, namely the whole device, are reported.

This does not currently support per-instance event reporting using MIG device handles.

§Errors

Returns an error if a registered GPU is inaccessible, if NVML rejects the event-data output, if no event arrives before timeout_ms or the wait is interrupted, if NVML has not been initialized, or if NVML reports an unexpected failure.

Trait Implementations§

Source§

impl Debug for EventSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for EventSet

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.