mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 08:18:32 +00:00
Merge branch 'disc-typos' into 'main'
fix minor typos and rm unused logger param See merge request nvidia/container-toolkit/container-toolkit!540
This commit is contained in:
commit
9c6dd94ac8
@ -30,8 +30,8 @@ type filtered struct {
|
|||||||
filter Filter
|
filter Filter
|
||||||
}
|
}
|
||||||
|
|
||||||
// newFilteredDisoverer creates a discoverer that applies the specified filter to the returned entities of the discoverer
|
// newFilteredDiscoverer 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 {
|
func newFilteredDiscoverer(logger logger.Interface, applyTo Discover, filter Filter) Discover {
|
||||||
return filtered{
|
return filtered{
|
||||||
Discover: applyTo,
|
Discover: applyTo,
|
||||||
logger: logger,
|
logger: logger,
|
||||||
|
@ -31,7 +31,7 @@ import (
|
|||||||
"github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/root"
|
"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
|
// 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
|
// and the logic for generating CDI specs for a single device. This is only used
|
||||||
@ -140,7 +140,7 @@ func (d drmDevicesByPath) Hooks() ([]Hook, error) {
|
|||||||
return []Hook{hook}, nil
|
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) {
|
func (d drmDevicesByPath) getSpecificLinkArgs(devices []Device) ([]string, error) {
|
||||||
selectedDevices := make(map[string]bool)
|
selectedDevices := make(map[string]bool)
|
||||||
for _, d := range devices {
|
for _, d := range devices {
|
||||||
@ -185,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 {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to construct DRM device filter: %v", err)
|
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.
|
// We return a discoverer that applies the DRM device filter created above to all discovered DRM device nodes.
|
||||||
d := newFilteredDisoverer(
|
d := newFilteredDiscoverer(
|
||||||
logger,
|
logger,
|
||||||
allDevices,
|
allDevices,
|
||||||
filter,
|
filter,
|
||||||
@ -201,7 +201,7 @@ func newDRMDeviceDiscoverer(logger logger.Interface, devices image.VisibleDevice
|
|||||||
}
|
}
|
||||||
|
|
||||||
// newDRMDeviceFilter creates a filter that matches DRM devices nodes for the visible devices.
|
// 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)
|
gpuInformationPaths, err := proc.GetInformationFilePaths(devRoot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to read GPU information: %v", err)
|
return nil, fmt.Errorf("failed to read GPU information: %v", err)
|
||||||
@ -290,7 +290,7 @@ func newXorgDiscoverer(logger logger.Interface, driver *root.Driver, nvidiaCTKPa
|
|||||||
nvidiaCTKPath: nvidiaCTKPath,
|
nvidiaCTKPath: nvidiaCTKPath,
|
||||||
}
|
}
|
||||||
|
|
||||||
xorgConfg := NewMounts(
|
xorgConfig := NewMounts(
|
||||||
logger,
|
logger,
|
||||||
lookup.NewFileLocator(
|
lookup.NewFileLocator(
|
||||||
lookup.WithLogger(logger),
|
lookup.WithLogger(logger),
|
||||||
@ -303,7 +303,7 @@ func newXorgDiscoverer(logger logger.Interface, driver *root.Driver, nvidiaCTKPa
|
|||||||
|
|
||||||
d := Merge(
|
d := Merge(
|
||||||
xorgLibs,
|
xorgLibs,
|
||||||
xorgConfg,
|
xorgConfig,
|
||||||
xorgHooks,
|
xorgHooks,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user