Fix CDI spec generation to respect driver root for Tegra CSV files#1675
Merged
elezar merged 4 commits intoNVIDIA:mainfrom Apr 17, 2026
Merged
Fix CDI spec generation to respect driver root for Tegra CSV files#1675elezar merged 4 commits intoNVIDIA:mainfrom
elezar merged 4 commits intoNVIDIA:mainfrom
Conversation
12ccba2 to
2ab68c1
Compare
6 tasks
2ab68c1 to
2a9c65b
Compare
On Tegra-based systems the nvcdi library resolves CSV mount specs from /etc/nvidia-container-runtime/host-files-for-container.d using hardcoded absolute paths, ignoring the configured driver root. When the device plugin runs in a container with the host filesystem mounted at a non-default driver root the CSV files are unreachable at their absolute paths, causing CDI spec generation to fail. Inject driver-root-aware CSV file paths via nvcdi.WithCSVFiles() when the platform is detected as Tegra. The helper csvFilesForRoot() checks for the CSV directory under the driver root first, falling back to the absolute path, and returns nil (letting nvcdi use its own defaults) if neither location exists. Also extend the NVML guard so that pure iGPU Tegra systems without NVML are not incorrectly reduced to a null CDI handler. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Evan Lezar <[email protected]>
…kages
Resolve the device discovery strategy once in GetPlugins() using a local
resolveStrategy() helper and pass the concrete value ("nvml", "tegra",
etc.) to both cdi.New() and plugin.New() via new WithDeviceDiscoveryStrategy
options. This eliminates duplicate infolib.ResolvePlatform() calls and
makes the dependency on platform detection explicit at the call site.
Both constructors now return an error when the strategy is not set rather
than falling back to their own resolution logic. The CDI handler uses the
strategy directly to gate CSV-mode behaviour instead of re-checking the
platform independently.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Evan Lezar <[email protected]>
When the device discovery strategy is "auto" but no supported platform is detected, default to "nvml" instead of returning the unresolved "auto" value. Log a warning so that the fallback is visible in the device plugin output. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Evan Lezar <[email protected]>
This change updates the nvcdi API to 2c0c91d0ebaa45873d997b42beffad3706e8d734 to include the changes for NVIDIA/nvidia-container-toolkit#1745. Signed-off-by: Evan Lezar <[email protected]>
2a9c65b to
fe18b02
Compare
cdesiniotis
reviewed
Apr 15, 2026
Contributor
cdesiniotis
left a comment
There was a problem hiding this comment.
LGTM, just one question.
cdesiniotis
approved these changes
Apr 16, 2026
Member
Author
|
/cherry-pick release-0.19 |
|
🤖 Backport PR created for |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Tegra-based systems the nvcdi library resolves CSV mount specs from /etc/nvidia-container-runtime/host-files-for-container.d using hardcoded absolute paths, ignoring the configured driver root. When the device plugin runs in a container with the host filesystem mounted at a non-default driver root the CSV files are unreachable at their absolute paths, causing CDI spec generation to fail.
Inject driver-root-aware CSV file paths via nvcdi.WithCSVFiles() when the platform is detected as Tegra. The helper csvFilesForRoot() checks for the CSV directory under the driver root first, falling back to the absolute path, and returns nil (letting nvcdi use its own defaults) if neither location exists.
Also extend the NVML guard so that pure iGPU Tegra systems without NVML are not incorrectly reduced to a null CDI handler.