nvidia

package
v0.0.0-...-73e59ce Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFakeNvidiaGPUManager

func NewFakeNvidiaGPUManager(info *nvgputypes.GpusInfo, volume string, volumeDriver string) (devtypes.Device, error)

func NewNvidiaGPUManager

func NewNvidiaGPUManager() (devtypes.Device, error)

NewNvidiaGPUManager returns a GPUManager that manages local Nvidia GPUs. TODO: Migrate to use pod level cgroups and make it generic to all runtimes.

Types

type NvidiaDockerPlugin

type NvidiaDockerPlugin struct {
}

func (*NvidiaDockerPlugin) GetGPUCommandLine

func (ndp *NvidiaDockerPlugin) GetGPUCommandLine(devices []int) ([]byte, error)

func (*NvidiaDockerPlugin) GetGPUInfo

func (ndp *NvidiaDockerPlugin) GetGPUInfo() ([]byte, error)

type NvidiaFakePlugin

type NvidiaFakePlugin struct {
	// contains filtered or unexported fields
}

func (*NvidiaFakePlugin) GetGPUCommandLine

func (np *NvidiaFakePlugin) GetGPUCommandLine(devices []int) ([]byte, error)

func (*NvidiaFakePlugin) GetGPUInfo

func (np *NvidiaFakePlugin) GetGPUInfo() ([]byte, error)

type NvidiaGPUManager

type NvidiaGPUManager struct {
	sync.Mutex

	GpusInfo *nvgputypes.GpusInfo
	// contains filtered or unexported fields
}

NvidiaGPUManager manages nvidia gpu devices.

func (*NvidiaGPUManager) Allocate

func (ngm *NvidiaGPUManager) Allocate(pod *types.PodInfo, container *types.ContainerInfo) ([]devtypes.Mount, []string, map[string]string, error)

For use with nvidia runtime (nvidia docker2)

func (*NvidiaGPUManager) AllocateOld

func (ngm *NvidiaGPUManager) AllocateOld(pod *types.PodInfo, container *types.ContainerInfo) ([]devtypes.Mount, []string, map[string]string, error)

AllocateGPU returns MountName, MountDriver, and list of Devices to use

func (*NvidiaGPUManager) GetName

func (ngm *NvidiaGPUManager) GetName() string

func (*NvidiaGPUManager) New

func (ngm *NvidiaGPUManager) New() error

func (*NvidiaGPUManager) Start

func (ngm *NvidiaGPUManager) Start() error

func (*NvidiaGPUManager) UpdateGPUInfo

func (ngm *NvidiaGPUManager) UpdateGPUInfo() error

Initialize the GPU devices

func (*NvidiaGPUManager) UpdateNodeInfo

func (ngm *NvidiaGPUManager) UpdateNodeInfo(nodeInfo *types.NodeInfo) error

Get how many GPU cards we have.

type NvidiaPlugin

type NvidiaPlugin interface {
	GetGPUInfo() ([]byte, error)
	GetGPUCommandLine(deviceIndex []int) ([]byte, error)
}

Jump to

Keyboard shortcuts

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