From 95318c5af14513e7b0b310f34286008e72137c9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 11:44:40 +0000 Subject: [PATCH] Bump github.com/NVIDIA/nvidia-container-toolkit Bumps [github.com/NVIDIA/nvidia-container-toolkit](https://github.com/NVIDIA/nvidia-container-toolkit) from 1.14.4-0.20231120225202-039d7fd32429 to 1.15.0-rc.3. - [Release notes](https://github.com/NVIDIA/nvidia-container-toolkit/releases) - [Changelog](https://github.com/NVIDIA/nvidia-container-toolkit/blob/main/CHANGELOG.md) - [Commits](https://github.com/NVIDIA/nvidia-container-toolkit/commits/v1.15.0-rc.3) --- updated-dependencies: - dependency-name: github.com/NVIDIA/nvidia-container-toolkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 6 +- go.sum | 11 +- .../go-nvlib/pkg/nvlib/device/identifier.go | 94 ++++++++++++ .../internal/discover/filter.go | 4 +- .../no-op.go => internal/discover/gdrcopy.go} | 24 ++-- .../internal/discover/graphics.go | 52 ++++--- .../internal/discover/ldconfig.go | 14 +- .../internal/discover/nvswitch.go | 33 +++++ .../internal/edits/device.go | 3 +- .../internal/edits/edits.go | 7 +- .../internal/edits/hook.go | 3 +- .../internal/edits/mount.go | 3 +- .../internal/lookup/cuda/cuda.go | 44 +----- .../internal/lookup/file.go | 82 ++++++----- .../internal/lookup/library.go | 38 +++-- .../internal/lookup/locator.go | 3 +- .../internal/lookup/root/root.go | 65 +++++++++ .../internal/oci/spec.go | 3 +- .../internal/oci/spec_mock.go | 3 +- .../internal/platform-support/tegra/csv.go | 2 +- .../internal/platform-support/tegra/tegra.go | 14 +- .../nvidia-container-toolkit/pkg/nvcdi/api.go | 4 +- .../pkg/nvcdi/common-nvml.go | 4 +- .../pkg/nvcdi/driver-nvml.go | 37 ++--- .../pkg/nvcdi/driver-wsl.go | 9 +- .../pkg/nvcdi/full-gpu-nvml.go | 5 +- .../nvidia-container-toolkit/pkg/nvcdi/gds.go | 12 +- .../pkg/nvcdi/lib-csv.go | 13 +- .../pkg/nvcdi/lib-nvml.go | 135 +++++++++++++++++- .../pkg/nvcdi/lib-wsl.go | 14 +- .../nvidia-container-toolkit/pkg/nvcdi/lib.go | 7 + .../pkg/nvcdi/management.go | 17 ++- .../pkg/nvcdi/mig-device-nvml.go | 15 +- .../pkg/nvcdi/mofed.go | 12 +- .../pkg/nvcdi/namer_nvml_mock.go | 3 +- .../pkg/nvcdi/options.go | 8 ++ .../pkg/nvcdi/spec/builder.go | 3 +- .../pkg/nvcdi/transform/root.go | 114 --------------- vendor/github.com/google/uuid/.travis.yml | 9 -- vendor/github.com/google/uuid/CHANGELOG.md | 21 +++ vendor/github.com/google/uuid/CONTRIBUTING.md | 16 +++ vendor/github.com/google/uuid/README.md | 10 +- vendor/github.com/google/uuid/node_js.go | 2 +- vendor/github.com/google/uuid/uuid.go | 36 +++-- vendor/modules.txt | 7 +- 45 files changed, 671 insertions(+), 350 deletions(-) create mode 100644 vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/identifier.go rename vendor/github.com/NVIDIA/nvidia-container-toolkit/{pkg/nvcdi/transform/no-op.go => internal/discover/gdrcopy.go} (65%) create mode 100644 vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/nvswitch.go create mode 100644 vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/root/root.go delete mode 100644 vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform/root.go delete mode 100644 vendor/github.com/google/uuid/.travis.yml create mode 100644 vendor/github.com/google/uuid/CHANGELOG.md diff --git a/go.mod b/go.mod index 03f0cd1d5..6090c3ab3 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/NVIDIA/k8s-dra-driver go 1.20 require ( - github.com/NVIDIA/go-nvlib v0.0.0-20231116150931-9fd385bace0d + github.com/NVIDIA/go-nvlib v0.0.0-20231212194527-f3264c8a6a7a github.com/NVIDIA/go-nvml v0.12.0-2 - github.com/NVIDIA/nvidia-container-toolkit v1.14.4-0.20231120225202-039d7fd32429 + github.com/NVIDIA/nvidia-container-toolkit v1.15.0-rc.3 github.com/prometheus/client_golang v1.19.0 github.com/sirupsen/logrus v1.9.3 github.com/spf13/pflag v1.0.5 @@ -44,7 +44,7 @@ require ( github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.4.0 // indirect github.com/imdario/mergo v0.3.6 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect diff --git a/go.sum b/go.sum index 80a424a28..d78390186 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,9 @@ -github.com/NVIDIA/go-nvlib v0.0.0-20231116150931-9fd385bace0d h1:XxRHS7eNkZVcPpZZmUcoT4oO8FEcoYKn06sooQh5niU= -github.com/NVIDIA/go-nvlib v0.0.0-20231116150931-9fd385bace0d/go.mod h1:HPFNPAYqQeoos58MKUboWsdZMu71EzSQrbmd+QBRD40= +github.com/NVIDIA/go-nvlib v0.0.0-20231212194527-f3264c8a6a7a h1:aHaNKihxpWzWnV3yoVkit3bhOF7cg2ScCbzW+gepQ/E= +github.com/NVIDIA/go-nvlib v0.0.0-20231212194527-f3264c8a6a7a/go.mod h1:U82N6/xKp6OnoqpALBH0C5SO59Buu4sX1Z3rQtBsBKQ= github.com/NVIDIA/go-nvml v0.12.0-2 h1:Sg239yy7jmopu/cuvYauoMj9fOpcGMngxVxxS1EBXeY= github.com/NVIDIA/go-nvml v0.12.0-2/go.mod h1:7ruy85eOM73muOc/I37euONSwEyFqZsv5ED9AogD4G0= -github.com/NVIDIA/nvidia-container-toolkit v1.14.4-0.20231120225202-039d7fd32429 h1:+iGAHhhsREKFiJb1A+txLMVi3oPAoNC2kH8AtQsbzRc= -github.com/NVIDIA/nvidia-container-toolkit v1.14.4-0.20231120225202-039d7fd32429/go.mod h1:yd+UnaIUSX3vjLVfewaDQ+R7XrgG38+hMZZXrygK3w0= +github.com/NVIDIA/nvidia-container-toolkit v1.15.0-rc.3 h1:885jKnuAY794tMptJBbqxIuM3PzsrD4s91wtpH/pu+g= +github.com/NVIDIA/nvidia-container-toolkit v1.15.0-rc.3/go.mod h1:CPmY/nn1QKXJsh71y8FdQiZW41FH2YLVzgcKD5Vrc+0= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -54,8 +54,9 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= diff --git a/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/identifier.go b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/identifier.go new file mode 100644 index 000000000..689de6d46 --- /dev/null +++ b/vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/identifier.go @@ -0,0 +1,94 @@ +/* + * Copyright (c) NVIDIA CORPORATION. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package device + +import ( + "strconv" + "strings" + + "github.com/google/uuid" +) + +// Identifier can be used to refer to a GPU or MIG device. +// This includes a device index or UUID. +type Identifier string + +// IsGpuIndex checks if an identifier is a full GPU index +func (i Identifier) IsGpuIndex() bool { + if _, err := strconv.ParseUint(string(i), 10, 0); err != nil { + return false + } + return true +} + +// IsMigIndex checks if an identifier is a MIG index +func (i Identifier) IsMigIndex() bool { + split := strings.Split(string(i), ":") + if len(split) != 2 { + return false + } + for _, s := range split { + if !Identifier(s).IsGpuIndex() { + return false + } + } + return true +} + +// IsUUID checks if an identifier is a UUID +func (i Identifier) IsUUID() bool { + return i.IsGpuUUID() || i.IsMigUUID() +} + +// IsGpuUUID checks if an identifier is a GPU UUID +// A GPU UUID must be of the form GPU-b1028956-cfa2-0990-bf4a-5da9abb51763 +func (i Identifier) IsGpuUUID() bool { + if !strings.HasPrefix(string(i), "GPU-") { + return false + } + _, err := uuid.Parse(strings.TrimPrefix(string(i), "GPU-")) + return err == nil +} + +// IsMigUUID checks if an identifier is a MIG UUID +// A MIG UUID can be of one of two forms: +// - MIG-b1028956-cfa2-0990-bf4a-5da9abb51763 +// - MIG-GPU-b1028956-cfa2-0990-bf4a-5da9abb51763/3/0 +func (i Identifier) IsMigUUID() bool { + if !strings.HasPrefix(string(i), "MIG-") { + return false + } + suffix := strings.TrimPrefix(string(i), "MIG-") + _, err := uuid.Parse(suffix) + if err == nil { + return true + } + split := strings.Split(suffix, "/") + if len(split) != 3 { + return false + } + if !Identifier(split[0]).IsGpuUUID() { + return false + } + for _, s := range split[1:] { + _, err := strconv.ParseUint(s, 10, 0) + if err != nil { + return false + } + } + return true +} diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/filter.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/filter.go index 7fd94f096..9de1c3fbf 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/filter.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/filter.go @@ -30,8 +30,8 @@ type filtered struct { filter Filter } -// newFilteredDisoverer creates a discoverer that applies the specified filter to the returned entities of the discoverer -func newFilteredDisoverer(logger logger.Interface, applyTo Discover, filter Filter) Discover { +// newFilteredDiscoverer creates a discoverer that applies the specified filter to the returned entities of the discoverer +func newFilteredDiscoverer(logger logger.Interface, applyTo Discover, filter Filter) Discover { return filtered{ Discover: applyTo, logger: logger, diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform/no-op.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/gdrcopy.go similarity index 65% rename from vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform/no-op.go rename to vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/gdrcopy.go index be2bacf70..e6dcaec27 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform/no-op.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/gdrcopy.go @@ -14,22 +14,14 @@ # limitations under the License. **/ -package transform +package discover -import ( - "tags.cncf.io/container-device-interface/specs-go" -) +import "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" -type noop struct{} - -var _ Transformer = (*noop)(nil) - -// NewNoopTransformer returns a no-op transformer -func NewNoopTransformer() Transformer { - return noop{} -} - -// Transform is a no-op -func (n noop) Transform(spec *specs.Spec) error { - return nil +func NewGDRCopyDiscoverer(logger logger.Interface, devRoot string) (Discover, error) { + return NewCharDeviceDiscoverer( + logger, + devRoot, + []string{"/dev/gdrdrv"}, + ), nil } diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/graphics.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/graphics.go index 73145c89e..0a8ff8d24 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/graphics.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/graphics.go @@ -28,9 +28,10 @@ import ( "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup" "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/cuda" + "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/root" ) -// NewDRMNodesDiscoverer returns a discoverrer for the DRM device nodes associated with the specified visible devices. +// NewDRMNodesDiscoverer returns a discoverer for the DRM device nodes associated with the specified visible devices. // // TODO: The logic for creating DRM devices should be consolidated between this // and the logic for generating CDI specs for a single device. This is only used @@ -48,17 +49,13 @@ func NewDRMNodesDiscoverer(logger logger.Interface, devices image.VisibleDevices } // NewGraphicsMountsDiscoverer creates a discoverer for the mounts required by graphics tools such as vulkan. -func NewGraphicsMountsDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPath string) (Discover, error) { - locator, err := lookup.NewLibraryLocator(logger, driverRoot) - if err != nil { - return nil, fmt.Errorf("failed to construct library locator: %v", err) - } +func NewGraphicsMountsDiscoverer(logger logger.Interface, driver *root.Driver, nvidiaCTKPath string) (Discover, error) { libraries := NewMounts( logger, - locator, - driverRoot, + driver.Libraries(), + driver.Root, []string{ - "libnvidia-egl-gbm.so", + "libnvidia-egl-gbm.so.*", }, ) @@ -66,20 +63,22 @@ func NewGraphicsMountsDiscoverer(logger logger.Interface, driverRoot string, nvi logger, lookup.NewFileLocator( lookup.WithLogger(logger), - lookup.WithRoot(driverRoot), + lookup.WithRoot(driver.Root), lookup.WithSearchPaths("/etc", "/usr/share"), ), - driverRoot, + driver.Root, []string{ "glvnd/egl_vendor.d/10_nvidia.json", "vulkan/icd.d/nvidia_icd.json", + "vulkan/icd.d/nvidia_layers.json", "vulkan/implicit_layer.d/nvidia_layers.json", "egl/egl_external_platform.d/15_nvidia_gbm.json", "egl/egl_external_platform.d/10_nvidia_wayland.json", + "nvidia/nvoptix.bin", }, ) - xorg := optionalXorgDiscoverer(logger, driverRoot, nvidiaCTKPath) + xorg := optionalXorgDiscoverer(logger, driver, nvidiaCTKPath) discover := Merge( libraries, @@ -141,7 +140,7 @@ func (d drmDevicesByPath) Hooks() ([]Hook, error) { return []Hook{hook}, nil } -// getSpecificLinkArgs returns the required specic links that need to be created +// getSpecificLinkArgs returns the required specific links that need to be created func (d drmDevicesByPath) getSpecificLinkArgs(devices []Device) ([]string, error) { selectedDevices := make(map[string]bool) for _, d := range devices { @@ -186,13 +185,13 @@ func newDRMDeviceDiscoverer(logger logger.Interface, devices image.VisibleDevice }, ) - filter, err := newDRMDeviceFilter(logger, devices, devRoot) + filter, err := newDRMDeviceFilter(devices, devRoot) if err != nil { return nil, fmt.Errorf("failed to construct DRM device filter: %v", err) } // We return a discoverer that applies the DRM device filter created above to all discovered DRM device nodes. - d := newFilteredDisoverer( + d := newFilteredDiscoverer( logger, allDevices, filter, @@ -202,7 +201,7 @@ func newDRMDeviceDiscoverer(logger logger.Interface, devices image.VisibleDevice } // newDRMDeviceFilter creates a filter that matches DRM devices nodes for the visible devices. -func newDRMDeviceFilter(logger logger.Interface, devices image.VisibleDevices, devRoot string) (Filter, error) { +func newDRMDeviceFilter(devices image.VisibleDevices, devRoot string) (Filter, error) { gpuInformationPaths, err := proc.GetInformationFilePaths(devRoot) if err != nil { return nil, fmt.Errorf("failed to read GPU information: %v", err) @@ -247,8 +246,8 @@ var _ Discover = (*xorgHooks)(nil) // optionalXorgDiscoverer creates a discoverer for Xorg libraries. // If the creation of the discoverer fails, a None discoverer is returned. -func optionalXorgDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPath string) Discover { - xorg, err := newXorgDiscoverer(logger, driverRoot, nvidiaCTKPath) +func optionalXorgDiscoverer(logger logger.Interface, driver *root.Driver, nvidiaCTKPath string) Discover { + xorg, err := newXorgDiscoverer(logger, driver, nvidiaCTKPath) if err != nil { logger.Warningf("Failed to create Xorg discoverer: %v; skipping xorg libraries", err) return None{} @@ -256,10 +255,9 @@ func optionalXorgDiscoverer(logger logger.Interface, driverRoot string, nvidiaCT return xorg } -func newXorgDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPath string) (Discover, error) { +func newXorgDiscoverer(logger logger.Interface, driver *root.Driver, nvidiaCTKPath string) (Discover, error) { libCudaPaths, err := cuda.New( - cuda.WithLogger(logger), - cuda.WithDriverRoot(driverRoot), + driver.Libraries(), ).Locate(".*.*") if err != nil { return nil, fmt.Errorf("failed to locate libcuda.so: %v", err) @@ -276,11 +274,11 @@ func newXorgDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPath logger, lookup.NewFileLocator( lookup.WithLogger(logger), - lookup.WithRoot(driverRoot), + lookup.WithRoot(driver.Root), lookup.WithSearchPaths(libRoot, "/usr/lib/x86_64-linux-gnu"), lookup.WithCount(1), ), - driverRoot, + driver.Root, []string{ "nvidia/xorg/nvidia_drv.so", fmt.Sprintf("nvidia/xorg/libglxserver_nvidia.so.%s", version), @@ -292,20 +290,20 @@ func newXorgDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPath nvidiaCTKPath: nvidiaCTKPath, } - xorgConfg := NewMounts( + xorgConfig := NewMounts( logger, lookup.NewFileLocator( lookup.WithLogger(logger), - lookup.WithRoot(driverRoot), + lookup.WithRoot(driver.Root), lookup.WithSearchPaths("/usr/share"), ), - driverRoot, + driver.Root, []string{"X11/xorg.conf.d/10-nvidia.conf"}, ) d := Merge( xorgLibs, - xorgConfg, + xorgConfig, xorgHooks, ) diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/ldconfig.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/ldconfig.go index 1a4c59553..a1182ed29 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/ldconfig.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/ldconfig.go @@ -25,10 +25,11 @@ import ( ) // NewLDCacheUpdateHook creates a discoverer that updates the ldcache for the specified mounts. A logger can also be specified -func NewLDCacheUpdateHook(logger logger.Interface, mounts Discover, nvidiaCTKPath string) (Discover, error) { +func NewLDCacheUpdateHook(logger logger.Interface, mounts Discover, nvidiaCTKPath, ldconfigPath string) (Discover, error) { d := ldconfig{ logger: logger, nvidiaCTKPath: nvidiaCTKPath, + ldconfigPath: ldconfigPath, mountsFrom: mounts, } @@ -39,6 +40,7 @@ type ldconfig struct { None logger logger.Interface nvidiaCTKPath string + ldconfigPath string mountsFrom Discover } @@ -50,14 +52,20 @@ func (d ldconfig) Hooks() ([]Hook, error) { } h := CreateLDCacheUpdateHook( d.nvidiaCTKPath, + d.ldconfigPath, getLibraryPaths(mounts), ) return []Hook{h}, nil } // CreateLDCacheUpdateHook locates the NVIDIA Container Toolkit CLI and creates a hook for updating the LD Cache -func CreateLDCacheUpdateHook(executable string, libraries []string) Hook { +func CreateLDCacheUpdateHook(executable string, ldconfig string, libraries []string) Hook { var args []string + + if ldconfig != "" { + args = append(args, "--ldconfig-path", ldconfig) + } + for _, f := range uniqueFolders(libraries) { args = append(args, "--folder", f) } @@ -69,7 +77,6 @@ func CreateLDCacheUpdateHook(executable string, libraries []string) Hook { ) return hook - } // getLibraryPaths extracts the library dirs from the specified mounts @@ -86,7 +93,6 @@ func getLibraryPaths(mounts []Mount) []string { // isLibName checks if the specified filename is a library (i.e. ends in `.so*`) func isLibName(filename string) bool { - base := filepath.Base(filename) isLib, err := filepath.Match("lib?*.so*", base) diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/nvswitch.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/nvswitch.go new file mode 100644 index 000000000..fb956d115 --- /dev/null +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/discover/nvswitch.go @@ -0,0 +1,33 @@ +/** +# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +**/ + +package discover + +import "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" + +// NewNvSwitchDiscoverer creates a discoverer for NVSWITCH devices. +func NewNvSwitchDiscoverer(logger logger.Interface, devRoot string) (Discover, error) { + devices := NewCharDeviceDiscoverer( + logger, + devRoot, + []string{ + "/dev/nvidia-nvswitchctl", + "/dev/nvidia-nvswitch*", + }, + ) + + return devices, nil +} diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/device.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/device.go index 2a5d71c26..d04df1537 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/device.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/device.go @@ -17,9 +17,10 @@ package edits import ( - "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" "tags.cncf.io/container-device-interface/pkg/cdi" "tags.cncf.io/container-device-interface/specs-go" + + "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" ) type device discover.Device diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/edits.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/edits.go index bc86f499d..029e7885b 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/edits.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/edits.go @@ -19,12 +19,13 @@ package edits import ( "fmt" - "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" - "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" - "github.com/NVIDIA/nvidia-container-toolkit/internal/oci" ociSpecs "github.com/opencontainers/runtime-spec/specs-go" "tags.cncf.io/container-device-interface/pkg/cdi" "tags.cncf.io/container-device-interface/specs-go" + + "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" + "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" + "github.com/NVIDIA/nvidia-container-toolkit/internal/oci" ) type edits struct { diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/hook.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/hook.go index ec894f86d..f528fe1db 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/hook.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/hook.go @@ -17,9 +17,10 @@ package edits import ( - "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" "tags.cncf.io/container-device-interface/pkg/cdi" "tags.cncf.io/container-device-interface/specs-go" + + "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" ) type hook discover.Hook diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/mount.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/mount.go index 53b9f45d2..a588ec045 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/mount.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/edits/mount.go @@ -17,9 +17,10 @@ package edits import ( - "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" "tags.cncf.io/container-device-interface/pkg/cdi" "tags.cncf.io/container-device-interface/specs-go" + + "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" ) type mount discover.Mount diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/cuda/cuda.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/cuda/cuda.go index b95e81b4a..68c4db359 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/cuda/cuda.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/cuda/cuda.go @@ -17,55 +17,19 @@ package cuda import ( - "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup" ) type cudaLocator struct { lookup.Locator - logger logger.Interface - driverRoot string -} - -// Options is a function that configures a cudaLocator. -type Options func(*cudaLocator) - -// WithLogger is an option that configures the logger used by the locator. -func WithLogger(logger logger.Interface) Options { - return func(c *cudaLocator) { - c.logger = logger - } -} - -// WithDriverRoot is an option that configures the driver root used by the locator. -func WithDriverRoot(driverRoot string) Options { - return func(c *cudaLocator) { - c.driverRoot = driverRoot - } } // New creates a new CUDA library locator. -func New(opts ...Options) lookup.Locator { - c := &cudaLocator{} - for _, opt := range opts { - opt(c) - } - - if c.logger == nil { - c.logger = logger.New() +func New(libraries lookup.Locator) lookup.Locator { + c := cudaLocator{ + Locator: libraries, } - if c.driverRoot == "" { - c.driverRoot = "/" - } - - // TODO: Do we want to set the Count to 1 here? - l, _ := lookup.NewLibraryLocator( - c.logger, - c.driverRoot, - ) - - c.Locator = l - return c + return &c } // Locate returns the path to the libcuda.so.RMVERSION file. diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/file.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/file.go index 20a1f164e..8f3302731 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/file.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/file.go @@ -17,7 +17,6 @@ package lookup import ( - "errors" "fmt" "os" "path/filepath" @@ -25,55 +24,58 @@ import ( "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" ) -// ErrNotFound indicates that a specified pattern or file could not be found. -var ErrNotFound = errors.New("not found") - // file can be used to locate file (or file-like elements) at a specified set of // prefixes. The validity of a file is determined by a filter function. type file struct { - logger logger.Interface - root string - prefixes []string - filter func(string) error - count int - isOptional bool + builder + prefixes []string +} + +// builder defines the builder for a file locator. +type builder struct { + logger logger.Interface + root string + searchPaths []string + filter func(string) error + count int + isOptional bool } -// Option defines a function for passing options to the NewFileLocator() call -type Option func(*file) +// Option defines a function for passing builder to the NewFileLocator() call +type Option func(*builder) // WithRoot sets the root for the file locator func WithRoot(root string) Option { - return func(f *file) { + return func(f *builder) { f.root = root } } // WithLogger sets the logger for the file locator func WithLogger(logger logger.Interface) Option { - return func(f *file) { + return func(f *builder) { f.logger = logger } } // WithSearchPaths sets the search paths for the file locator. func WithSearchPaths(paths ...string) Option { - return func(f *file) { - f.prefixes = paths + return func(f *builder) { + f.searchPaths = paths } } // WithFilter sets the filter for the file locator // The filter is called for each candidate file and candidates that return nil are considered. func WithFilter(assert func(string) error) Option { - return func(f *file) { + return func(f *builder) { f.filter = assert } } // WithCount sets the maximum number of candidates to discover func WithCount(count int) Option { - return func(f *file) { + return func(f *builder) { f.count = count } } @@ -81,32 +83,42 @@ func WithCount(count int) Option { // WithOptional sets the optional flag for the file locator // If the optional flag is set, the locator will not return an error if the file is not found. func WithOptional(optional bool) Option { - return func(f *file) { + return func(f *builder) { f.isOptional = optional } } -// NewFileLocator creates a Locator that can be used to find files with the specified options. -func NewFileLocator(opts ...Option) Locator { - return newFileLocator(opts...) -} - -func newFileLocator(opts ...Option) *file { - f := &file{} +func newBuilder(opts ...Option) *builder { + o := &builder{} for _, opt := range opts { - opt(f) + opt(o) } - if f.logger == nil { - f.logger = logger.New() + if o.logger == nil { + o.logger = logger.New() } - if f.filter == nil { - f.filter = assertFile + if o.filter == nil { + o.filter = assertFile } - // Since the `Locate` implementations rely on the root already being specified we update - // the prefixes to include the root. - f.prefixes = getSearchPrefixes(f.root, f.prefixes...) + return o +} - return f +func (o builder) build() *file { + f := file{ + builder: o, + // Since the `Locate` implementations rely on the root already being specified we update + // the prefixes to include the root. + prefixes: getSearchPrefixes(o.root, o.searchPaths...), + } + return &f +} + +// NewFileLocator creates a Locator that can be used to find files with the specified builder. +func NewFileLocator(opts ...Option) Locator { + return newFileLocator(opts...) +} + +func newFileLocator(opts ...Option) *file { + return newBuilder(opts...).build() } // getSearchPrefixes generates a list of unique paths to be searched by a file locator. diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/library.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/library.go index 73ad69845..7f5cf7c85 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/library.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/library.go @@ -30,12 +30,20 @@ type ldcacheLocator struct { var _ Locator = (*ldcacheLocator)(nil) -// NewLibraryLocator creates a library locator using the specified logger. -func NewLibraryLocator(logger logger.Interface, root string) (Locator, error) { - // We construct a symlink locator for expected library locations. - symlinkLocator := NewSymlinkLocator( - WithLogger(logger), - WithRoot(root), +// NewLibraryLocator creates a library locator using the specified options. +func NewLibraryLocator(opts ...Option) Locator { + b := newBuilder(opts...) + + // If search paths are already specified, we return a locator for the specified search paths. + if len(b.searchPaths) > 0 { + return NewSymlinkLocator( + WithLogger(b.logger), + WithSearchPaths(b.searchPaths...), + WithRoot("/"), + ) + } + + opts = append(opts, WithSearchPaths([]string{ "/", "/usr/lib64", @@ -50,24 +58,28 @@ func NewLibraryLocator(logger logger.Interface, root string) (Locator, error) { "/lib/aarch64-linux-gnu/nvidia/current", }...), ) + // We construct a symlink locator for expected library locations. + symlinkLocator := NewSymlinkLocator(opts...) l := First( symlinkLocator, - newLdcacheLocator(logger, root), + newLdcacheLocator(opts...), ) - return l, nil + return l } -func newLdcacheLocator(logger logger.Interface, root string) Locator { - cache, err := ldcache.New(logger, root) +func newLdcacheLocator(opts ...Option) Locator { + b := newBuilder(opts...) + + cache, err := ldcache.New(b.logger, b.root) if err != nil { // If we failed to open the LDCache, we default to a symlink locator. - logger.Warningf("Failed to load ldcache: %v", err) + b.logger.Warningf("Failed to load ldcache: %v", err) return nil } return &ldcacheLocator{ - logger: logger, + logger: b.logger, cache: cache, } } @@ -82,7 +94,7 @@ func (l ldcacheLocator) Locate(libname string) ([]string, error) { } if len(paths64) == 0 { - return nil, fmt.Errorf("64-bit library %v: %w", libname, errNotFound) + return nil, fmt.Errorf("64-bit library %v: %w", libname, ErrNotFound) } return paths64, nil diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/locator.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/locator.go index af5633fba..73ade2322 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/locator.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/locator.go @@ -25,4 +25,5 @@ type Locator interface { Locate(string) ([]string, error) } -var errNotFound = errors.New("not found") +// ErrNotFound indicates that a specified pattern or file could not be found. +var ErrNotFound = errors.New("not found") diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/root/root.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/root/root.go new file mode 100644 index 000000000..f96e6b992 --- /dev/null +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/root/root.go @@ -0,0 +1,65 @@ +/** +# Copyright 2023 NVIDIA CORPORATION +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +**/ + +package root + +import ( + "path/filepath" + + "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" + "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup" +) + +// Driver represents a filesystem in which a set of drivers or devices is defined. +type Driver struct { + logger logger.Interface + // Root represents the root from the perspective of the driver libraries and binaries. + Root string + // librarySearchPaths specifies explicit search paths for discovering libraries. + librarySearchPaths []string +} + +// New creates a new Driver root at the specified path. +// TODO: Use functional options here. +func New(logger logger.Interface, path string, librarySearchPaths []string) *Driver { + return &Driver{ + logger: logger, + Root: path, + librarySearchPaths: normalizeSearchPaths(librarySearchPaths...), + } +} + +// Drivers returns a Locator for driver libraries. +func (r *Driver) Libraries() lookup.Locator { + return lookup.NewLibraryLocator( + lookup.WithLogger(r.logger), + lookup.WithRoot(r.Root), + lookup.WithSearchPaths(r.librarySearchPaths...), + ) +} + +// normalizeSearchPaths takes a list of paths and normalized these. +// Each of the elements in the list is expanded if it is a path list and the +// resultant list is returned. +// This allows, for example, for the contents of `PATH` or `LD_LIBRARY_PATH` to +// be passed as a search path directly. +func normalizeSearchPaths(paths ...string) []string { + var normalized []string + for _, path := range paths { + normalized = append(normalized, filepath.SplitList(path)...) + } + return normalized +} diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/oci/spec.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/oci/spec.go index f433e1c48..2daa7503d 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/oci/spec.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/oci/spec.go @@ -19,8 +19,9 @@ package oci import ( "fmt" - "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" "github.com/opencontainers/runtime-spec/specs-go" + + "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" ) // SpecModifier defines an interface for modifying a (raw) OCI spec diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/oci/spec_mock.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/oci/spec_mock.go index ff8ff6476..f004d69c3 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/oci/spec_mock.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/oci/spec_mock.go @@ -4,8 +4,9 @@ package oci import ( - "github.com/opencontainers/runtime-spec/specs-go" "sync" + + "github.com/opencontainers/runtime-spec/specs-go" ) // Ensure, that SpecMock does implement Spec. diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/platform-support/tegra/csv.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/platform-support/tegra/csv.go index 161e6a7a9..e47ae9ded 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/platform-support/tegra/csv.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/platform-support/tegra/csv.go @@ -38,7 +38,7 @@ func (o tegraOptions) newDiscovererFromCSVFiles() (discover.Discover, error) { devices := discover.NewCharDeviceDiscoverer( o.logger, - o.driverRoot, + o.devRoot, targetsByType[csv.MountSpecDev], ) diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/platform-support/tegra/tegra.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/platform-support/tegra/tegra.go index 6fb426744..771b31f29 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/platform-support/tegra/tegra.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/platform-support/tegra/tegra.go @@ -31,6 +31,7 @@ type tegraOptions struct { driverRoot string devRoot string nvidiaCTKPath string + ldconfigPath string librarySearchPaths []string ignorePatterns ignoreMountSpecPatterns @@ -79,7 +80,7 @@ func New(opts ...Option) (discover.Discover, error) { return nil, fmt.Errorf("failed to create CSV discoverer: %v", err) } - ldcacheUpdateHook, err := discover.NewLDCacheUpdateHook(o.logger, csvDiscoverer, o.nvidiaCTKPath) + ldcacheUpdateHook, err := discover.NewLDCacheUpdateHook(o.logger, csvDiscoverer, o.nvidiaCTKPath, o.ldconfigPath) if err != nil { return nil, fmt.Errorf("failed to create ldcach update hook discoverer: %v", err) } @@ -119,9 +120,9 @@ func WithDriverRoot(driverRoot string) Option { // WithDevRoot sets the /dev root. // If this is unset, the driver root is assumed. -func WithDevRoot(driverRoot string) Option { +func WithDevRoot(devRoot string) Option { return func(o *tegraOptions) { - o.driverRoot = driverRoot + o.devRoot = devRoot } } @@ -139,6 +140,13 @@ func WithNVIDIACTKPath(nvidiaCTKPath string) Option { } } +// WithLdconfigPath sets the path to the ldconfig program +func WithLdconfigPath(ldconfigPath string) Option { + return func(o *tegraOptions) { + o.ldconfigPath = ldconfigPath + } +} + // WithLibrarySearchPaths sets the library search paths for the discoverer. func WithLibrarySearchPaths(librarySearchPaths ...string) Option { return func(o *tegraOptions) { diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/api.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/api.go index 9d158d8d2..27c264ded 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/api.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/api.go @@ -18,9 +18,10 @@ package nvcdi import ( "github.com/NVIDIA/go-nvlib/pkg/nvlib/device" - "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec" "tags.cncf.io/container-device-interface/pkg/cdi" "tags.cncf.io/container-device-interface/specs-go" + + "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec" ) const ( @@ -50,4 +51,5 @@ type Interface interface { GetGPUDeviceSpecs(int, device.Device) (*specs.Device, error) GetMIGDeviceEdits(device.Device, device.MigDevice) (*cdi.ContainerEdits, error) GetMIGDeviceSpecs(int, device.Device, int, device.MigDevice) (*specs.Device, error) + GetDeviceSpecsByID(...string) ([]specs.Device, error) } diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/common-nvml.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/common-nvml.go index a33cfc61a..f4bfe30a2 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/common-nvml.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/common-nvml.go @@ -36,12 +36,12 @@ func (l *nvmllib) newCommonNVMLDiscoverer() (discover.Discover, error) { }, ) - graphicsMounts, err := discover.NewGraphicsMountsDiscoverer(l.logger, l.driverRoot, l.nvidiaCTKPath) + graphicsMounts, err := discover.NewGraphicsMountsDiscoverer(l.logger, l.driver, l.nvidiaCTKPath) if err != nil { l.logger.Warningf("failed to create discoverer for graphics mounts: %v", err) } - driverFiles, err := NewDriverDiscoverer(l.logger, l.driverRoot, l.nvidiaCTKPath, l.nvmllib) + driverFiles, err := NewDriverDiscoverer(l.logger, l.driver, l.nvidiaCTKPath, l.ldconfigPath, l.nvmllib) if err != nil { return nil, fmt.Errorf("failed to create discoverer for driver files: %v", err) } diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/driver-nvml.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/driver-nvml.go index cbc892af5..10d154d6c 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/driver-nvml.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/driver-nvml.go @@ -23,16 +23,18 @@ import ( "strings" "github.com/NVIDIA/go-nvlib/pkg/nvml" + "golang.org/x/sys/unix" + "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup" "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/cuda" - "golang.org/x/sys/unix" + "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/root" ) // NewDriverDiscoverer creates a discoverer for the libraries and binaries associated with a driver installation. // The supplied NVML Library is used to query the expected driver version. -func NewDriverDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPath string, nvmllib nvml.Interface) (discover.Discover, error) { +func NewDriverDiscoverer(logger logger.Interface, driver *root.Driver, nvidiaCTKPath string, ldconfigPath string, nvmllib nvml.Interface) (discover.Discover, error) { if r := nvmllib.Init(); r != nvml.SUCCESS { return nil, fmt.Errorf("failed to initialize NVML: %v", r) } @@ -47,26 +49,26 @@ func NewDriverDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPa return nil, fmt.Errorf("failed to determine driver version: %v", r) } - return newDriverVersionDiscoverer(logger, driverRoot, nvidiaCTKPath, version) + return newDriverVersionDiscoverer(logger, driver, nvidiaCTKPath, ldconfigPath, version) } -func newDriverVersionDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPath string, version string) (discover.Discover, error) { - libraries, err := NewDriverLibraryDiscoverer(logger, driverRoot, nvidiaCTKPath, version) +func newDriverVersionDiscoverer(logger logger.Interface, driver *root.Driver, nvidiaCTKPath, ldconfigPath, version string) (discover.Discover, error) { + libraries, err := NewDriverLibraryDiscoverer(logger, driver, nvidiaCTKPath, ldconfigPath, version) if err != nil { return nil, fmt.Errorf("failed to create discoverer for driver libraries: %v", err) } - ipcs, err := discover.NewIPCDiscoverer(logger, driverRoot) + ipcs, err := discover.NewIPCDiscoverer(logger, driver.Root) if err != nil { return nil, fmt.Errorf("failed to create discoverer for IPC sockets: %v", err) } - firmwares, err := NewDriverFirmwareDiscoverer(logger, driverRoot, version) + firmwares, err := NewDriverFirmwareDiscoverer(logger, driver.Root, version) if err != nil { return nil, fmt.Errorf("failed to create discoverer for GSP firmware: %v", err) } - binaries := NewDriverBinariesDiscoverer(logger, driverRoot) + binaries := NewDriverBinariesDiscoverer(logger, driver.Root) d := discover.Merge( libraries, @@ -79,8 +81,8 @@ func newDriverVersionDiscoverer(logger logger.Interface, driverRoot string, nvid } // NewDriverLibraryDiscoverer creates a discoverer for the libraries associated with the specified driver version. -func NewDriverLibraryDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPath string, version string) (discover.Discover, error) { - libraryPaths, err := getVersionLibs(logger, driverRoot, version) +func NewDriverLibraryDiscoverer(logger logger.Interface, driver *root.Driver, nvidiaCTKPath, ldconfigPath, version string) (discover.Discover, error) { + libraryPaths, err := getVersionLibs(logger, driver, version) if err != nil { return nil, fmt.Errorf("failed to get libraries for driver version: %v", err) } @@ -89,13 +91,13 @@ func NewDriverLibraryDiscoverer(logger logger.Interface, driverRoot string, nvid logger, lookup.NewFileLocator( lookup.WithLogger(logger), - lookup.WithRoot(driverRoot), + lookup.WithRoot(driver.Root), ), - driverRoot, + driver.Root, libraryPaths, ) - hooks, _ := discover.NewLDCacheUpdateHook(logger, libraries, nvidiaCTKPath) + hooks, _ := discover.NewLDCacheUpdateHook(logger, libraries, nvidiaCTKPath, ldconfigPath) d := discover.Merge( libraries, @@ -185,12 +187,11 @@ func NewDriverBinariesDiscoverer(logger logger.Interface, driverRoot string) dis // getVersionLibs checks the LDCache for libraries ending in the specified driver version. // Although the ldcache at the specified driverRoot is queried, the paths are returned relative to this driverRoot. // This allows the standard mount location logic to be used for resolving the mounts. -func getVersionLibs(logger logger.Interface, driverRoot string, version string) ([]string, error) { +func getVersionLibs(logger logger.Interface, driver *root.Driver, version string) ([]string, error) { logger.Infof("Using driver version %v", version) libCudaPaths, err := cuda.New( - cuda.WithLogger(logger), - cuda.WithDriverRoot(driverRoot), + driver.Libraries(), ).Locate("." + version) if err != nil { return nil, fmt.Errorf("failed to locate libcuda.so.%v: %v", version, err) @@ -208,13 +209,13 @@ func getVersionLibs(logger logger.Interface, driverRoot string, version string) return nil, fmt.Errorf("failed to locate libraries for driver version %v: %v", version, err) } - if driverRoot == "/" || driverRoot == "" { + if driver.Root == "/" || driver.Root == "" { return libs, nil } var relative []string for _, l := range libs { - relative = append(relative, strings.TrimPrefix(l, driverRoot)) + relative = append(relative, strings.TrimPrefix(l, driver.Root)) } return relative, nil diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/driver-wsl.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/driver-wsl.go index c49ef4ad5..e87bcb036 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/driver-wsl.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/driver-wsl.go @@ -33,12 +33,13 @@ var requiredDriverStoreFiles = []string{ "libnvidia-ml.so.1", /* Core library for nvml */ "libnvidia-ml_loader.so", /* Core library for nvml on WSL */ "libdxcore.so", /* Core library for dxcore support */ + "libnvdxgdmal.so.1", /* dxgdmal library for cuda */ "nvcubins.bin", /* Binary containing GPU code for cuda */ "nvidia-smi", /* nvidia-smi binary*/ } // newWSLDriverDiscoverer returns a Discoverer for WSL2 drivers. -func newWSLDriverDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPath string) (discover.Discover, error) { +func newWSLDriverDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPath, ldconfigPath string) (discover.Discover, error) { err := dxcore.Init() if err != nil { return nil, fmt.Errorf("failed to initialize dxcore: %v", err) @@ -55,11 +56,11 @@ func newWSLDriverDiscoverer(logger logger.Interface, driverRoot string, nvidiaCT } logger.Infof("Using WSL driver store paths: %v", driverStorePaths) - return newWSLDriverStoreDiscoverer(logger, driverRoot, nvidiaCTKPath, driverStorePaths) + return newWSLDriverStoreDiscoverer(logger, driverRoot, nvidiaCTKPath, ldconfigPath, driverStorePaths) } // newWSLDriverStoreDiscoverer returns a Discoverer for WSL2 drivers in the driver store associated with a dxcore adapter. -func newWSLDriverStoreDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPath string, driverStorePaths []string) (discover.Discover, error) { +func newWSLDriverStoreDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPath string, ldconfigPath string, driverStorePaths []string) (discover.Discover, error) { var searchPaths []string seen := make(map[string]bool) for _, path := range driverStorePaths { @@ -92,7 +93,7 @@ func newWSLDriverStoreDiscoverer(logger logger.Interface, driverRoot string, nvi nvidiaCTKPath: nvidiaCTKPath, } - ldcacheHook, _ := discover.NewLDCacheUpdateHook(logger, libraries, nvidiaCTKPath) + ldcacheHook, _ := discover.NewLDCacheUpdateHook(logger, libraries, nvidiaCTKPath, ldconfigPath) d := discover.Merge( libraries, diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/full-gpu-nvml.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/full-gpu-nvml.go index d47c802dd..6793cbbc5 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/full-gpu-nvml.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/full-gpu-nvml.go @@ -24,12 +24,13 @@ import ( "github.com/NVIDIA/go-nvlib/pkg/nvlib/device" "github.com/NVIDIA/go-nvlib/pkg/nvml" + "tags.cncf.io/container-device-interface/pkg/cdi" + "tags.cncf.io/container-device-interface/specs-go" + "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" "github.com/NVIDIA/nvidia-container-toolkit/internal/edits" "github.com/NVIDIA/nvidia-container-toolkit/internal/info/drm" "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" - "tags.cncf.io/container-device-interface/pkg/cdi" - "tags.cncf.io/container-device-interface/specs-go" ) // GetGPUDeviceSpecs returns the CDI device specs for the full GPU represented by 'device'. diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/gds.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/gds.go index c50ab5e5d..74a186c12 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/gds.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/gds.go @@ -20,11 +20,12 @@ import ( "fmt" "github.com/NVIDIA/go-nvlib/pkg/nvlib/device" + "tags.cncf.io/container-device-interface/pkg/cdi" + "tags.cncf.io/container-device-interface/specs-go" + "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" "github.com/NVIDIA/nvidia-container-toolkit/internal/edits" "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec" - "tags.cncf.io/container-device-interface/pkg/cdi" - "tags.cncf.io/container-device-interface/specs-go" ) type gdslib nvcdilib @@ -80,3 +81,10 @@ func (l *gdslib) GetMIGDeviceEdits(device.Device, device.MigDevice) (*cdi.Contai func (l *gdslib) GetMIGDeviceSpecs(int, device.Device, int, device.MigDevice) (*specs.Device, error) { return nil, fmt.Errorf("GetMIGDeviceSpecs is not supported") } + +// GetDeviceSpecsByID returns the CDI device specs for the GPU(s) represented by +// the provided identifiers, where an identifier is an index or UUID of a valid +// GPU device. +func (l *gdslib) GetDeviceSpecsByID(...string) ([]specs.Device, error) { + return nil, fmt.Errorf("GetDeviceSpecsByID is not supported") +} diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib-csv.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib-csv.go index 14b6b5a08..77b5a6d48 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib-csv.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib-csv.go @@ -20,12 +20,13 @@ import ( "fmt" "github.com/NVIDIA/go-nvlib/pkg/nvlib/device" + "tags.cncf.io/container-device-interface/pkg/cdi" + "tags.cncf.io/container-device-interface/specs-go" + "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" "github.com/NVIDIA/nvidia-container-toolkit/internal/edits" "github.com/NVIDIA/nvidia-container-toolkit/internal/platform-support/tegra" "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec" - "tags.cncf.io/container-device-interface/pkg/cdi" - "tags.cncf.io/container-device-interface/specs-go" ) type csvlib nvcdilib @@ -44,6 +45,7 @@ func (l *csvlib) GetAllDeviceSpecs() ([]specs.Device, error) { tegra.WithDriverRoot(l.driverRoot), tegra.WithDevRoot(l.devRoot), tegra.WithNVIDIACTKPath(l.nvidiaCTKPath), + tegra.WithLdconfigPath(l.ldconfigPath), tegra.WithCSVFiles(l.csvFiles), tegra.WithLibrarySearchPaths(l.librarySearchPaths...), tegra.WithIngorePatterns(l.csvIgnorePatterns...), @@ -93,3 +95,10 @@ func (l *csvlib) GetMIGDeviceEdits(device.Device, device.MigDevice) (*cdi.Contai func (l *csvlib) GetMIGDeviceSpecs(int, device.Device, int, device.MigDevice) (*specs.Device, error) { return nil, fmt.Errorf("GetMIGDeviceSpecs is not supported for CSV files") } + +// GetDeviceSpecsByID returns the CDI device specs for the GPU(s) represented by +// the provided identifiers, where an identifier is an index or UUID of a valid +// GPU device. +func (l *csvlib) GetDeviceSpecsByID(...string) ([]specs.Device, error) { + return nil, fmt.Errorf("GetDeviceSpecsByID is not supported for CSV files") +} diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib-nvml.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib-nvml.go index 82cc9b6e8..ae7f31739 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib-nvml.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib-nvml.go @@ -18,13 +18,16 @@ package nvcdi import ( "fmt" + "strconv" + "strings" "github.com/NVIDIA/go-nvlib/pkg/nvlib/device" "github.com/NVIDIA/go-nvlib/pkg/nvml" - "github.com/NVIDIA/nvidia-container-toolkit/internal/edits" - "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec" "tags.cncf.io/container-device-interface/pkg/cdi" "tags.cncf.io/container-device-interface/specs-go" + + "github.com/NVIDIA/nvidia-container-toolkit/internal/edits" + "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec" ) type nvmllib nvcdilib @@ -74,6 +77,134 @@ func (l *nvmllib) GetCommonEdits() (*cdi.ContainerEdits, error) { return edits.FromDiscoverer(common) } +// GetDeviceSpecsByID returns the CDI device specs for the GPU(s) represented by +// the provided identifiers, where an identifier is an index or UUID of a valid +// GPU device. +func (l *nvmllib) GetDeviceSpecsByID(identifiers ...string) ([]specs.Device, error) { + for _, id := range identifiers { + if id == "all" { + return l.GetAllDeviceSpecs() + } + } + + var deviceSpecs []specs.Device + + if r := l.nvmllib.Init(); r != nvml.SUCCESS { + return nil, fmt.Errorf("failed to initialize NVML: %w", r) + } + defer func() { + if r := l.nvmllib.Shutdown(); r != nvml.SUCCESS { + l.logger.Warningf("failed to shutdown NVML: %w", r) + } + }() + + nvmlDevices, err := l.getNVMLDevicesByID(identifiers...) + if err != nil { + return nil, fmt.Errorf("failed to get NVML device handles: %w", err) + } + + for i, nvmlDevice := range nvmlDevices { + deviceEdits, err := l.getEditsForDevice(nvmlDevice) + if err != nil { + return nil, fmt.Errorf("failed to get CDI device edits for identifier %q: %w", identifiers[i], err) + } + deviceSpec := specs.Device{ + Name: identifiers[i], + ContainerEdits: *deviceEdits.ContainerEdits, + } + deviceSpecs = append(deviceSpecs, deviceSpec) + } + + return deviceSpecs, nil +} + +// TODO: move this to go-nvlib? +func (l *nvmllib) getNVMLDevicesByID(identifiers ...string) ([]nvml.Device, error) { + var devices []nvml.Device + for _, id := range identifiers { + dev, err := l.getNVMLDeviceByID(id) + if err != nvml.SUCCESS { + return nil, fmt.Errorf("failed to get NVML device handle for identifier %q: %w", id, err) + } + devices = append(devices, dev) + } + return devices, nil +} + +func (l *nvmllib) getNVMLDeviceByID(id string) (nvml.Device, error) { + var err error + devID := device.Identifier(id) + + if devID.IsUUID() { + return l.nvmllib.DeviceGetHandleByUUID(id) + } + + if devID.IsGpuIndex() { + if idx, err := strconv.Atoi(id); err == nil { + return l.nvmllib.DeviceGetHandleByIndex(idx) + } + return nil, fmt.Errorf("failed to convert device index to an int: %w", err) + } + + if devID.IsMigIndex() { + var gpuIdx, migIdx int + var parent nvml.Device + split := strings.SplitN(id, ":", 2) + if gpuIdx, err = strconv.Atoi(split[0]); err != nil { + return nil, fmt.Errorf("failed to convert device index to an int: %w", err) + } + if migIdx, err = strconv.Atoi(split[1]); err != nil { + return nil, fmt.Errorf("failed to convert device index to an int: %w", err) + } + if parent, err = l.nvmllib.DeviceGetHandleByIndex(gpuIdx); err != nvml.SUCCESS { + return nil, fmt.Errorf("failed to get parent device handle: %w", err) + } + return parent.GetMigDeviceHandleByIndex(migIdx) + } + + return nil, fmt.Errorf("identifier is not a valid UUID or index: %q", id) +} + +func (l *nvmllib) getEditsForDevice(nvmlDevice nvml.Device) (*cdi.ContainerEdits, error) { + mig, err := nvmlDevice.IsMigDeviceHandle() + if err != nvml.SUCCESS { + return nil, fmt.Errorf("failed to determine if device handle is a MIG device: %w", err) + } + if mig { + return l.getEditsForMIGDevice(nvmlDevice) + } + return l.getEditsForGPUDevice(nvmlDevice) +} + +func (l *nvmllib) getEditsForGPUDevice(nvmlDevice nvml.Device) (*cdi.ContainerEdits, error) { + nvlibDevice, err := l.devicelib.NewDevice(nvmlDevice) + if err != nil { + return nil, fmt.Errorf("failed to construct device: %w", err) + } + deviceEdits, err := l.GetGPUDeviceEdits(nvlibDevice) + if err != nil { + return nil, fmt.Errorf("failed to get GPU device edits: %w", err) + } + + return deviceEdits, nil +} + +func (l *nvmllib) getEditsForMIGDevice(nvmlDevice nvml.Device) (*cdi.ContainerEdits, error) { + nvmlParentDevice, ret := nvmlDevice.GetDeviceHandleFromMigDeviceHandle() + if ret != nvml.SUCCESS { + return nil, fmt.Errorf("failed to get parent device handle: %w", ret) + } + nvlibMigDevice, err := l.devicelib.NewMigDevice(nvmlDevice) + if err != nil { + return nil, fmt.Errorf("failed to construct device: %w", err) + } + nvlibParentDevice, err := l.devicelib.NewDevice(nvmlParentDevice) + if err != nil { + return nil, fmt.Errorf("failed to construct parent device: %w", err) + } + return l.GetMIGDeviceEdits(nvlibParentDevice, nvlibMigDevice) +} + func (l *nvmllib) getGPUDeviceSpecs() ([]specs.Device, error) { var deviceSpecs []specs.Device err := l.devicelib.VisitDevices(func(i int, d device.Device) error { diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib-wsl.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib-wsl.go index b2ecf1737..620aa75de 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib-wsl.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib-wsl.go @@ -20,10 +20,11 @@ import ( "fmt" "github.com/NVIDIA/go-nvlib/pkg/nvlib/device" - "github.com/NVIDIA/nvidia-container-toolkit/internal/edits" - "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec" "tags.cncf.io/container-device-interface/pkg/cdi" "tags.cncf.io/container-device-interface/specs-go" + + "github.com/NVIDIA/nvidia-container-toolkit/internal/edits" + "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec" ) type wsllib nvcdilib @@ -53,7 +54,7 @@ func (l *wsllib) GetAllDeviceSpecs() ([]specs.Device, error) { // GetCommonEdits generates a CDI specification that can be used for ANY devices func (l *wsllib) GetCommonEdits() (*cdi.ContainerEdits, error) { - driver, err := newWSLDriverDiscoverer(l.logger, l.driverRoot, l.nvidiaCTKPath) + driver, err := newWSLDriverDiscoverer(l.logger, l.driverRoot, l.nvidiaCTKPath, l.ldconfigPath) if err != nil { return nil, fmt.Errorf("failed to create discoverer for WSL driver: %v", err) } @@ -80,3 +81,10 @@ func (l *wsllib) GetMIGDeviceEdits(device.Device, device.MigDevice) (*cdi.Contai func (l *wsllib) GetMIGDeviceSpecs(int, device.Device, int, device.MigDevice) (*specs.Device, error) { return nil, fmt.Errorf("GetMIGDeviceSpecs is not supported on WSL") } + +// GetDeviceSpecsByID returns the CDI device specs for the GPU(s) represented by +// the provided identifiers, where an identifier is an index or UUID of a valid +// GPU device. +func (l *wsllib) GetDeviceSpecsByID(...string) ([]specs.Device, error) { + return nil, fmt.Errorf("GetDeviceSpecsByID is not supported on WSL") +} diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib.go index 8a60ac6b7..809165406 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/lib.go @@ -22,7 +22,9 @@ import ( "github.com/NVIDIA/go-nvlib/pkg/nvlib/device" "github.com/NVIDIA/go-nvlib/pkg/nvlib/info" "github.com/NVIDIA/go-nvlib/pkg/nvml" + "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" + "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/root" "github.com/NVIDIA/nvidia-container-toolkit/internal/platform-support/tegra/csv" "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec" "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform" @@ -46,6 +48,7 @@ type nvcdilib struct { driverRoot string devRoot string nvidiaCTKPath string + ldconfigPath string librarySearchPaths []string csvFiles []string @@ -54,6 +57,7 @@ type nvcdilib struct { vendor string class string + driver *root.Driver infolib info.Interface mergedDeviceOptions []transform.MergedDeviceOption @@ -87,6 +91,9 @@ func New(opts ...Option) (Interface, error) { l.infolib = info.New() } + // TODO: We need to improve the construction of this driver root. + l.driver = root.New(l.logger, l.driverRoot, l.librarySearchPaths) + var lib Interface switch l.resolveMode() { case ModeCSV: diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/management.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/management.go index 9352e110c..f21ac34bd 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/management.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/management.go @@ -22,12 +22,13 @@ import ( "strings" "github.com/NVIDIA/go-nvlib/pkg/nvlib/device" + "tags.cncf.io/container-device-interface/pkg/cdi" + "tags.cncf.io/container-device-interface/specs-go" + "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" "github.com/NVIDIA/nvidia-container-toolkit/internal/edits" "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/cuda" "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec" - "tags.cncf.io/container-device-interface/pkg/cdi" - "tags.cncf.io/container-device-interface/specs-go" ) type managementlib nvcdilib @@ -65,7 +66,7 @@ func (m *managementlib) GetCommonEdits() (*cdi.ContainerEdits, error) { return nil, fmt.Errorf("failed to get CUDA version: %v", err) } - driver, err := newDriverVersionDiscoverer(m.logger, m.driverRoot, m.nvidiaCTKPath, version) + driver, err := newDriverVersionDiscoverer(m.logger, m.driver, m.nvidiaCTKPath, m.ldconfigPath, version) if err != nil { return nil, fmt.Errorf("failed to create driver library discoverer: %v", err) } @@ -86,8 +87,7 @@ func (m *managementlib) getCudaVersion() (string, error) { } libCudaPaths, err := cuda.New( - cuda.WithLogger(m.logger), - cuda.WithDriverRoot(m.driverRoot), + m.driver.Libraries(), ).Locate(".*.*") if err != nil { return "", fmt.Errorf("failed to locate libcuda.so: %v", err) @@ -188,3 +188,10 @@ func (m *managementlib) GetMIGDeviceEdits(device.Device, device.MigDevice) (*cdi func (m *managementlib) GetMIGDeviceSpecs(int, device.Device, int, device.MigDevice) (*specs.Device, error) { return nil, fmt.Errorf("GetMIGDeviceSpecs is not supported") } + +// GetDeviceSpecsByID returns the CDI device specs for the GPU(s) represented by +// the provided identifiers, where an identifier is an index or UUID of a valid +// GPU device. +func (l *managementlib) GetDeviceSpecsByID(...string) ([]specs.Device, error) { + return nil, fmt.Errorf("GetDeviceSpecsByID is not supported") +} diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/mig-device-nvml.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/mig-device-nvml.go index db8601d9b..a96ad9f7a 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/mig-device-nvml.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/mig-device-nvml.go @@ -21,12 +21,13 @@ import ( "github.com/NVIDIA/go-nvlib/pkg/nvlib/device" "github.com/NVIDIA/go-nvlib/pkg/nvml" + "tags.cncf.io/container-device-interface/pkg/cdi" + "tags.cncf.io/container-device-interface/specs-go" + "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" "github.com/NVIDIA/nvidia-container-toolkit/internal/edits" "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" "github.com/NVIDIA/nvidia-container-toolkit/internal/nvcaps" - "tags.cncf.io/container-device-interface/pkg/cdi" - "tags.cncf.io/container-device-interface/specs-go" ) // GetMIGDeviceSpecs returns the CDI device specs for the full GPU represented by 'device'. @@ -66,7 +67,7 @@ func (l *nvmllib) GetMIGDeviceEdits(parent device.Device, mig device.MigDevice) return nil, fmt.Errorf("error getting Compute Instance ID: %v", ret) } - editsForDevice, err := GetEditsForComputeInstance(l.logger, l.driverRoot, gpu, gi, ci) + editsForDevice, err := l.GetEditsForComputeInstance(gpu, gi, ci) if err != nil { return nil, fmt.Errorf("failed to create container edits for MIG device: %v", err) } @@ -75,8 +76,8 @@ func (l *nvmllib) GetMIGDeviceEdits(parent device.Device, mig device.MigDevice) } // GetEditsForComputeInstance returns the CDI edits for a particular compute instance defined by the (gpu, gi, ci) tuple -func GetEditsForComputeInstance(logger logger.Interface, driverRoot string, gpu int, gi int, ci int) (*cdi.ContainerEdits, error) { - computeInstance, err := newComputeInstanceDiscoverer(logger, driverRoot, gpu, gi, ci) +func (l *nvmllib) GetEditsForComputeInstance(gpu int, gi int, ci int) (*cdi.ContainerEdits, error) { + computeInstance, err := newComputeInstanceDiscoverer(l.logger, l.devRoot, gpu, gi, ci) if err != nil { return nil, fmt.Errorf("failed to create discoverer for Compute Instance: %v", err) } @@ -90,7 +91,7 @@ func GetEditsForComputeInstance(logger logger.Interface, driverRoot string, gpu } // newComputeInstanceDiscoverer returns a discoverer for the specified compute instance -func newComputeInstanceDiscoverer(logger logger.Interface, driverRoot string, gpu int, gi int, ci int) (discover.Discover, error) { +func newComputeInstanceDiscoverer(logger logger.Interface, devRoot string, gpu int, gi int, ci int) (discover.Discover, error) { parentPath := fmt.Sprintf("/dev/nvidia%d", gpu) migCaps, err := nvcaps.NewMigCaps() @@ -112,7 +113,7 @@ func newComputeInstanceDiscoverer(logger logger.Interface, driverRoot string, gp deviceNodes := discover.NewCharDeviceDiscoverer( logger, - driverRoot, + devRoot, []string{ parentPath, giCapDevicePath, diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/mofed.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/mofed.go index 39b0f5379..607b7baf2 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/mofed.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/mofed.go @@ -20,11 +20,12 @@ import ( "fmt" "github.com/NVIDIA/go-nvlib/pkg/nvlib/device" + "tags.cncf.io/container-device-interface/pkg/cdi" + "tags.cncf.io/container-device-interface/specs-go" + "github.com/NVIDIA/nvidia-container-toolkit/internal/discover" "github.com/NVIDIA/nvidia-container-toolkit/internal/edits" "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec" - "tags.cncf.io/container-device-interface/pkg/cdi" - "tags.cncf.io/container-device-interface/specs-go" ) type mofedlib nvcdilib @@ -80,3 +81,10 @@ func (l *mofedlib) GetMIGDeviceEdits(device.Device, device.MigDevice) (*cdi.Cont func (l *mofedlib) GetMIGDeviceSpecs(int, device.Device, int, device.MigDevice) (*specs.Device, error) { return nil, fmt.Errorf("GetMIGDeviceSpecs is not supported") } + +// GetDeviceSpecsByID returns the CDI device specs for the GPU(s) represented by +// the provided identifiers, where an identifier is an index or UUID of a valid +// GPU device. +func (l *mofedlib) GetDeviceSpecsByID(...string) ([]specs.Device, error) { + return nil, fmt.Errorf("GetDeviceSpecsByID is not supported") +} diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/namer_nvml_mock.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/namer_nvml_mock.go index 4cc958f7d..68bc1782c 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/namer_nvml_mock.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/namer_nvml_mock.go @@ -4,8 +4,9 @@ package nvcdi import ( - "github.com/NVIDIA/go-nvlib/pkg/nvml" "sync" + + "github.com/NVIDIA/go-nvlib/pkg/nvml" ) // Ensure, that nvmlUUIDerMock does implement nvmlUUIDer. diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/options.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/options.go index 86bb877de..731e2ee64 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/options.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/options.go @@ -19,6 +19,7 @@ package nvcdi import ( "github.com/NVIDIA/go-nvlib/pkg/nvlib/device" "github.com/NVIDIA/go-nvlib/pkg/nvml" + "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform" ) @@ -68,6 +69,13 @@ func WithNVIDIACTKPath(path string) Option { } } +// WithLdconfigPath sets the path to the ldconfig program +func WithLdconfigPath(path string) Option { + return func(l *nvcdilib) { + l.ldconfigPath = path + } +} + // WithNvmlLib sets the nvml library for the library func WithNvmlLib(nvmllib nvml.Interface) Option { return func(l *nvcdilib) { diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec/builder.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec/builder.go index c69308007..8fb80a68a 100644 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec/builder.go +++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/spec/builder.go @@ -20,10 +20,11 @@ import ( "fmt" "os" - "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform" "tags.cncf.io/container-device-interface/pkg/cdi" "tags.cncf.io/container-device-interface/pkg/parser" "tags.cncf.io/container-device-interface/specs-go" + + "github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform" ) type builder struct { diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform/root.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform/root.go deleted file mode 100644 index 555b9e51a..000000000 --- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform/root.go +++ /dev/null @@ -1,114 +0,0 @@ -/** -# Copyright (c) NVIDIA CORPORATION. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -**/ - -package transform - -import ( - "fmt" - "path/filepath" - "strings" - - "tags.cncf.io/container-device-interface/specs-go" -) - -type rootTransformer struct { - root string - targetRoot string -} - -var _ Transformer = (*rootTransformer)(nil) - -// NewRootTransformer creates a new transformer for modifying -// the root for paths in a CDI spec. If both roots are identical, -// this tranformer is a no-op. -func NewRootTransformer(root string, targetRoot string) Transformer { - if root == targetRoot { - return NewNoopTransformer() - } - - t := rootTransformer{ - root: root, - targetRoot: targetRoot, - } - return t -} - -// Transform replaces the root in a spec with a new root. -// It walks the spec and replaces all host paths that start with root with the target root. -func (t rootTransformer) Transform(spec *specs.Spec) error { - if spec == nil { - return nil - } - - for _, d := range spec.Devices { - d := d - if err := t.applyToEdits(&d.ContainerEdits); err != nil { - return fmt.Errorf("failed to apply root transform to device %s: %w", d.Name, err) - } - } - - if err := t.applyToEdits(&spec.ContainerEdits); err != nil { - return fmt.Errorf("failed to apply root transform to spec: %w", err) - } - return nil -} - -func (t rootTransformer) applyToEdits(edits *specs.ContainerEdits) error { - for i, dn := range edits.DeviceNodes { - dn.HostPath = t.transformPath(dn.HostPath) - edits.DeviceNodes[i] = dn - } - - for i, hook := range edits.Hooks { - hook.Path = t.transformPath(hook.Path) - - var args []string - for _, arg := range hook.Args { - if !strings.Contains(arg, "::") { - args = append(args, t.transformPath(arg)) - continue - } - - // For the 'create-symlinks' hook, special care is taken for the - // '--link' flag argument which takes the form ::. - // Both paths, the target and link paths, are transformed. - split := strings.Split(arg, "::") - if len(split) != 2 { - return fmt.Errorf("unexpected number of '::' separators in hook argument") - } - split[0] = t.transformPath(split[0]) - split[1] = t.transformPath(split[1]) - args = append(args, strings.Join(split, "::")) - } - hook.Args = args - edits.Hooks[i] = hook - } - - for i, mount := range edits.Mounts { - mount.HostPath = t.transformPath(mount.HostPath) - edits.Mounts[i] = mount - } - - return nil -} - -func (t rootTransformer) transformPath(path string) string { - if !strings.HasPrefix(path, t.root) { - return path - } - - return filepath.Join(t.targetRoot, strings.TrimPrefix(path, t.root)) -} diff --git a/vendor/github.com/google/uuid/.travis.yml b/vendor/github.com/google/uuid/.travis.yml deleted file mode 100644 index d8156a60b..000000000 --- a/vendor/github.com/google/uuid/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: go - -go: - - 1.4.3 - - 1.5.3 - - tip - -script: - - go test -v ./... diff --git a/vendor/github.com/google/uuid/CHANGELOG.md b/vendor/github.com/google/uuid/CHANGELOG.md new file mode 100644 index 000000000..7ed347d3a --- /dev/null +++ b/vendor/github.com/google/uuid/CHANGELOG.md @@ -0,0 +1,21 @@ +# Changelog + +## [1.4.0](https://github.com/google/uuid/compare/v1.3.1...v1.4.0) (2023-10-26) + + +### Features + +* UUIDs slice type with Strings() convenience method ([#133](https://github.com/google/uuid/issues/133)) ([cd5fbbd](https://github.com/google/uuid/commit/cd5fbbdd02f3e3467ac18940e07e062be1f864b4)) + +### Fixes + +* Clarify that Parse's job is to parse but not necessarily validate strings. (Documents current behavior) + +## [1.3.1](https://github.com/google/uuid/compare/v1.3.0...v1.3.1) (2023-08-18) + + +### Bug Fixes + +* Use .EqualFold() to parse urn prefixed UUIDs ([#118](https://github.com/google/uuid/issues/118)) ([574e687](https://github.com/google/uuid/commit/574e6874943741fb99d41764c705173ada5293f0)) + +## Changelog diff --git a/vendor/github.com/google/uuid/CONTRIBUTING.md b/vendor/github.com/google/uuid/CONTRIBUTING.md index 04fdf09f1..a502fdc51 100644 --- a/vendor/github.com/google/uuid/CONTRIBUTING.md +++ b/vendor/github.com/google/uuid/CONTRIBUTING.md @@ -2,6 +2,22 @@ We definitely welcome patches and contribution to this project! +### Tips + +Commits must be formatted according to the [Conventional Commits Specification](https://www.conventionalcommits.org). + +Always try to include a test case! If it is not possible or not necessary, +please explain why in the pull request description. + +### Releasing + +Commits that would precipitate a SemVer change, as described in the Conventional +Commits Specification, will trigger [`release-please`](https://github.com/google-github-actions/release-please-action) +to create a release candidate pull request. Once submitted, `release-please` +will create a release. + +For tips on how to work with `release-please`, see its documentation. + ### Legal requirements In order to protect both you and ourselves, you will need to sign the diff --git a/vendor/github.com/google/uuid/README.md b/vendor/github.com/google/uuid/README.md index f765a46f9..3e9a61889 100644 --- a/vendor/github.com/google/uuid/README.md +++ b/vendor/github.com/google/uuid/README.md @@ -1,6 +1,6 @@ -# uuid ![build status](https://travis-ci.org/google/uuid.svg?branch=master) +# uuid The uuid package generates and inspects UUIDs based on -[RFC 4122](http://tools.ietf.org/html/rfc4122) +[RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122) and DCE 1.1: Authentication and Security Services. This package is based on the github.com/pborman/uuid package (previously named @@ -9,10 +9,12 @@ a UUID is a 16 byte array rather than a byte slice. One loss due to this change is the ability to represent an invalid UUID (vs a NIL UUID). ###### Install -`go get github.com/google/uuid` +```sh +go get github.com/google/uuid +``` ###### Documentation -[![GoDoc](https://godoc.org/github.com/google/uuid?status.svg)](http://godoc.org/github.com/google/uuid) +[![Go Reference](https://pkg.go.dev/badge/github.com/google/uuid.svg)](https://pkg.go.dev/github.com/google/uuid) Full `go doc` style documentation for the package can be viewed online without installing this package by using the GoDoc site here: diff --git a/vendor/github.com/google/uuid/node_js.go b/vendor/github.com/google/uuid/node_js.go index 24b78edc9..b2a0bc871 100644 --- a/vendor/github.com/google/uuid/node_js.go +++ b/vendor/github.com/google/uuid/node_js.go @@ -7,6 +7,6 @@ package uuid // getHardwareInterface returns nil values for the JS version of the code. -// This remvoves the "net" dependency, because it is not used in the browser. +// This removes the "net" dependency, because it is not used in the browser. // Using the "net" library inflates the size of the transpiled JS code by 673k bytes. func getHardwareInterface(name string) (string, []byte) { return "", nil } diff --git a/vendor/github.com/google/uuid/uuid.go b/vendor/github.com/google/uuid/uuid.go index a57207aeb..dc75f7d99 100644 --- a/vendor/github.com/google/uuid/uuid.go +++ b/vendor/github.com/google/uuid/uuid.go @@ -56,11 +56,15 @@ func IsInvalidLengthError(err error) bool { return ok } -// Parse decodes s into a UUID or returns an error. Both the standard UUID -// forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and -// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the -// Microsoft encoding {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} and the raw hex -// encoding: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. +// Parse decodes s into a UUID or returns an error if it cannot be parsed. Both +// the standard UUID forms defined in RFC 4122 +// (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and +// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) are decoded. In addition, +// Parse accepts non-standard strings such as the raw hex encoding +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx and 38 byte "Microsoft style" encodings, +// e.g. {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. Only the middle 36 bytes are +// examined in the latter case. Parse should not be used to validate strings as +// it parses non-standard encodings as indicated above. func Parse(s string) (UUID, error) { var uuid UUID switch len(s) { @@ -69,7 +73,7 @@ func Parse(s string) (UUID, error) { // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx case 36 + 9: - if strings.ToLower(s[:9]) != "urn:uuid:" { + if !strings.EqualFold(s[:9], "urn:uuid:") { return uuid, fmt.Errorf("invalid urn prefix: %q", s[:9]) } s = s[9:] @@ -101,7 +105,8 @@ func Parse(s string) (UUID, error) { 9, 11, 14, 16, 19, 21, - 24, 26, 28, 30, 32, 34} { + 24, 26, 28, 30, 32, 34, + } { v, ok := xtob(s[x], s[x+1]) if !ok { return uuid, errors.New("invalid UUID format") @@ -117,7 +122,7 @@ func ParseBytes(b []byte) (UUID, error) { switch len(b) { case 36: // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx case 36 + 9: // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - if !bytes.Equal(bytes.ToLower(b[:9]), []byte("urn:uuid:")) { + if !bytes.EqualFold(b[:9], []byte("urn:uuid:")) { return uuid, fmt.Errorf("invalid urn prefix: %q", b[:9]) } b = b[9:] @@ -145,7 +150,8 @@ func ParseBytes(b []byte) (UUID, error) { 9, 11, 14, 16, 19, 21, - 24, 26, 28, 30, 32, 34} { + 24, 26, 28, 30, 32, 34, + } { v, ok := xtob(b[x], b[x+1]) if !ok { return uuid, errors.New("invalid UUID format") @@ -292,3 +298,15 @@ func DisableRandPool() { poolMu.Lock() poolPos = randPoolSize } + +// UUIDs is a slice of UUID types. +type UUIDs []UUID + +// Strings returns a string slice containing the string form of each UUID in uuids. +func (uuids UUIDs) Strings() []string { + var uuidStrs = make([]string, len(uuids)) + for i, uuid := range uuids { + uuidStrs[i] = uuid.String() + } + return uuidStrs +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 253ec56b1..ce6ed9d1d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/NVIDIA/go-nvlib v0.0.0-20231116150931-9fd385bace0d +# github.com/NVIDIA/go-nvlib v0.0.0-20231212194527-f3264c8a6a7a ## explicit; go 1.20 github.com/NVIDIA/go-nvlib/pkg/nvlib/device github.com/NVIDIA/go-nvlib/pkg/nvlib/info @@ -7,7 +7,7 @@ github.com/NVIDIA/go-nvlib/pkg/nvml ## explicit; go 1.15 github.com/NVIDIA/go-nvml/pkg/dl github.com/NVIDIA/go-nvml/pkg/nvml -# github.com/NVIDIA/nvidia-container-toolkit v1.14.4-0.20231120225202-039d7fd32429 +# github.com/NVIDIA/nvidia-container-toolkit v1.15.0-rc.3 ## explicit; go 1.20 github.com/NVIDIA/nvidia-container-toolkit/internal/config/image github.com/NVIDIA/nvidia-container-toolkit/internal/discover @@ -19,6 +19,7 @@ github.com/NVIDIA/nvidia-container-toolkit/internal/ldcache github.com/NVIDIA/nvidia-container-toolkit/internal/logger github.com/NVIDIA/nvidia-container-toolkit/internal/lookup github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/cuda +github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/root github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/symlinks github.com/NVIDIA/nvidia-container-toolkit/internal/nvcaps github.com/NVIDIA/nvidia-container-toolkit/internal/oci @@ -104,7 +105,7 @@ github.com/google/go-cmp/cmp/internal/value ## explicit; go 1.12 github.com/google/gofuzz github.com/google/gofuzz/bytesource -# github.com/google/uuid v1.3.0 +# github.com/google/uuid v1.4.0 ## explicit github.com/google/uuid # github.com/imdario/mergo v0.3.6