Skip to main content

VgpuType

Struct VgpuType 

Source
pub struct VgpuType<'dev> { /* private fields */ }

Implementations§

Source§

impl<'dev> VgpuType<'dev>

Source

pub fn new(device: &'dev Device<'_>, id: nvmlVgpuTypeId_t) -> Self

Create a new vGPU type wrapper.

You probably don’t need to use this yourself, but rather through Device::vgpu_supported_types and Device::vgpu_creatable_types.

Source

pub fn device(&self) -> &'dev Device<'_>

Access the Device this struct belongs to.

Source

pub fn class_name(&self) -> Result<String, NvmlError>

Retrieve the class of the vGPU type.

§Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if this Device is invalid
  • Unknown, on any unexpected error
§Device support

Kepler or newer fully supported devices.

Source

pub fn license(&self) -> Result<String, NvmlError>

Retrieve license requirements for a vGPU type.

The license type and version required to run the specified vGPU type is returned as an alphanumeric string, in the form “<license name>,<version>”, for example “GRID-Virtual-PC,2.0”. If a vGPU is runnable with* more than one type of license, the licenses are delimited by a semicolon, for example “GRID-Virtual-PC,2.0;GRID-Virtual-WS,2.0;GRID-Virtual-WS-Ext,2.0”.

§Errors
  • Uninitialized, if the library has not been successfully initialized
  • InsufficientSize, if the passed-in size is 0 (must be > 0)
  • InvalidArg, if this Device is invalid
  • Unknown, on any unexpected error
§Device support

Kepler or newer fully supported devices.

Source

pub fn name(&self) -> Result<String, NvmlError>

Retrieve the name of the vGPU type.

The name is an alphanumeric string that denotes a particular vGPU, e.g. GRID M60-2Q.

§Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if this Device is invalid
  • Unknown, on any unexpected error
§Device support

Kepler or newer fully supported devices.

Source

pub fn capabilities( &self, capability: nvmlVgpuCapability_t, ) -> Result<bool, NvmlError>

Retrieve the requested capability for a given vGPU type. Refer to the nvmlVgpuCapability_t structure for the specific capabilities that can be queried.

§Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if this Device is invalid
  • Unknown, on any unexpected error
§Device Support

Maxwell or newer fully supported devices.

Source

pub fn device_id(&self) -> Result<(u64, u64), NvmlError>

Retrieve the device ID of the vGPU type.

§Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if this Device is invalid
  • Unknown, on any unexpected error
§Device Support

Kepler or newer fully supported devices.

Source

pub fn frame_rate_limit(&self) -> Result<u32, NvmlError>

Retrieve the static frame rate limit value of the vGPU type.

§Errors
  • Uninitialized, if the library has not been successfully initialized
  • NotSupported, if frame rate limiter is turned off for the vGPU type
  • InvalidArg, if this Device is invalid
  • Unknown, on any unexpected error
§Device Support

Kepler or newer fully supported devices.

Source

pub fn framebuffer_size(&self) -> Result<u64, NvmlError>

Retrieve the vGPU framebuffer size in bytes.

§Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if this Device is invalid
  • Unknown, on any unexpected error
§Device Support

Kepler or newer fully supported devices.

Source

pub fn instance_profile_id(&self) -> Result<u32, NvmlError>

Retrieve the GPU Instance Profile ID for the vGPU type. The API will return a valid GPU Instance Profile ID for the MIG capable vGPU types, else crate::ffi::bindings::INVALID_GPU_INSTANCE_PROFILE_ID is returned.

§Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if this Device is invalid
  • Unknown, on any unexpected error
§Device Support

Kepler or newer fully supported devices.

Source

pub fn max_instances(&self) -> Result<u32, NvmlError>

Retrieve the maximum number of vGPU instances creatable on a device for the vGPU type.

§Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if this Device is invalid
  • Unknown, on any unexpected error
§Device Support

Kepler or newer fully supported devices.

Source

pub fn max_instances_per_vm(&self) -> Result<u32, NvmlError>

Retrieve the maximum number of vGPU instances supported per VM for the vGPU type.

§Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if this Device is invalid
  • Unknown, on any unexpected error
§Device Support

Kepler or newer fully supported devices.

Source

pub fn num_display_heads(&self) -> Result<u32, NvmlError>

Retrieve count of vGPU’s supported display heads.

§Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if this Device is invalid
  • Unknown, on any unexpected error
§Device Support

Kepler or newer fully supported devices.

Source

pub fn resolution(&self, display_head: u32) -> Result<(u32, u32), NvmlError>

Retrieve vGPU display head’s maximum supported resolution.

The display_head argument specifies the 0-based display index, the maximum being what VgpuType::num_display_heads returns.

§Errors
  • Uninitialized, if the library has not been successfully initialized
  • InvalidArg, if this Device is invalid
  • Unknown, on any unexpected error
§Device Support

Kepler or newer fully supported devices.

Auto Trait Implementations§

§

impl<'dev> Freeze for VgpuType<'dev>

§

impl<'dev> !RefUnwindSafe for VgpuType<'dev>

§

impl<'dev> Send for VgpuType<'dev>

§

impl<'dev> Sync for VgpuType<'dev>

§

impl<'dev> Unpin for VgpuType<'dev>

§

impl<'dev> !UnwindSafe for VgpuType<'dev>

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.