gpushare

package
v1.8.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VolcanoGPUResource extended gpu resource
	VolcanoGPUResource = "volcano.sh/gpu-memory"
	// VolcanoGPUNumber virtual GPU card number
	VolcanoGPUNumber = "volcano.sh/gpu-number"

	// PredicateTime is the key of predicate time
	PredicateTime = "volcano.sh/predicate-time"
	// GPUIndex is the key of gpu index
	GPUIndex = "volcano.sh/gpu-index"

	// UnhealthyGPUIDs list of unhealthy gpu ids
	UnhealthyGPUIDs = "volcano.sh/gpu-unhealthy-ids"
)

Variables

View Source
var GpuNumberEnable bool
View Source
var GpuSharingEnable bool
View Source
var NodeLockEnable bool

Functions

func AddGPUIndexPatch

func AddGPUIndexPatch(ids []int) string

AddGPUIndexPatch returns the patch adding GPU index

func GetGPUIndex

func GetGPUIndex(pod *v1.Pod) []int

GetGPUIndex returns the index list of gpu cards

func RemoveGPUIndexPatch

func RemoveGPUIndexPatch() string

RemoveGPUIndexPatch returns the patch removing GPU index

Types

type GPUDevice

type GPUDevice struct {
	// GPU ID
	ID int
	// The pods that are sharing this GPU
	PodMap map[string]*v1.Pod
	// memory per card
	Memory uint
}

GPUDevice include gpu id, memory and the pods that are sharing it.

func NewGPUDevice

func NewGPUDevice(id int, mem uint) *GPUDevice

NewGPUDevice creates a device

type GPUDevices

type GPUDevices struct {
	Name string

	Device map[int]*GPUDevice
}

func NewGPUDevices

func NewGPUDevices(name string, node *v1.Node) *GPUDevices

func (*GPUDevices) AddResource

func (gs *GPUDevices) AddResource(pod *v1.Pod)

AddResource adds the pod to GPU pool if it is assigned

func (*GPUDevices) Allocate

func (gs *GPUDevices) Allocate(kubeClient kubernetes.Interface, pod *v1.Pod) error

func (*GPUDevices) FilterNode

func (gs *GPUDevices) FilterNode(pod *v1.Pod) (int, string, error)

func (*GPUDevices) GetIgnoredDevices

func (gs *GPUDevices) GetIgnoredDevices() []string

GetIgnoredDevices return device names which wish vc-scheduler to ignore

func (*GPUDevices) GetStatus

func (gs *GPUDevices) GetStatus() string

func (*GPUDevices) HasDeviceRequest

func (gs *GPUDevices) HasDeviceRequest(pod *v1.Pod) bool

func (*GPUDevices) Release

func (gs *GPUDevices) Release(kubeClient kubernetes.Interface, pod *v1.Pod) error

func (*GPUDevices) SubResource

func (gs *GPUDevices) SubResource(pod *v1.Pod)

SubResource frees the gpu hold by the pod

Jump to

Keyboard shortcuts

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