diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index e804f8e68312..09309e53993c 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -1445,7 +1445,7 @@ func validateEnableNvidiaGPUs(gpusEnabled bool, drvName, rtime string) error { if !gpusEnabled { return nil } - if drvName == constants.Docker && rtime == constants.Docker { + if drvName == constants.Docker && (rtime == constants.Docker || rtime == constants.DefaultContainerRuntime) { return nil } return errors.Errorf("The enable-nvidia-gpus flag can only be run with the docker driver and docker container-runtime") diff --git a/pkg/drivers/kic/kic.go b/pkg/drivers/kic/kic.go index 6f0f9da4b4f1..e90a37057674 100644 --- a/pkg/drivers/kic/kic.go +++ b/pkg/drivers/kic/kic.go @@ -453,7 +453,7 @@ func (d *Driver) Stop() error { } } - runtime, err := cruntime.New(cruntime.Config{Type: d.NodeConfig.ContainerRuntime, Runner: d.exec, EnableNvidiaGPUs: d.NodeConfig.EnableNvidiaGPUs}) + runtime, err := cruntime.New(cruntime.Config{Type: d.NodeConfig.ContainerRuntime, Runner: d.exec}) if err != nil { // won't return error because: // even though we can't stop the cotainers inside, we still wanna stop the minikube container itself klog.Errorf("unable to get container runtime: %v", err) diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index 9047c8b362f1..fc1142531f35 100755 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -394,6 +394,7 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k ImageRepository: cc.KubernetesConfig.ImageRepository, KubernetesVersion: kv, InsecureRegistry: cc.InsecureRegistry, + EnableNvidiaGPUs: cc.EnableNvidiaGPUs, } cr, err := cruntime.New(co) if err != nil {