diff --git a/internal/lm/resource.go b/internal/lm/resource.go index 5ceda38b0..f85f38f20 100644 --- a/internal/lm/resource.go +++ b/internal/lm/resource.go @@ -21,6 +21,8 @@ import ( "regexp" "strings" + "k8s.io/klog/v2" + spec "github.com/NVIDIA/k8s-device-plugin/api/config/v1" "github.com/NVIDIA/k8s-device-plugin/internal/resource" ) @@ -46,7 +48,7 @@ func NewGPUResourceLabeler(config *spec.Config, device resource.Device, count in totalMemoryMiB, err := device.GetTotalMemoryMiB() if err != nil { - return nil, fmt.Errorf("failed to get memory info for device: %v", err) + klog.Warningf("Ignoring error getting memory info for device: %v", err) } resourceLabeler := newResourceLabeler(fullGPUResourceName, config) diff --git a/internal/rm/devices.go b/internal/rm/devices.go index f3b77c5fb..3083e4343 100644 --- a/internal/rm/devices.go +++ b/internal/rm/devices.go @@ -21,6 +21,7 @@ import ( "strconv" "strings" + "k8s.io/klog/v2" pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1" ) @@ -73,7 +74,7 @@ func BuildDevice(index string, d deviceInfo) (*Device, error) { totalMemory, err := d.GetTotalMemory() if err != nil { - return nil, fmt.Errorf("error getting device memory: %w", err) + klog.Warningf("Ignoring error getting device memory: %v", err) } computeCapability, err := d.GetComputeCapability()