Skip to content

Commit

Permalink
fix gpus flag not getting passed to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
spowelljr committed Sep 27, 2023
1 parent 3a592d4 commit 89b93d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion pkg/drivers/kic/kic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions pkg/minikube/node/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 89b93d0

Please sign in to comment.