Merge branch 'bugfix-nvidia-ctk' into 'main'

Fix nvidia-ctk path in spec generation

See merge request nvidia/container-toolkit/container-toolkit!264
This commit is contained in:
Evan Lezar 2023-01-19 11:10:38 +00:00
commit 94b7add334

View File

@ -114,7 +114,10 @@ func (m command) validateFlags(r *cli.Context, cfg *config) error {
} }
func (m command) run(c *cli.Context, cfg *config) error { func (m command) run(c *cli.Context, cfg *config) error {
spec, err := m.generateSpec(cfg.root, cfg.nvidiaCTKPath) spec, err := m.generateSpec(
cfg.root,
discover.FindNvidiaCTK(m.logger, cfg.nvidiaCTKPath),
)
if err != nil { if err != nil {
return fmt.Errorf("failed to generate CDI spec: %v", err) return fmt.Errorf("failed to generate CDI spec: %v", err)
} }
@ -202,9 +205,7 @@ func (m command) generateSpec(root string, nvidiaCTKPath string) (*specs.Spec, e
devicelib := device.New(device.WithNvml(nvmllib)) devicelib := device.New(device.WithNvml(nvmllib))
useNvidiaCTKPath := discover.FindNvidiaCTK(m.logger, nvidiaCTKPath) deviceSpecs, err := m.generateDeviceSpecs(devicelib, root, nvidiaCTKPath)
deviceSpecs, err := m.generateDeviceSpecs(devicelib, root, useNvidiaCTKPath)
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to create device CDI specs: %v", err) return nil, fmt.Errorf("failed to create device CDI specs: %v", err)
} }