Documentation
¶
Index ¶
Constants ¶
const ProductLabel = "nvidia.com/gpu.product"
ProductLabel is the node label that reports the GPU product installed on a node, e.g. "NVIDIA-H100-80GB-HBM3".
Variables ¶
This section is empty.
Functions ¶
func MajorityArchitecture ¶
MajorityArchitecture returns the GPU architecture reported by the most nodes, parsed from each node's nvidia.com/gpu.product label via ParseProduct. It is the single source of truth for architecture detection: the controllers and every CLI path (render, cluster info, workloadrun) derive gpusPerNode, MNNVL, and override matching from its result, so a mixed-architecture target resolves to the same architecture everywhere (issue #248).
Only labeled nodes vote. A node without the label (or with an empty value) never outvotes labeled nodes, so a fleet where the GPU feature-discovery labeler has not reached every node still detects the architecture the labeled nodes report. The function returns "" only when no node is labeled (including an empty input); callers map that to their own "unknown" sentinel or fallback.
The winner is derived by walking the slice in order with a strictly-greater count comparison (the counts map is only indexed, never iterated), so the result is deterministic for a given node order and ties resolve to the architecture whose earliest node appears first. Callers pass name-sorted nodes, which makes the result stable for a given cluster. This is the exact tie-break the Workflow and Certification controllers adopted for issue #77.
func ParseProduct ¶
ParseProduct extracts the GPU architecture from a GPU product name. It accepts both the NVIDIA GPU Feature Discovery label format, which is hyphen-separated (e.g. "NVIDIA-H100-80GB-HBM3"), and the ResourceSlice productName device attribute format used on DRA-only platforms, which is space-separated (e.g. "NVIDIA GB300"). It strips the "NVIDIA" prefix, takes the first segment before any hyphen or space, and lowercases it. RTX PRO 6000 keeps its full model name. Examples: "NVIDIA-H100-80GB-HBM3" → "h100", "NVIDIA GB300" → "gb300", and "NVIDIA-RTX-PRO-6000-Blackwell-Server-Edition" → "rtxpro6000". Returns "" if the input is empty.
func ProductLabelValue ¶ added in v0.6.0
ProductLabelValue converts an NVML device name, e.g. "NVIDIA GB300", to the nvidia.com/gpu.product label value GFD writes for it, "NVIDIA-GB300". It mirrors sanitise in NVIDIA/k8s-device-plugin internal/lm/resource.go, which owns the format: drop characters outside [A-Za-z0-9-_. ], then join the whitespace-separated fields with hyphens. GFD's resourceLabeler.getProductName in the same file also appends "-SHARED" under time-slicing; that suffix is not modeled here.
Types ¶
This section is empty.