gpu

package
v0.0.0-...-487e2cc Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package gpu provides utilities for interacting with GPU resources.

Package gpu provides utilities for interacting with GPU resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractGPUType

func ExtractGPUType(deviceName string) string

ExtractGPUType returns the normalized GPU model type from a device name.

func ExtractSimpleGPUName

func ExtractSimpleGPUName(gpuName ResourceGPU) (string, bool)

ExtractSimpleGPUName returns a simplified GPU name. If the resource is not recognized, the second return value is false.

func GFDLabelToGPUDeviceName

func GFDLabelToGPUDeviceName(label string) string

GFDLabelToGPUDeviceName converts a GPU Feature Discovery label to a GPU Device name as generated by NVML

func IsNvidiaKubernetesResource

func IsNvidiaKubernetesResource(resourceName string) bool

IsNvidiaKubernetesResource returns true if the resource name is a Kubernetes resource for an NVIDIA GPU, either a generic GPU or a MIG GPU.

func NormalizeGPUDeviceName

func NormalizeGPUDeviceName(device string) string

NormalizeGPUDeviceName normalizes a GPU device name by converting it to lowercase and replacing spaces with underscores.

Types

type ResourceGPU

type ResourceGPU string

ResourceGPU represents a GPU resource

const (
	// GpuNvidiaGeneric is the resource name for a generic NVIDIA GPU
	GpuNvidiaGeneric ResourceGPU = "nvidia.com/gpu"
	// GpuNvidiaDRA is the driver name for NVIDIA GPUs allocated through Kubernetes Dynamic Resource Allocation
	GpuNvidiaDRA ResourceGPU = "gpu.nvidia.com"
	// GpuAMD is the resource name for an AMD GPU
	GpuAMD ResourceGPU = "amd.com/gpu"
	// GpuIntelXe is the resource name for an Intel Xe GPU
	GpuIntelXe ResourceGPU = "gpu.intel.com/xe"
	// GpuInteli915 is the resource name for an Intel i915 GPU
	GpuInteli915 ResourceGPU = "gpu.intel.com/i915"
	// GpuNvidiaMigPrefix is the prefix for NVIDIA MIG GPU resources
	GpuNvidiaMigPrefix ResourceGPU = "nvidia.com/mig"
)

Resource name prefixes

Jump to

Keyboard shortcuts

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