nvidia

package
v0.0.0-...-58867ac Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerSock    = pluginapi.DevicePluginPath + "doslab.sock"
	ResourceName  = "doslab.io/gpu-memory"
	ResourceCount = "doslab.io/gpu-count"
	ResourceCore  = "doslab.io/gpu-core"

	AnnResourceAssumeTime = "doslab.io/gpu-assume-time"
	AnnAssignedFlag       = "doslab.io/gpu-assigned"
	AnnResourceUUID       = "doslab.io/gpu-uuid"
	AnnVCUDAReady         = "doslab.io/vcuda"

	NvidiaCtlDevice    = "/dev/nvidiactl"
	NvidiaUVMDevice    = "/dev/nvidia-uvm"
	DriverLibraryPath  = "/etc/kube-gpu/vdriver/nvidia"
	VirtualManagerPath = "/etc/kube-gpu/vm"
	VCUDA_MOUNTPOINT   = "/etc/vcuda"

	EnvResourceUUID            = "DOSLAB_IO_GPU_UUID"
	EnvResourceUsedByPod       = "DOSLAB_IO_GPU_RESOURCE_USED_BY_POD"
	EnvResourceUsedByContainer = "DOSLAB_IO_GPU_RESOURCE_USED_BY_CONTAINER"
	EnvResourceTotal           = "DOSLAB_IO_GPU_RESOURCE_TOTAL"

	EnvNvidiaGPU                = "NVIDIA_VISIBLE_DEVICES"
	EnvPodName                  = "POD_NAME"
	EnvNvidiaDriverCapabilities = "NVIDIA_DRIVER_CAPABILITIES"
)

Variables

This section is empty.

Functions

func GetDevices

func GetDevices() ([]*pluginapi.Device, map[uint]string)

func NewFileWatcher

func NewFileWatcher(files ...string) (*fsnotify.Watcher, error)

func NewOSWatcher

func NewOSWatcher(sigs ...os.Signal) chan os.Signal

Types

type KubeMessenger

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

KubeMessenger is used to communicate with api server

func NewKubeMessenger

func NewKubeMessenger(client *kubesys.KubernetesClient, nodeName string) *KubeMessenger

func (*KubeMessenger) GetPendingPodsOnNode

func (m *KubeMessenger) GetPendingPodsOnNode() []*v1.Pod

func (*KubeMessenger) GetPodOnNode

func (m *KubeMessenger) GetPodOnNode(podName, namespace string) *v1.Pod

func (*KubeMessenger) PatchGPUCount

func (m *KubeMessenger) PatchGPUCount(count, core uint) error

func (*KubeMessenger) UpdatePodAnnotations

func (m *KubeMessenger) UpdatePodAnnotations(pod *v1.Pod) error

type NvidiaDevicePlugin

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

NvidiaDevicePlugin implements the Kubernetes device plugin API

func NewNvidiaDevicePlugin

func NewNvidiaDevicePlugin(client *kubesys.KubernetesClient, nodeName string) *NvidiaDevicePlugin

func (*NvidiaDevicePlugin) Allocate

func (*NvidiaDevicePlugin) GetDevicePluginOptions

func (*NvidiaDevicePlugin) ListAndWatch

func (*NvidiaDevicePlugin) Register

func (p *NvidiaDevicePlugin) Register(resourceName string) error

func (*NvidiaDevicePlugin) Serve

func (p *NvidiaDevicePlugin) Serve() error

func (*NvidiaDevicePlugin) Start

func (p *NvidiaDevicePlugin) Start() error

Start mainly starts the gRPC server and register the device plugin to Kubelet

func (*NvidiaDevicePlugin) Stop

func (p *NvidiaDevicePlugin) Stop() error

Jump to

Keyboard shortcuts

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