Repository navigation
Conversation
…leLogger formatting
A GPU that is not bound to vfio has no vfio-dev directory, which is the
normal case, yet nvpci logged a warning for every such device on every
scan. The warning was also garbled ("%!v(MISSING)") because
simpleLogger passed its variadic arguments as a single slice. Treat a
missing vfio-dev directory as "no IOMMU FD" without a warning, and
forward the arguments with v... .
Signed-off-by: YoungjuKim <fjvbn2003@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.
Problem
GPU Feature Discovery (k8s-device-plugin v0.19.3, deployed by GPU Operator v26.3.3) prints this line every time it relabels a node, on every node, for every GPU that is bound to the
nvidiadriver:There are two problems in
pkg/nvpci:getIOMMUFD()returns theReadDirerror when<device>/vfio-devdoes not exist, andgetGPUByPciBusID()logs it as a warning. The kernel only createsvfio-devfor a device that is bound to a VFIO driver on a kernel with VFIO device cdev support. For a GPU that is bound tonvidia, which is the common case, a missingvfio-devdirectory is expected and there is no IOMMU FD to report.simpleLogger.Warningf()passes the variadic slice as one argument (log.Printf("WARNING: "+format, v)), so every warning that goes through the default logger is garbled: the arguments are printed as one[...]list and the last verb becomes%!v(MISSING).Measured on five single-GPU nodes (RTX 4070 Laptop x2, RTX 4060 Laptop, RTX 3060 Laptop, RTX 3090) with GFD's default 60 s sleep interval, over the last 24 hours:
unable to detect IOMMU FD%!v(MISSING)Creating LabelsOne line in four of the GFD log is this warning.
Changes
getIOMMUFD()returns"", nilwhenvfio-devdoes not exist. Other errors, and an existingvfio-devdirectory without avfio*entry, are still reported as before.simpleLogger.Warningf()forwards the arguments withv....TestNvpciIOMMUFDNotBoundToVFIO(novfio-dev→ emptyIommuFD, no warning),TestNvpciIOMMUFDEmptyVFIODev(the remaining warning is still logged, with the expected text), andTestSimpleLoggerWarningf.Testing
Without the change,
TestSimpleLoggerWarningffails with the same[...]: %!v(MISSING)output as above, andTestNvpciIOMMUFDNotBoundToVFIOfails because the warning is logged.I did not run
golangci-lintlocally.GFD gets the fix with its next go-nvlib bump.
I used an AI assistant (Claude) to help investigate and write this change; I reviewed and tested it myself.
🤖 Generated with Claude Code