From bd00e7de187eb792af5c9cd140b20eb0615db40c Mon Sep 17 00:00:00 2001 From: Christopher Desiniotis Date: Fri, 20 Dec 2024 10:06:23 -0800 Subject: [PATCH] Raise a warning instead of an error if GPU mode labeler fails For environments like WSL2 where GPUs do not show up as PCI devices, creating the GPU mode labeler will fail. This change allows GFD to proceed even if it is unable to get the GPU mode label. Signed-off-by: Christopher Desiniotis --- internal/lm/nvml.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/lm/nvml.go b/internal/lm/nvml.go index 724dff7bc..4d3e00496 100644 --- a/internal/lm/nvml.go +++ b/internal/lm/nvml.go @@ -215,7 +215,8 @@ func isMPSCapable(manager resource.Manager) (bool, error) { func newGPUModeLabeler(devices []resource.Device) (Labeler, error) { classes, err := getDeviceClasses(devices) if err != nil { - return nil, err + klog.Warningf("Failed to create GPU mode labeler: failed to get device classes: %v", err) + return Labels{"nvidia.com/gpu.mode": "unknown"}, nil } gpuMode := getModeForClasses(classes) labels := Labels{