mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 16:29:18 +00:00
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:
commit
94b7add334
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user