mirror of
https://github.com/cozystack/cozystack.git
synced 2026-10-29 08:07:33 +09:00
GPUNode is the hoster's per-node view of GPUs and the binder's source of device health, so something on each node has to report it. The agent reads the GPU functions from sysfs and what kubelet's device plugins make of them from the pod-resources API. Plugins report devices by PCI address, mdev UUID or IOMMU group, so each ID is resolved through sysfs by its shape rather than by knowing the plugin. A group counts only through functions bound to vfio, so the plain indexes NVIDIA's container plugin may report do not read as groups. GPUs of NVIDIA's container plugin, reported by NVML UUID, cannot be placed through sysfs, but their resource name still joins resourceNames, since pods request GPUs by it. pod-resources carries no health; kubelet lists only healthy devices as allocatable, which is what the agent reads health from, and it counts them per function, because an mdev parent serves several. Pods in a final phase are skipped because kubelet 1.32 and 1.33 still list them with devices a new pod may hold. The binder writes conditions into the same status, so the agent only merge-patches its own fields, and it writes no GPUNode but its own node's. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>