Skip to content

Commit adaabca

Browse files
committed
fix: Ensure that CUDA Compat Container path is set by default
This change ensures that the CompatContainerRoot cannot be set to the empty string. This ensures that the default defined in the nvcdi package is used in this case whithout requiring that the caller (the nvidia-runtime in CDI mode or the nvidia-cdi cdi generate command). Failing to do this, means that the CUDA compat libraries in SBSA containers are used on Orin-based systems. Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 323529b commit adaabca

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

pkg/nvcdi/options.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ func populateOptions(opts ...Option) *options {
6969
mode: ModeAuto,
7070
driverRoot: "/",
7171
nvidiaCDIHookPath: "/usr/bin/nvidia-cdi-hook",
72-
csv: csvOptions{
73-
CompatContainerRoot: defaultOrinCompatContainerRoot,
74-
},
7572
}
7673
for _, opt := range opts {
7774
opt(o)
@@ -109,6 +106,10 @@ func populateOptions(opts ...Option) *options {
109106
o.csv.Files = csv.DefaultFileList()
110107
}
111108

109+
if o.mode == ModeCSV && o.csv.CompatContainerRoot == "" {
110+
o.csv.CompatContainerRoot = defaultOrinCompatContainerRoot
111+
}
112+
112113
if o.mode == ModeManagement {
113114
// For management mode we explicitly disable the hooks that enable CUDA
114115
// compatibility and disable device node modifications.

0 commit comments

Comments
 (0)