mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Update to go-nvlib v0.3.0 and go-nvml v0.12.0-4
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
8
vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/info/info.go
generated
vendored
8
vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/info/info.go
generated
vendored
@@ -25,7 +25,7 @@ import (
|
||||
"github.com/NVIDIA/go-nvml/pkg/dl"
|
||||
)
|
||||
|
||||
// Interface provides the API to the info package
|
||||
// Interface provides the API to the info package.
|
||||
type Interface interface {
|
||||
HasDXCore() (bool, string)
|
||||
HasNvml() (bool, string)
|
||||
@@ -50,7 +50,7 @@ func (i *infolib) HasDXCore() (bool, string) {
|
||||
return true, "found DXCore library"
|
||||
}
|
||||
|
||||
// HasNvml returns true if NVML is detected on the system
|
||||
// HasNvml returns true if NVML is detected on the system.
|
||||
func (i *infolib) HasNvml() (bool, string) {
|
||||
const (
|
||||
libraryName = "libnvidia-ml.so.1"
|
||||
@@ -62,7 +62,7 @@ func (i *infolib) HasNvml() (bool, string) {
|
||||
return true, "found NVML library"
|
||||
}
|
||||
|
||||
// IsTegraSystem returns true if the system is detected as a Tegra-based system
|
||||
// IsTegraSystem returns true if the system is detected as a Tegra-based system.
|
||||
func (i *infolib) IsTegraSystem() (bool, string) {
|
||||
tegraReleaseFile := filepath.Join(i.root, "/etc/nv_tegra_release")
|
||||
tegraFamilyFile := filepath.Join(i.root, "/sys/devices/soc0/family")
|
||||
@@ -87,7 +87,7 @@ func (i *infolib) IsTegraSystem() (bool, string) {
|
||||
return false, fmt.Sprintf("%v has no 'tegra' prefix", tegraFamilyFile)
|
||||
}
|
||||
|
||||
// assertHasLibrary returns an error if the specified library cannot be loaded
|
||||
// assertHasLibrary returns an error if the specified library cannot be loaded.
|
||||
func assertHasLibrary(libraryName string) error {
|
||||
const (
|
||||
libraryLoadFlags = dl.RTLD_LAZY
|
||||
|
||||
6
vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/info/options.go
generated
vendored
6
vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/info/options.go
generated
vendored
@@ -16,10 +16,10 @@
|
||||
|
||||
package info
|
||||
|
||||
// Option defines a function for passing options to the New() call
|
||||
// Option defines a function for passing options to the New() call.
|
||||
type Option func(*infolib)
|
||||
|
||||
// New creates a new instance of the 'info' interface
|
||||
// New creates a new instance of the 'info' interface.
|
||||
func New(opts ...Option) Interface {
|
||||
i := &infolib{}
|
||||
for _, opt := range opts {
|
||||
@@ -31,7 +31,7 @@ func New(opts ...Option) Interface {
|
||||
return i
|
||||
}
|
||||
|
||||
// WithRoot provides a Option to set the root of the 'info' interface
|
||||
// WithRoot provides a Option to set the root of the 'info' interface.
|
||||
func WithRoot(root string) Option {
|
||||
return func(i *infolib) {
|
||||
i.root = root
|
||||
|
||||
Reference in New Issue
Block a user