gpu

package
v0.0.0-...-eeb2ccb Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 3 Imported by: 68

Documentation

Index

Constants

View Source
const (
	// ResourceNvidiaGPU is the name of the Nvidia GPU resource.
	ResourceNvidiaGPU = "nvidia.com/gpu"
	// ResourceDirectX is the name of the DirectX resource on windows.
	ResourceDirectX = "microsoft.com/directx"
	// DefaultGPUType is the type of GPU used in NAP if the user
	// don't specify what type of GPU his pod wants.
	DefaultGPUType = "nvidia-tesla-k80"
)
View Source
const (
	// MetricsGenericGPU - for when there is no information about GPU type
	MetricsGenericGPU = "generic"
	// MetricsMissingGPU - for when there's a label, but GPU didn't appear
	MetricsMissingGPU = "missing-gpu"
	// MetricsUnexpectedLabelGPU - for when there's a label, but no GPU at all
	MetricsUnexpectedLabelGPU = "unexpected-label"
	// MetricsUnknownGPU - for when GPU type is unknown
	MetricsUnknownGPU = "not-listed"
	// MetricsErrorGPU - for when there was an error obtaining GPU type
	MetricsErrorGPU = "error"
	// MetricsNoGPU - for when there is no GPU and no label all
	MetricsNoGPU = ""
)

Variables

This section is empty.

Functions

func GetGpuInfoForMetrics

func GetGpuInfoForMetrics(gpuConfig *cloudprovider.GpuConfig, availableGPUTypes map[string]struct{}, node *apiv1.Node, nodeGroup cloudprovider.NodeGroup) (gpuResource string, gpuType string)

GetGpuInfoForMetrics returns the name of the custom resource and the GPU used on the node or empty string if there's no GPU if the GPU type is unknown, "generic" is returned NOTE: current implementation is GKE/GCE-specific

func GetNodeGPUFromCloudProvider

func GetNodeGPUFromCloudProvider(provider cloudprovider.CloudProvider, node *apiv1.Node) *cloudprovider.GpuConfig

GetNodeGPUFromCloudProvider returns the GPU the node has. Returned GPU has the GPU label of the passed in cloud provider. If the node doesn't have a GPU, returns nil.

func NodeHasGpu

func NodeHasGpu(GPULabel string, node *apiv1.Node) bool

NodeHasGpu returns true if a given node has GPU hardware. The result will be true if there is hardware capability. It doesn't matter if the drivers are installed and GPU is ready to use.

func PodRequestsGpu

func PodRequestsGpu(pod *apiv1.Pod) bool

PodRequestsGpu returns true if a given pod has GPU request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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