mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 08:18:32 +00:00
Generate device nodes when creating management spec
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
e774c51c97
commit
cdaaf5e46f
@ -23,6 +23,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/NVIDIA/nvidia-container-toolkit/internal/system"
|
||||||
"github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi"
|
"github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi"
|
||||||
"github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform"
|
"github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi/transform"
|
||||||
"github.com/container-orchestrated-devices/container-device-interface/pkg/cdi"
|
"github.com/container-orchestrated-devices/container-device-interface/pkg/cdi"
|
||||||
@ -608,6 +609,16 @@ func generateCDISpec(opts *options, nvidiaCTKPath string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Infof("Creating control device nodes at %v", opts.DriverRootCtrPath)
|
||||||
|
s, err := system.New()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to create library: %v", err)
|
||||||
|
}
|
||||||
|
if err := s.CreateNVIDIAControlDeviceNodesAt(opts.DriverRootCtrPath); err != nil {
|
||||||
|
return fmt.Errorf("failed to create control device nodes: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Info("Generating CDI spec for management containers")
|
||||||
cdilib, err := nvcdi.New(
|
cdilib, err := nvcdi.New(
|
||||||
nvcdi.WithMode(nvcdi.ModeManagement),
|
nvcdi.WithMode(nvcdi.ModeManagement),
|
||||||
nvcdi.WithDriverRoot(opts.DriverRootCtrPath),
|
nvcdi.WithDriverRoot(opts.DriverRootCtrPath),
|
||||||
|
Loading…
Reference in New Issue
Block a user