Documentation ¶
Index ¶
- Constants
- func GetGpuInfoForMetrics(gpuConfig *cloudprovider.GpuConfig, availableGPUTypes map[string]struct{}, ...) (gpuResource string, gpuType string)
- func GetNodeGPUFromCloudProvider(provider cloudprovider.CloudProvider, node *apiv1.Node) *cloudprovider.GpuConfig
- func NodeHasGpu(GPULabel string, node *apiv1.Node) bool
- func PodRequestsGpu(pod *apiv1.Pod) bool
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 ¶
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 ¶
PodRequestsGpu returns true if a given pod has GPU request.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.