Skip to main content

VgpuType

Struct VgpuType 

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

Implementations§

Source§

impl VgpuType

Source

pub const fn from_id(id: VgpuTypeId) -> Self

Source

pub const fn id(self) -> VgpuTypeId

Source

pub fn class(self) -> Result<String>

Returns the class of a vGPU type. It does not exceed 64 bytes including the terminating NUL byte. This wrapper allocates the required NVML buffer internally.

For Kepler or newer fully supported devices.

§Errors

Returns an error if the internal class-name buffer is too small, if NVML rejects the vGPU type ID or query arguments, or if NVML reports an unexpected failure.

Source

pub fn name(self) -> Result<String>

Returns the vGPU type name.

The name is an alphanumeric vGPU identifier such as GRID M60-2Q. It does not exceed 64 bytes including the terminating NUL byte. This wrapper allocates the required NVML buffer internally.

For Kepler or newer fully supported devices.

§Errors

Returns an error if the internal name buffer is too small, if NVML rejects the vGPU type ID or query arguments, or if NVML reports an unexpected failure.

Source

pub fn gpu_instance_profile_id(self) -> Result<u32>

Returns the GPU instance profile ID for this vGPU type ID. Returns a valid GPU instance profile ID for MIG-capable vGPU types, or INVALID_GPU_INSTANCE_PROFILE_ID otherwise.

For Kepler or newer fully supported devices.

§Errors

Returns an error if NVML rejects the vGPU type ID or query arguments, if the device is not in vGPU host virtualization mode, or if NVML reports an unexpected failure.

Source

pub fn device_id(self) -> Result<VgpuTypeDeviceId>

Returns the device ID of a vGPU type.

For Kepler or newer fully supported devices.

§Errors

Returns an error if NVML rejects the vGPU type ID or query arguments, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn framebuffer_size(self) -> Result<u64>

Returns the vGPU framebuffer size in bytes.

For Kepler or newer fully supported devices.

§Errors

Returns an error if NVML rejects the vGPU type ID or query arguments, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn num_display_heads(self) -> Result<u32>

Returns count of vGPU’s supported display heads.

For Kepler or newer fully supported devices.

§Errors

Returns an error if NVML rejects the vGPU type ID or query arguments, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn resolution(self, display_index: u32) -> Result<VgpuTypeResolution>

Returns vGPU display head’s maximum supported resolution.

For Kepler or newer fully supported devices.

§Errors

Returns an error if NVML rejects the vGPU type ID or query arguments, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn license(self) -> Result<String>

Returns 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 license type, the licenses are delimited by semicolons, for example GRID-Virtual-PC,2.0;GRID-Virtual-WS,2.0;GRID-Virtual-WS-Ext,2.0.

The returned string does not exceed 128 bytes including the terminating NUL byte. This wrapper allocates the required NVML buffer internally.

For Kepler or newer fully supported devices.

§Errors

Returns an error if the internal license buffer is too small, if NVML rejects the vGPU type ID or query arguments, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn frame_rate_limit(self) -> Result<u32>

Returns the static frame-rate limit value of the vGPU type.

For Kepler or newer fully supported devices.

§Errors

Returns an error if NVML rejects the vGPU type ID or query arguments, if the frame-rate limiter is disabled for this vGPU type, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn max_instances(self, device: Device) -> Result<u32>

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

For Kepler or newer fully supported devices.

§Errors

Returns an error if NVML rejects the vGPU type ID or query arguments, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn max_instances_per_vm(self) -> Result<u32>

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

For Kepler or newer fully supported devices.

§Errors

Returns an error if NVML rejects the vGPU type ID or query arguments, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn max_instances_per_gpu_instance(self) -> Result<u32>

Returns the maximum number of vGPU instances per GPU instance for this vGPU type.

§Errors

Returns an error if NVML rejects the versioned request, if the vGPU type ID or query arguments are invalid, if the host, GPU, or vGPU type does not support the query, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn bar1_info(self) -> Result<VgpuTypeBar1Info>

Returns the BAR1 info for this vGPU type.

For Maxwell or newer fully supported devices.

§Errors

Returns an error if NVML rejects the vGPU type ID or query arguments, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn capability(self, capability: VgpuTypeCapability) -> Result<bool>

Returns the requested capability for the given vGPU type. See VgpuTypeCapability for the supported capabilities. Returns a boolean indicating whether the capability is supported.

For Maxwell or newer fully supported devices.

§Errors

Returns an error if NVML rejects the vGPU type ID, capability, or query arguments, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn fb_reservation(self) -> Result<u64>

Returns the static framebuffer reservation of the vGPU type in bytes.

§Errors

Returns an error if NVML rejects the vGPU type ID or query arguments, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn gsp_heap_size(self) -> Result<u64>

Returns the static GSP heap size of the vGPU type in bytes.

§Errors

Returns an error if NVML rejects the vGPU type ID or query arguments, if NVML has not been initialized, or if NVML reports an unexpected failure.

Trait Implementations§

Source§

impl Clone for VgpuType

Source§

fn clone(&self) -> VgpuType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for VgpuType

Source§

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

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

impl Hash for VgpuType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for VgpuType

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 VgpuType

Source§

impl Eq for VgpuType

Source§

impl StructuralPartialEq for VgpuType

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.