Documentation ¶
Index ¶
Constants ¶
const (
AttributeMediaExtensions = nvdev.AttributeMediaExtensions
)
Variables ¶
This section is empty.
Functions ¶
func AssertValidMigProfileFormat ¶ added in v0.5.2
AssertValidMigProfileFormat checks if the string is in the proper format to represent a MIG profile
func SetMockNVdevlib ¶ added in v0.5.2
func SetMockNVdevlib()
Types ¶
type ComputeInstanceState ¶ added in v0.4.0
ComputeInstanceState stores the MIG state for a specific ComputeInstance.
type DeviceID ¶
type DeviceID uint32
DeviceID represents a GPU Device ID as read from a GPUs PCIe config space.
func NewDeviceID ¶
NewDeviceID constructs a new 'DeviceID' from the device and vendor values pulled from a GPUs PCIe config space.
func NewDeviceIDFromString ¶
NewDeviceIDFromString constructs a 'DeviceID' from its string representation.
type DeviceState ¶ added in v0.4.0
type DeviceState struct { UUID string MigMode mig.Mode GpuInstances []GpuInstanceState }
DeviceState stores the MIG state for a specific GPU.
type GpuInstanceState ¶ added in v0.4.0
type GpuInstanceState struct { ProfileID int Placement nvml.GpuInstancePlacement ComputeInstances []ComputeInstanceState }
GpuInstanceState stores the MIG state for a specific GPUInstance.
type MigConfig ¶
MigConfig holds a map of strings representing a MigProfile to a count of that profile type. It is meant to represent the set of MIG profiles (and how many of a particular type) should be instantiated on a GPU.
func NewMigConfig ¶ added in v0.4.0
func NewMigConfig(mps []*MigProfile) MigConfig
NewMigConfig creates a new 'MigConfig' from a slice of 'MigProfile's.
func (MigConfig) AssertValidFormat ¶ added in v0.5.2
AssertValidFormat checks to ensure that all of the 'MigProfiles's making up a 'MigConfig' are of a valid format.
func (MigConfig) Equals ¶
Equals checks if two 'MigConfig's are equal. Equality is determined by comparing the profiles contained in each 'MigConfig'.
func (MigConfig) Flatten ¶
func (m MigConfig) Flatten() []*MigProfile
Flatten converts a 'MigConfig' into a slice of 'MigProfile's. Duplicate 'MigProfile's will exist in this slice for each profile represented in the 'MigConfig'.
func (MigConfig) IsSubsetOf ¶
IsSubsetOf checks if the provided 'MigConfig' is a subset of the originating 'MigConfig'.
type MigConfigGroup ¶
type MigConfigGroup interface { GetDeviceTypes() []*MigProfile GetPossibleConfigurations() []MigConfig AssertValidConfiguration(MigConfig) error }
MigConfigGroup provides an interface for intaracting with a logical group of 'MigConfig's. One such group is the set of all valid MigConfigs for the A100, for example.
type MigConfigGroupBase ¶
type MigConfigGroupBase struct {
Configs []MigConfig
}
MigConfigGroupBase is a base struct for constructing a full 'MigConfigGroup'. It holds the slice of 'MigConfig' structs associated with the group.
func (*MigConfigGroupBase) AssertValidConfiguration ¶
func (m *MigConfigGroupBase) AssertValidConfiguration(config MigConfig) error
AssertValidConfiguration checks to ensure that the supplied 'MigConfig' is both valid and part of the 'MigConfigGroup'.
func (*MigConfigGroupBase) GetPossibleConfigurations ¶
func (m *MigConfigGroupBase) GetPossibleConfigurations() []MigConfig
GetPossibleConfigurations gets all possible configurations associated with a 'MigConfigGroup'.
type MigConfigGroups ¶
type MigConfigGroups map[DeviceID]MigConfigGroup
MigConfigGroups holds the mapping from a specific 'DeviceID' to a 'MigConfigGroup'.
type MigProfile ¶
type MigProfile struct {
nvdev.MigProfileInfo
}
MigProfile represents a specific MIG profile. Examples include "1g.5gb", "2g.10gb", "1c.2g.10gb", or "1c.1g.5gb+me", etc.
func MustParseMigProfile ¶ added in v0.4.0
func MustParseMigProfile(profile string) *MigProfile
MustParseMigProfile does the same as Parse(), but never throws an error.
func NewMigProfile ¶
func NewMigProfile(giProfileID, ciProfileID, ciEngProfileID int, migMemorySizeMB, deviceMemorySizeBytes uint64) (*MigProfile, error)
NewMigProfile constructs a new Profile struct using info from the giProfiles and ciProfiles used to create it.
func ParseMigProfile ¶ added in v0.4.0
func ParseMigProfile(profile string) (*MigProfile, error)
ParseMigProfile converts a string representation of a MigProfile into an object.
func (MigProfile) HasAttribute ¶ added in v0.4.0
func (m MigProfile) HasAttribute(attr string) bool
HasAttribute checks if the MigProfile has the specified attribute associated with it.
type MigState ¶ added in v0.4.0
type MigState struct {
Devices []DeviceState
}
MigState stores the MIG state for a set of GPUs.