From 292152b7ba2fff47063f7712cda18987a57d80fb Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Wed, 25 Oct 2023 12:42:05 -0700 Subject: [PATCH] GPUs: Check for existing NVIDIA container toolkit install --- pkg/minikube/cruntime/docker.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index a509df9e12e1..fd861bd10dc1 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -583,6 +583,10 @@ func (r *Docker) configureDocker(driver string) error { // https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html func (r *Docker) installNvidiaContainerToolkit() error { out.Styled(style.Warning, "Using GPUs with the Docker driver is experimental, if you experience any issues please report them at: https://github.com/kubernetes/minikube/issues/new/choose") + if _, err := r.Runner.RunCmd(exec.Command("dpkg", "-l", "nvidia-container-toolkit")); err == nil { + klog.Info("nvidia-container-toolkit is already installed, skipping install") + return nil + } out.Styled(style.Toolkit, "Installing the NVIDIA Container Toolkit...") cmds := []string{ "curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg",