Skip to content

fix: Ensure that CUDA Compat Container path is set by default#1690

Merged
elezar merged 1 commit intoNVIDIA:mainfrom
elezar:fix-contianer-compat-root
Mar 3, 2026
Merged

fix: Ensure that CUDA Compat Container path is set by default#1690
elezar merged 1 commit intoNVIDIA:mainfrom
elezar:fix-contianer-compat-root

Conversation

@elezar
Copy link
Member

@elezar elezar commented Mar 3, 2026

This change ensures that the CUDA Compat Container path is set on orin-based systems. Without this, the CUDA Compat libraries for SBSA are (incorrectly) used in a container.

@elezar elezar added this to the v1.19.0 milestone Mar 3, 2026
@elezar elezar requested review from jgehrcke and klueska March 3, 2026 13:00
@elezar elezar added the bug Issue/PR to expose/discuss/fix a bug label Mar 3, 2026
@elezar elezar force-pushed the fix-contianer-compat-root branch from b5fb49f to b89047a Compare March 3, 2026 13:05
@elezar elezar requested a review from cdesiniotis March 3, 2026 13:07
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>
@elezar elezar force-pushed the fix-contianer-compat-root branch from b89047a to adaabca Compare March 3, 2026 14:32
@coveralls
Copy link

Pull Request Test Coverage Report for Build 22627696116

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 42.797%

Totals Coverage Status
Change from base Build 22589959798: 0.0%
Covered Lines: 6343
Relevant Lines: 14821

💛 - Coveralls

nvidiaCDIHookPath: "/usr/bin/nvidia-cdi-hook",
csv: csvOptions{
CompatContainerRoot: defaultOrinCompatContainerRoot,
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by removing this, o.csv is now initialized as nil, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe not because of this type definition (not a pointer):

csv csvOptions

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's just an embeded struct, it is not a pointer. This means that the default value for the o.csv.CompatContainerRoot field is now "".

}

if o.mode == ModeCSV && o.csv.CompatContainerRoot == "" {
o.csv.CompatContainerRoot = defaultOrinCompatContainerRoot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so o.csv is never a nil pointer dereference, yes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. The csv member is NOT a pointer type. It is an embeded struct.

@elezar elezar merged commit 85a0127 into NVIDIA:main Mar 3, 2026
16 checks passed
@elezar elezar deleted the fix-contianer-compat-root branch March 3, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue/PR to expose/discuss/fix a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants