Expand nvidia-smi symlink resolution to additional host paths#2611
Open
vishalanarase wants to merge 1 commit into
Open
Expand nvidia-smi symlink resolution to additional host paths#2611vishalanarase wants to merge 1 commit into
vishalanarase wants to merge 1 commit into
Conversation
Signed-off-by: Vishal Anarase <iamvishalanarase@gmail.com>
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.
Description
Fixes #2506.
PR #2464 updated host
nvidia-smivalidation to resolve symlinks under/usr/bin/nvidia-smiusingpathrs.OpenInRoot. Review feedback noted that other common locations are also used in the wild and should be searched in a follow-up:/usr/sbin/nvidia-smi— Talos and similar distros/usr/lib/wsl/lib/nvidia-smi— WSLThis change expands
resolveHostNvidiaSMIto search multiple host paths (aligned withgetNvidiaSMIPath()infind.goand the DRA driver prestart script):Each path is resolved via pathrs.OpenInRoot, so symlink handling remains scoped to the mounted host root. The function now returns the resolved path, and validateHostDriver / runValidation use that path in chroot instead of relying on PATH lookup.
Checklist
make lint)make validate-generated-assets)make validate-modules)Testing
Unit tests added/extended in
cmd/nvidia-validator/main_test.go(TestResolveHostNvidiaSMI), covering:nvidia-smipresent at each search path (/opt/bin, /bin, /usr/bin, /usr/sbin, WSL)nvidia-smiis missing or resolves outside the host rootgo test ./cmd/nvidia-validator -run TestResolveHostNvidiaSMI -vNote:
pathrs-liteis Linux-only (//go:build linux), so tests must be run on Linux or via Docker: