types

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Q series vGPU
	Q Series = iota + 81
	// A series vGPU
	A = iota + 64
	// B series vGPU
	B
	// C series vGPU
	C
)
View Source
const (
	// AttributeMediaExtensions holds the string representation for the +me MIG profile attribute.
	AttributeMediaExtensions = "ME"
	// AttributeNoMediaExtensions holds the string representation for the -me MIG profile attribute.
	AttributeNoMediaExtensions = "NOME"
	// AttributeMediaExtensionsAll holds the string representation for the +me.all MIG profile attribute.
	AttributeMediaExtensionsAll = "MEALL"
	// AttributeGraphics holds the string representation for the +gfx MIG profile attribute.
	AttributeGraphics = "GFX"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceID

type DeviceID uint32

DeviceID represents a GPU Device ID as read from a GPUs PCIe config space.

func NewDeviceID

func NewDeviceID(device, vendor uint16) DeviceID

NewDeviceID constructs a new 'DeviceID' from the device and vendor values pulled from a GPUs PCIe config space.

func NewDeviceIDFromString

func NewDeviceIDFromString(str string) (DeviceID, error)

NewDeviceIDFromString constructs a 'DeviceID' from its string representation.

func (DeviceID) GetDevice

func (d DeviceID) GetDevice() uint16

GetDevice returns the 'device' portion of a 'DeviceID'.

func (DeviceID) GetVendor

func (d DeviceID) GetVendor() uint16

GetVendor returns the 'vendor' portion of a 'DeviceID'.

func (DeviceID) String

func (d DeviceID) String() string

String returns a 'DeviceID' as a string.

type Series

type Series byte

Series represents the 'series' a vGPU type belongs to. vGPU types are grouped into series according to the different classes of workload for which they are optimized. Each series is identified by the last letter of the vGPU type name (i.e. A100-5C is a 'C-Series' vGPU type).

func (Series) IsValid

func (s Series) IsValid() bool

IsValid checks whether an ASCII character represents a valid series.

type VGPUConfig

type VGPUConfig map[string]int

VGPUConfig holds a map of strings representing a vGPU type to a count of that type. It is meant to represent the set of vGPU types (and how many of a particular type) should be instantiated on the GPU.

func (VGPUConfig) AssertValid

func (v VGPUConfig) AssertValid() error

AssertValid checks if all the vGPU types making up a 'VGPUConfig' are valid

func (VGPUConfig) Contains

func (v VGPUConfig) Contains(vgpuType string) bool

Contains checks if the provided 'vgpuType' is part of the 'VGPUConfig'.

func (VGPUConfig) Equals

func (v VGPUConfig) Equals(config VGPUConfig) bool

Equals checks if two 'VGPUConfig's are equal. Equality is determined by comparing the vGPU types contained in each 'VGPUConfig'.

type VGPUType

type VGPUType struct {
	GPU  string
	G    int
	GB   int
	S    Series
	Attr []string
}

VGPUType represents a specific vGPU type. Time-sliced vGPU types appear as <gpu>-<gb><series>. MIG-backed vGPU types appear as <gpu>-<g>-<gb><series>[ME, NOME, MEALL, GFX]. Examples include "A100-40C", "A100D-80C", "A100-1-5C", "A100-1-5CME", "DC-1-24CGFX" etc.

func ParseVGPUType

func ParseVGPUType(s string) (*VGPUType, error)

ParseVGPUType converts a string representation of a VGPUType into an object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL