Skip to main content

FieldIdScheme

Enum FieldIdScheme 

Source
pub enum FieldIdScheme {
    V12,
    V13Update1,
}
Expand description

The main struct that this library revolves around.

According to NVIDIA’s documentation, “It is the user’s responsibility to call nvmlInit() before calling any other methods, and nvmlShutdown() once NVML is no longer being used.” This struct is used to enforce those rules.

Also according to NVIDIA’s documentation, “NVML is thread-safe so it is safe to make simultaneous NVML calls from multiple threads.” In the Rust world, this translates to NVML being Send + Sync. You can .clone() an Arc wrapped NVML and enjoy using it on any thread.

NOTE: If you care about possible errors returned from nvmlShutdown(), use the .shutdown() method on this struct. The Drop implementation ignores errors.

When reading documentation on this struct and its members, remember that a lot of it, especially in regards to errors returned, is copied from NVIDIA’s docs. While they can be found online here, the hosted docs sometimes outdated and may not accurately reflect the version of NVML that this library is written for; beware. You should ideally read the doc comments on an up-to-date NVML API header. Such a header can be downloaded as part of the CUDA toolkit. Describes which field ID numbering scheme the loaded NVML driver uses for IDs 251-273. NVIDIA broke ABI compatibility for these IDs between the original CUDA 13.0 release and CUDA 13.0 Update 1 (driver >= 580.82).

See https://docs.nvidia.com/deploy/nvml-api/known-issues.html

Variants§

§

V12

Used by drivers before 580.82 (CUDA 12.x and original CUDA 13.0). IDs 251-255 are CLOCKS_EVENT_REASON/POWER_SYNC, 256-273 are PWR_SMOOTHING.

§

V13Update1

Used by drivers >= 580.82 (CUDA 13.0 Update 1+). IDs 251-268 are PWR_SMOOTHING, 269-273 are CLOCKS_EVENT_REASON/POWER_SYNC.

Trait Implementations§

Source§

impl Clone for FieldIdScheme

Source§

fn clone(&self) -> FieldIdScheme

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FieldIdScheme

Source§

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

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

impl PartialEq for FieldIdScheme

Source§

fn eq(&self, other: &FieldIdScheme) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for FieldIdScheme

Source§

impl Eq for FieldIdScheme

Source§

impl StructuralPartialEq for FieldIdScheme

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.