From 12aca454abbdbdc11ec4f86ca16aebbad06cb50e Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Wed, 1 Mar 2023 14:51:11 +0200 Subject: [PATCH] Also install nvidia-ctk in toolkit-container Signed-off-by: Evan Lezar --- tools/container/toolkit/toolkit.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/container/toolkit/toolkit.go b/tools/container/toolkit/toolkit.go index 97b7336e..abaeded6 100644 --- a/tools/container/toolkit/toolkit.go +++ b/tools/container/toolkit/toolkit.go @@ -209,6 +209,11 @@ func Install(cli *cli.Context, opts *options) error { return fmt.Errorf("error installing NVIDIA container toolkit config: %v", err) } + _, err = installContainerToolkitCLI(opts.toolkitRoot) + if err != nil { + return fmt.Errorf("error installing NVIDIA Container Toolkit CLI: %v", err) + } + return nil } @@ -322,6 +327,19 @@ func installToolkitConfig(toolkitConfigPath string, nvidiaContainerCliExecutable return nil } +// installContainerToolkitCLI installs the nvidia-ctk CLI executable and wrapper. +func installContainerToolkitCLI(toolkitDir string) (string, error) { + e := executable{ + source: "/usr/bin/nvidia-ctk", + target: executableTarget{ + dotfileName: "nvidia-ctk.real", + wrapperName: "nvidia-ctk", + }, + } + + return e.install(toolkitDir) +} + // installContainerCLI sets up the NVIDIA container CLI executable, copying the executable // and implementing the required wrapper func installContainerCLI(toolkitRoot string) (string, error) {