From d9c52ecd4e922eeaebd9e20fcbb0a11a0330157d Mon Sep 17 00:00:00 2001 From: Jean-Francois Roy Date: Thu, 31 Oct 2024 09:18:39 -0700 Subject: [PATCH] remove runtime wrapper driver detection This will be handled by the runtime itself. Signed-off-by: Jean-Francois Roy --- tools/container/wrapper/wrapper.go | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/tools/container/wrapper/wrapper.go b/tools/container/wrapper/wrapper.go index ac6ef90f..93763678 100644 --- a/tools/container/wrapper/wrapper.go +++ b/tools/container/wrapper/wrapper.go @@ -22,8 +22,6 @@ import ( "io/fs" "log" "os" - "os/exec" - "path/filepath" "strings" "golang.org/x/sys/unix" @@ -34,18 +32,6 @@ func main() { if err != nil { log.Fatalf("failed to get executable: %v", err) } - if isRuntimeWrapper(program) && !isNvidiaModuleLoaded() { - log.Println("nvidia driver modules are not yet loaded, invoking runc directly") - program, err := exec.LookPath("runc") - if err != nil { - log.Fatalf("failed to find runc: %v", err) - } - argv := []string{"runc"} - argv = append(argv, os.Args[1:]...) - if err := unix.Exec(program, argv, os.Environ()); err != nil { - log.Fatalf("failed to exec %s: %v", program, err) - } - } argv := makeArgv(program) envv := makeEnvv(program) if err := unix.Exec(program+".real", argv, envv); err != nil { @@ -54,17 +40,6 @@ func main() { } -func isRuntimeWrapper(program string) bool { - return filepath.Base(program) == "nvidia-container-runtime" || - filepath.Base(program) == "nvidia-container-runtime.cdi" || - filepath.Base(program) == "nvidia-container-runtime.legacy" -} - -func isNvidiaModuleLoaded() bool { - _, err := os.Stat("/proc/driver/nvidia/version") - return err == nil -} - func makeArgv(program string) []string { argv := []string{os.Args[0] + ".real"} f, err := os.Open(program + ".argv")