Report why the host CUDA version could not be read - #2113
Merged
Merged
Conversation
getEnableCUDACompatHookOptions formats the error from getCUDAVersionString with ret, the NVML return of the Init call forty lines up, instead of err. Init is checked and returns early on anything but SUCCESS, so ret is always SUCCESS by then and the message reads failed to get host CUDA version: SUCCESS while the only description of the failure, err, is dropped. The wrapped value is an nvml.Return, so it is also what a caller would match on. Wrap err with %w, as the rest of the file does. Signed-off-by: Dmitry Voropaev <dy.voropaev@gmail.com>
v0ropaev
requested review from
cdesiniotis,
henry118 and
tariq1890
as code owners
September 28, 2026 19:17
tariq1890
approved these changes
Sep 30, 2026
Member
|
@v0ropaev can you please cryptographically sign the commit? thanks |
v0ropaev
force-pushed
the
fix/csv-cuda-version-error
branch
from
October 1, 2026 21:25
3d5f770 to
1baab56
Compare
Contributor
Author
|
Signed this one too, same key. Nothing else changed in the commit. |
Member
|
/ok to test 1baab56 |
Coverage Report for CI Build 36928533567Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+0.03%) to 44.636%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
henry118
approved these changes
Oct 1, 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.
Description
getEnableCUDACompatHookOptionsinpkg/nvcdi/lib-csv.goformats the wrong variable:retis assigned once, fromInit(), and the check right below it returns early on anything butnvml.SUCCESS. So by the time the CUDA-version call fails,retisSUCCESSand the message readswhile
err, the only thing that says what went wrong, is dropped.getCUDAVersionStringreturns thenvml.ReturnfromSystemGetCudaDriverVersionas its error, so what is lost is also the value a caller would match on.Wrapping
errwith%wmatches the rest of the file, which uses%win nine other places.Checklist
make test)make lint) — golangci-lint is not installed here;gofmt -s -lon the package is cleanTesting
TestGetEnableCUDACompatHookOptionsReportsWhyTheVersionFaileddrives the function with amock.InterfacewhoseInitsucceeds and whoseSystemGetCudaDriverVersionreturnsERROR_NOT_SUPPORTED, then asserts the error names that and notSUCCESS. On current main:darwin/arm64, Go 1.27.1, no GPU.