diff --git a/cmd/nvidia-ctk/cdi/generate/generate.go b/cmd/nvidia-ctk/cdi/generate/generate.go index 63828336..124fbc0f 100644 --- a/cmd/nvidia-ctk/cdi/generate/generate.go +++ b/cmd/nvidia-ctk/cdi/generate/generate.go @@ -45,6 +45,7 @@ type options struct { format string deviceNameStrategy string driverRoot string + devRoot string nvidiaCTKPath string mode string vendor string @@ -101,6 +102,11 @@ func (m command) build() *cli.Command { Value: nvcdi.ModeAuto, Destination: &opts.mode, }, + &cli.StringFlag{ + Name: "dev-root", + Usage: "Specify the root where `/dev` is located. If this is not specified, the driver-root is assumed.", + Destination: &opts.devRoot, + }, &cli.StringFlag{ Name: "device-name-strategy", Usage: "Specify the strategy for generating device names. One of [index | uuid | type-index]", @@ -236,6 +242,7 @@ func (m command) generateSpec(opts *options) (spec.Interface, error) { cdilib, err := nvcdi.New( nvcdi.WithLogger(m.logger), nvcdi.WithDriverRoot(opts.driverRoot), + nvcdi.WithDevRoot(opts.devRoot), nvcdi.WithNVIDIACTKPath(opts.nvidiaCTKPath), nvcdi.WithDeviceNamer(deviceNamer), nvcdi.WithMode(opts.mode),