nvidia

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMigCapabilityDevicePaths

func GetMigCapabilityDevicePaths() (map[string]string, error)

GetMigCapabilityDevicePaths returns a mapping of MIG capability path to device node path

Types

type CudaDriverVersion

type CudaDriverVersion int

func (CudaDriverVersion) MajorAndMinor

func (v CudaDriverVersion) MajorAndMinor() (major uint, minor uint)

type DeviceLib

type DeviceLib struct {
	NvmlInterface
	// contains filtered or unexported fields
}

func NewDeviceLib

func NewDeviceLib(driverRoot DriverRoot) (*DeviceLib, error)

func (DeviceLib) CreateMigDevice

func (l DeviceLib) CreateMigDevice(gpu *GpuInfo, profile nvdev.MigProfile, placement *nvml.GpuInstancePlacement) (*MigInfo, error)

TODO: Reenable dynamic MIG functionality once it is supported in Kubernetes 1.32

func (DeviceLib) DeleteMigDevice

func (l DeviceLib) DeleteMigDevice(mig *MigInfo) error

func (DeviceLib) GetGPUInfo

func (l DeviceLib) GetGPUInfo(index int, device nvdev.Device) (*GpuInfo, error)

func (DeviceLib) GetMigInfos

func (l DeviceLib) GetMigInfos(gpuInfo *GpuInfo) (map[string]*MigInfo, error)

func (DeviceLib) Init

func (l DeviceLib) Init() error

func (DeviceLib) SetComputeMode

func (l DeviceLib) SetComputeMode(uuids []string, mode string) error

func (DeviceLib) SetTimeSlice

func (l DeviceLib) SetTimeSlice(uuids []string, timeSlice int) error

func (DeviceLib) Shutdown

func (l DeviceLib) Shutdown()

type DriverRoot

type DriverRoot string

func (DriverRoot) GetDevRoot

func (r DriverRoot) GetDevRoot() string

GetDevRoot returns the dev root associated with the root. If the root is not a dev root, this defaults to "/".

func (DriverRoot) GetDriverLibraryPath

func (r DriverRoot) GetDriverLibraryPath() (string, error)

GetDriverLibraryPath returns path to `libnvidia-ml.so.1` in the driver root. The folder for this file is also expected to be the location of other driver files.

type DriverVersion

type DriverVersion struct {
	DriverVersion     string
	CudaDriverVersion CudaDriverVersion
}

type GpuInfo

type GpuInfo struct {
	Index                 int
	UUID                  string `json:"uuid"`
	Minor                 int
	MigEnabled            bool
	PciInfo               nvml.PciInfo
	Memory                nvml.Memory
	ProductName           string
	Brand                 string
	Architecture          string
	CudaComputeCapability string
	MigProfiles           []*MigProfileInfo
}

func (GpuInfo) GetNumaNode

func (g GpuInfo) GetNumaNode() (int, bool)

GetNumaNode returns the NUMA node associated with the GPU device

func (*GpuInfo) GetPaths

func (g *GpuInfo) GetPaths() ([]string, error)

type MigDevicePlacement

type MigDevicePlacement struct {
	nvml.GpuInstancePlacement
}

type MigInfo

type MigInfo struct {
	UUID          string `json:"uuid"`
	Index         int
	Profile       string
	Parent        *GpuInfo
	Placement     *MigDevicePlacement
	GiProfileInfo *nvml.GpuInstanceProfileInfo
	GiInfo        *nvml.GpuInstanceInfo
	CiProfileInfo *nvml.ComputeInstanceProfileInfo
	CiInfo        *nvml.ComputeInstanceInfo
}

func (*MigInfo) GetPaths

func (m *MigInfo) GetPaths() ([]string, error)

type MigProfileInfo

type MigProfileInfo struct {
	Profile    nvdev.MigProfile
	Placements []*MigDevicePlacement
}

type NvmlInterface

type NvmlInterface nvml.Interface

Jump to

Keyboard shortcuts

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