[release-0.19] Fix CDI spec generation to respect driver root for Tegra CSV files#1701
Merged
cdesiniotis merged 4 commits intorelease-0.19from Apr 17, 2026
Merged
Conversation
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]> (cherry picked from commit f27fd14)
…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]>
(cherry picked from commit 22499fe)
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]> (cherry picked from commit 6ca73d9)
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]> (cherry picked from commit fe18b02)
Contributor
|
/ok to test 634fa9a |
cdesiniotis
approved these changes
Apr 17, 2026
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.
🤖 Automated backport of #1675 to
release-0.19✅ Cherry-pick completed successfully with no conflicts.
Original PR: #1675
Original Author: @elezar
Cherry-picked commits (4):
f27fd14Fix CDI spec generation to respect driver root for Tegra CSV files22499feFactor device discovery strategy resolution out of plugin and cdi packages6ca73d9Default to nvml strategy when platform cannot be detectedfe18b02Update nvcdi API to 2c0c91d0ebaa45873d997b42beffad3706e8d734This backport was automatically created by the backport bot.