pub struct NvLink<'device, 'nvml: 'device> { /* private fields */ }
Expand description

Struct that represents a Device’s NvLink.

Obtain this via Device.link_wrapper_for().

Lifetimes are used to enforce that each NvLink instance cannot be used after the Device instance it was obtained from is dropped:

use nvml_wrapper::Nvml;

let nvml = Nvml::init()?;
let device = nvml.device_by_index(0)?;
let link = device.link_wrapper_for(0);

drop(device);

// This won't compile
link.is_active()?;

Note that I cannot test any NvLink methods myself as I do not have access to such a link setup. Test the functionality in this module before you use it.

Implementations

Obtain the Device reference stored within this struct.

Obtain the value of this struct’s link field.

Gets whether or not this Device’s NvLink is active.

Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the link or Device within this NvLink struct instance is invalid
  • NotSupported, if this Device doesn’t support this feature
  • UnexpectedVariant, for which you can read the docs for
  • Unknown, on any unexpected error
Device Support

Supports Pascal or newer fully supported devices.

Gets the NvLink version of this Device / NvLink.

Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the link or Device within this NvLink struct instance is invalid
  • NotSupported, if this Device doesn’t support this feature
  • Unknown, on any unexpected error
Device Support

Supports Pascal or newer fully supported devices.

Gets whether or not this Device / NvLink has a Capability.

Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the link or Device within this NvLink struct instance is invalid
  • NotSupported, if this Device doesn’t support this feature
  • Unknown, on any unexpected error
Device Support

Supports Pascal or newer fully supported devices.

Gets the PCI information for this NvLink’s remote node.

Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the link or Device within this NvLink struct instance is invalid
  • NotSupported, if this Device doesn’t support this feature
  • Unknown, on any unexpected error
Device Support

Supports Pascal or newer fully supported devices.

Gets the specified ErrorCounter value.

Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the link or Device within this NvLink struct instance is invalid
  • NotSupported, if this Device doesn’t support this feature
  • Unknown, on any unexpected error
Device Support

Supports Pascal or newer fully supported devices.

Resets all error counters to zero.

Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the link or Device within this NvLink struct instance is invalid
  • NotSupported, if this Device doesn’t support this feature
  • Unknown, on any unexpected error
Device Support

Supports Pascal or newer fully supported devices.

Sets the NvLink utilization counter control information for the specified Counter.

The counters will be reset if reset_counters is true.

Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the link or Device within this NvLink struct instance is invalid
  • NotSupported, if this Device doesn’t support this feature
  • Unknown, on any unexpected error
Device Support

Supports Pascal or newer fully supported devices.

Gets the NvLink utilization counter control information for the specified Counter.

Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the link or Device within this NvLink struct instance is invalid
  • NotSupported, if this Device doesn’t support this feature
  • Unknown, on any unexpected error
Device Support

Supports Pascal or newer fully supported devices.

Gets the NvLink utilization counter for the given counter.

The retrieved values are based on the current controls set for the specified Counter. You should use .set_utilization_control() before calling this as the utilization counters have no default state.

I do not attempt to verify, statically or at runtime, that you have controls set for counter prior to calling this method on counter. NVIDIA says that it is “In general[,] good practice”, which does not sound to me as if it is in any way unsafe to make this call without having set controls. I don’t believe it’s worth the overhead of using a Mutex’d bool to track whether or not you have set controls, and it’s certainly not worth the effort to statically verify it via the type system.

That being said, I don’t know what exactly would happen, either, and I have no means of finding out. If you do and discover that garbage values are returned, for instance, I would love to hear about it; that would likely cause this decision to be reconsidered.

Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the link or Device within this NvLink struct instance is invalid
  • NotSupported, if this Device doesn’t support this feature
  • Unknown, on any unexpected error
Device Support

Supports Pascal or newer fully supported devices.

Freezes the specified NvLink utilization Counter.

Both the receive and send counters will be frozen (if I’m reading NVIDIA’s meaning correctly).

Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the link or Device within this NvLink struct instance is invalid
  • NotSupported, if this Device doesn’t support this feature
  • Unknown, on any unexpected error
Device Support

Supports Pascal or newer fully supported devices.

Unfreezes the specified NvLink utilization Counter.

Both the receive and send counters will be unfrozen (if I’m reading NVIDIA’s meaning correctly).

Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the link or Device within this NvLink struct instance is invalid
  • NotSupported, if this Device doesn’t support this feature
  • Unknown, on any unexpected error
Device Support

Supports Pascal or newer fully supported devices.

Resets the specified NvLink utilization Counter.

Both the receive and send counters will be rest (if I’m reading NVIDIA’s meaning correctly).

Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if the link or Device within this NvLink struct instance is invalid
  • NotSupported, if this Device doesn’t support this feature
  • Unknown, on any unexpected error
Device Support

Supports Pascal or newer fully supported devices.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.