diff --git a/cmd/nvidia-container-runtime-hook/hook_config.go b/cmd/nvidia-container-runtime-hook/hook_config.go index 3bd0828f..afdb8bbc 100644 --- a/cmd/nvidia-container-runtime-hook/hook_config.go +++ b/cmd/nvidia-container-runtime-hook/hook_config.go @@ -17,8 +17,6 @@ const ( driverPath = "/run/nvidia/driver" ) -var defaultPaths = [...]string{} - // HookConfig : options for the nvidia-container-runtime-hook. type HookConfig config.Config diff --git a/cmd/nvidia-ctk/cdi/transform/root/root.go b/cmd/nvidia-ctk/cdi/transform/root/root.go index 191eb8be..ad9d2e22 100644 --- a/cmd/nvidia-ctk/cdi/transform/root/root.go +++ b/cmd/nvidia-ctk/cdi/transform/root/root.go @@ -28,11 +28,6 @@ import ( "github.com/urfave/cli/v2" ) -type loadSaver interface { - Load() (spec.Interface, error) - Save(spec.Interface) error -} - type command struct { logger logger.Interface } diff --git a/internal/dxcore/api.go b/internal/dxcore/api.go index fd63d5a6..ed70bb4f 100644 --- a/internal/dxcore/api.go +++ b/internal/dxcore/api.go @@ -16,15 +16,6 @@ package dxcore -import ( - "github.com/NVIDIA/go-nvml/pkg/dl" -) - -const ( - libraryName = "libdxcore.so" - libraryLoadFlags = dl.RTLD_LAZY | dl.RTLD_GLOBAL -) - // dxcore stores a reference the dxcore dynamic library var dxcore *context diff --git a/internal/modifier/cdi.go b/internal/modifier/cdi.go index 69e2a9fa..3fb44221 100644 --- a/internal/modifier/cdi.go +++ b/internal/modifier/cdi.go @@ -28,12 +28,6 @@ import ( "github.com/container-orchestrated-devices/container-device-interface/pkg/parser" ) -type cdiModifier struct { - logger logger.Interface - specDirs []string - devices []string -} - // NewCDIModifier creates an OCI spec modifier that determines the modifications to make based on the // CDI specifications available on the system. The NVIDIA_VISIBLE_DEVICES enviroment variable is // used to select the devices to include. diff --git a/internal/modifier/csv.go b/internal/modifier/csv.go index 56adcdc7..22688e20 100644 --- a/internal/modifier/csv.go +++ b/internal/modifier/csv.go @@ -22,7 +22,6 @@ import ( "github.com/NVIDIA/nvidia-container-toolkit/internal/config" "github.com/NVIDIA/nvidia-container-toolkit/internal/config/image" "github.com/NVIDIA/nvidia-container-toolkit/internal/cuda" - "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" "github.com/NVIDIA/nvidia-container-toolkit/internal/modifier/cdi" "github.com/NVIDIA/nvidia-container-toolkit/internal/oci" @@ -31,12 +30,6 @@ import ( "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi" ) -// csvMode represents the modifications as performed by the csv runtime mode -type csvMode struct { - logger logger.Interface - discoverer discover.Discover -} - const ( visibleDevicesEnvvar = "NVIDIA_VISIBLE_DEVICES" visibleDevicesVoid = "void" diff --git a/internal/requirements/constraints/constants.go b/internal/requirements/constraints/constants.go index 9e515214..24f93353 100644 --- a/internal/requirements/constraints/constants.go +++ b/internal/requirements/constraints/constants.go @@ -16,8 +16,6 @@ package constraints -import "fmt" - const ( equal = "=" notEqual = "!=" @@ -37,15 +35,3 @@ func (c always) Assert() error { func (c always) String() string { return "true" } - -// invalid is an invalid constraint and can never be met -type invalid string - -func (c invalid) Assert() error { - return fmt.Errorf("invalid constraint: %v", c.String()) -} - -// String returns the string representation of the contraint -func (c invalid) String() string { - return string(c) -} diff --git a/tools/container/containerd/config_v2_test.go b/tools/container/containerd/config_v2_test.go index 3081b8a8..a1b7413e 100644 --- a/tools/container/containerd/config_v2_test.go +++ b/tools/container/containerd/config_v2_test.go @@ -90,7 +90,6 @@ func TestUpdateV2ConfigDefaultRuntime(t *testing.T) { func TestUpdateV2Config(t *testing.T) { const runtimeDir = "/test/runtime/dir" - const expectedVersion = int64(2) testCases := []struct { runtimeName string diff --git a/tools/container/toolkit/runtime.go b/tools/container/toolkit/runtime.go index 220d7ff5..92195975 100644 --- a/tools/container/toolkit/runtime.go +++ b/tools/container/toolkit/runtime.go @@ -82,16 +82,3 @@ func newRuntimeInstaller(source string, target executableTarget, env map[string] return &r } - -func findLibraryRoot(root string) (string, error) { - libnvidiamlPath, err := findManagementLibrary(root) - if err != nil { - return "", fmt.Errorf("error locating NVIDIA management library: %v", err) - } - - return filepath.Dir(libnvidiamlPath), nil -} - -func findManagementLibrary(root string) (string, error) { - return findLibrary(root, "libnvidia-ml.so") -}