← Back to Pull requests

Report why the host CUDA version could not be read #2113

Closed
unknown closed this pull request without merging on Oct 01, 2026 22:54 UTC
View on GitHub
unknown unknown commented on Sep 28, 2026 19:17 UTC
Author

Description

getEnableCUDACompatHookOptions in pkg/nvcdi/lib-csv.go formats the wrong variable:

ret := l.nvmllib.Init()
if ret != nvml.SUCCESS {
	return nil, fmt.Errorf("failed to initialize NVML: %v", ret)
}
...
hostCUDAVersion, err := l.getCUDAVersionString()
if err != nil {
	return nil, fmt.Errorf("failed to get host CUDA version: %v", ret)
}

ret is assigned once, from Init(), and the check right below it returns early on anything but nvml.SUCCESS. So by the time the CUDA-version call fails, ret is SUCCESS and the message reads

failed to get host CUDA version: SUCCESS

while err, the only thing that says what went wrong, is dropped. getCUDAVersionString returns the nvml.Return from SystemGetCudaDriverVersion as its error, so what is lost is also the value a caller would match on.

Wrapping err with %w matches the rest of the file, which uses %w in nine other places.

Checklist

  • No secrets, sensitive information, or unrelated changes

  • Unit tests passing (make test)

  • Lint checks passing (make lint) — golangci-lint is not installed here; gofmt -s -l on the package is clean

  • Test cases are added for new code paths

  • Commits are signed-off — DCO yes, not GPG signed
  • Testing

    TestGetEnableCUDACompatHookOptionsReportsWhyTheVersionFailed drives the function with a mock.Interface whose Init succeeds and whose SystemGetCudaDriverVersion returns ERROR_NOT_SUPPORTED, then asserts the error names that and not SUCCESS. On current main:

    Error "failed to get host CUDA version: SUCCESS" does not contain "ERROR_NOT_SUPPORTED"
    

    go test ./pkg/nvcdi/...   all ok
    go build ./...            ok
    

    darwin/arm64, Go 1.27.1, no GPU.

    Diff: 219 lines (+164 / -55) across 2 files Reviewer: tariq1890 Review duration: 4537m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 219 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.323
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2113"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.7% (MEDIUM) · Higher = larger blast radius
    36.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.5% · Safe to merge
    14.5%