diff --git a/internal/config/image/cuda_image.go b/internal/config/image/cuda_image.go index b30e27fa..4a255cb5 100644 --- a/internal/config/image/cuda_image.go +++ b/internal/config/image/cuda_image.go @@ -135,15 +135,15 @@ func (i CUDA) DevicesFromEnvvars(envVars ...string) VisibleDevices { // Environment variable unset with legacy image: default to "all". if !isSet && len(devices) == 0 && i.IsLegacy() { - return newVisibleDevices("all") + return NewVisibleDevices("all") } // Environment variable unset or empty or "void": return nil if len(devices) == 0 || requested["void"] { - return newVisibleDevices("void") + return NewVisibleDevices("void") } - return newVisibleDevices(devices...) + return NewVisibleDevices(devices...) } // GetDriverCapabilities returns the requested driver capabilities. diff --git a/internal/config/image/devices.go b/internal/config/image/devices.go index 125bcc0e..f5a6ad95 100644 --- a/internal/config/image/devices.go +++ b/internal/config/image/devices.go @@ -32,8 +32,8 @@ var _ VisibleDevices = (*none)(nil) var _ VisibleDevices = (*void)(nil) var _ VisibleDevices = (*devices)(nil) -// newVisibleDevices creates a VisibleDevices based on the value of the specified envvar. -func newVisibleDevices(envvars ...string) VisibleDevices { +// NewVisibleDevices creates a VisibleDevices based on the value of the specified envvar. +func NewVisibleDevices(envvars ...string) VisibleDevices { for _, envvar := range envvars { if envvar == "all" { return all{}