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 ¶
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 ¶
GFDLabelToGPUDeviceName converts a GPU Feature Discovery label to a GPU Device name as generated by NVML
func IsNvidiaKubernetesResource ¶
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 ¶
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