Update systemd unit conditions to execute nvidia-smi and re-add restart logic#1825
Merged
cdesiniotis merged 2 commits intoMay 14, 2026
Merged
Conversation
This ensures that the nvidia-cdi-refresh.service does not start until after the driver is loaded and available. The added benefit of running nvidia-smi is that it will load the module (if not already loaded) and create the device nodes (if not already created). Signed-off-by: Christopher Desiniotis <cdesiniotis@nvidia.com>
tariq1890
reviewed
May 14, 2026
tariq1890
approved these changes
May 14, 2026
The restart logic was removed when a dependency on the multi-user-target was added in NVIDIA@5fe6b42. However, this change had unforeseen consequences and was later reverted in NVIDIA@5eee5ce. When reverting this change, the restart logic was not re-added to the service. Signed-off-by: Christopher Desiniotis <cdesiniotis@nvidia.com>
Coverage Report for CI Build 25883283353Coverage remained the same at 43.342%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
tariq1890
approved these changes
May 14, 2026
tariq1890
approved these changes
May 14, 2026
Contributor
Author
|
/cherry-pick release-1.19 |
|
🤖 Backport PR created for |
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.
This ensures that the nvidia-cdi-refresh.service does not start until after the driver is loaded and available. The added benefit of running nvidia-smi is that it will load the module (if not already loaded) and create the device nodes (if not already created).
This PR also re-introduces the restart logic which was removed in 5fe6b42. Without the restart logic, it is possible that our service gets started too early in the boot process and executing "nvidia-smi" fails. With retries, the "nvidia-smi" invocation should eventually succeed, allowing us to generate a CDI spec.
Note, re-introducing the restart logic in the systemd service means we should re-open #1624. I believe there are ways to address the use case in #1624 while still keeping the restart logic -- 1) Reducing the logs emitted by
nvidia-ctk cdi generateand/or 2) Updatingnvidia-ctk cdi generateto exit early with a zero exit code if no GPUs are detected on the system.