Skip to content

fix(onboard): fall back to default CDI spec dirs when docker info reports none - #7347

Merged
senthilr-nv merged 11 commits into
NVIDIA:mainfrom
andrewwhitecdw:fix/onboard-cdi-spec-dirs-fallback
Jul 24, 2026
Merged

fix(onboard): fall back to default CDI spec dirs when docker info reports none#7347
senthilr-nv merged 11 commits into
NVIDIA:mainfrom
andrewwhitecdw:fix/onboard-cdi-spec-dirs-fallback

Conversation

@andrewwhitecdw

@andrewwhitecdw andrewwhitecdw commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

The native-Linux sandbox GPU preflight now checks Docker's built-in CDI
directories when docker info reports no CDISpecDirs. This prevents a false
failure when an NVIDIA CDI specification is present in a default directory,
while preserving the existing failure when no readable NVIDIA specification
exists.

Related Issue

Closes #7330

Product Scope

Product-scope verdict: PASS. This fixes existing native-Linux onboarding
behavior and does not add an integration, configuration surface, solution
workflow, custom image, or third-party stack.

Changes

  • Fall back to /etc/cdi and /var/run/cdi only when Docker reports no CDI
    specification directories. Docker-reported directories retain precedence.
  • Cover successful default-directory detection and the failure path when the
    default directories contain no NVIDIA specification.
  • Assert the successful fallback through the public preflight result with an
    exact default-directory fake, which addresses the automated test-quality
    finding without changing product behavior.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: This repairs internal CDI detection.
    Existing command and troubleshooting documentation already covers native
    Linux CDI prerequisites, remediation, and default CDI directories.
  • Sensitive paths changed (security, policy, credentials, preflight,
    onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded —
    reviewer/approval link/justification: A Codex Desktop nine-category security
    review at PR SHA 619dc1aec found no findings. Independent human
    sensitive-path review remains required.
  • Non-success, skipped, or missing CI check accepted by maintainer — check
    name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: no-docs-needed
  • Evidence: The change repairs existing native-Linux CDI detection without
    adding commands, configuration, output contracts, or product surfaces.
    Existing command, troubleshooting, and changelog documentation covers CDI
    prerequisites, remediation, and default directories. The changed comment and
    test titles follow WRITING.md. No docs build applies because no
    documentation changed.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears
    as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or
    npm run check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are
    marked not applicable above — command/result or justification:
    ./node_modules/.bin/vitest run --project cli src/lib/onboard/sandbox-gpu-preflight-routing.test.ts src/lib/onboard/docker-cdi.test.ts src/lib/onboard/preflight-cdi.test.ts
    3 files and 44 tests passed after the upstream/main merge.
  • Applicable broad gate passed — npm test for broad runtime/test-harness
    changes; npm run check for repo-wide validation/coverage changes —
    command/result:
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the
    style guide
    (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Andrew White andrewh@cdw.com

…orts none

When docker info fails or reports no CDISpecDirs, the sandbox GPU preflight
scanned zero directories and aborted with "Docker CDI GPU support was not
detected" even on hosts where CDI works (for example /etc/cdi/nvidia.yaml
present and docker run --device=nvidia.com/gpu=all succeeds). Fall back to
Docker Engine's built-in CDI spec directories (/etc/cdi, /var/run/cdi)
before declaring CDI unsupported.

Closes NVIDIA#7330

Signed-off-by: Andrew White <andrewh@cdw.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Docker CDI GPU preflight now falls back to /etc/cdi and /var/run/cdi when Docker reports no CDI specification directories. Tests cover successful fallback lookup and failure reporting when no NVIDIA CDI specification exists.

Changes

Docker CDI preflight

Layer / File(s) Summary
CDI directory fallback
src/lib/onboard/sandbox-gpu-preflight.ts
Defines Docker’s default CDI directories and uses them when the reported CDI directory list is empty.
Fallback routing validation
src/lib/onboard/sandbox-gpu-preflight-routing.test.ts
Verifies fallback NVIDIA specification lookup and the error path when no specification is found.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The code implements the requested CDI fallback and regression tests for the false-negative onboarding case in #7330.
Out of Scope Changes check ✅ Passed The changes are limited to the CDI fallback fix and its regression tests, with no unrelated scope added.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: falling back to default CDI spec directories when Docker reports none.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/lib/onboard/sandbox-gpu-preflight-routing.test.ts (1)

95-113: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the public preflight outcome instead of a helper call.

toHaveBeenCalledWith(...) couples this regression test to the internal collaborator call. Make the fake return a spec only for the expected fallback directories and inject an exitProcess stub, so incorrect routing fails through validateSandboxGpuPreflight’s observable behavior.

As per path instructions, tests should prioritize behavioral confidence over private mock-call assertions.

Proposed test adjustment
-    const findReadableNvidiaCdiSpecFiles = vi.fn((dirs: string[]) =>
-      dirs.includes("/etc/cdi") ? ["/etc/cdi/nvidia.yaml"] : [],
-    );
+    const findReadableNvidiaCdiSpecFiles = (dirs: string[]) =>
+      dirs.length === 2 &&
+      dirs[0] === "/etc/cdi" &&
+      dirs[1] === "/var/run/cdi"
+        ? ["/etc/cdi/nvidia.yaml"]
+        : [];
+    const exitProcess = (code: number): never => {
+      throw new Error(`exit:${code}`);
+    };

     expect(() =>
       validateSandboxGpuPreflight(sandboxGpuConfig(), {
         // ...
         findReadableNvidiaCdiSpecFiles,
-      }),
+      }, exitProcess),
     ).not.toThrow();
-    expect(findReadableNvidiaCdiSpecFiles).toHaveBeenCalledWith(["/etc/cdi", "/var/run/cdi"]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/onboard/sandbox-gpu-preflight-routing.test.ts` around lines 95 - 113,
Update the regression test around validateSandboxGpuPreflight to assert its
observable preflight outcome rather than the internal
findReadableNvidiaCdiSpecFiles invocation. Configure the fake to return a spec
only when passed ["/etc/cdi", "/var/run/cdi"], inject an exitProcess stub, and
assert the resulting validation behavior so incorrect fallback routing causes
the test to fail.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/lib/onboard/sandbox-gpu-preflight-routing.test.ts`:
- Around line 95-113: Update the regression test around
validateSandboxGpuPreflight to assert its observable preflight outcome rather
than the internal findReadableNvidiaCdiSpecFiles invocation. Configure the fake
to return a spec only when passed ["/etc/cdi", "/var/run/cdi"], inject an
exitProcess stub, and assert the resulting validation behavior so incorrect
fallback routing causes the test to fail.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2d18bac8-d1c0-4c5f-8a7b-16877a0ceb5f

📥 Commits

Reviewing files that changed from the base of the PR and between 7be3ef7 and 3f84360.

📒 Files selected for processing (2)
  • src/lib/onboard/sandbox-gpu-preflight-routing.test.ts
  • src/lib/onboard/sandbox-gpu-preflight.ts

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / high confidence
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions
Status: No actionable findings remain in the canonical review ledger.

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 3 warnings · 1 suggestion
  • Model comparison: normalized findings differ; normalized E2E selections differ; Nemotron reported the same number of blockers, 3 more warnings, 1 more suggestion.

Nemotron output stays in workflow artifacts and does not change the assessment above.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: onboard-repair, onboard-resume, cloud-onboard

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@cv cv added the v0.0.93 label Jul 22, 2026
@wscurran wscurran added area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression labels Jul 23, 2026
@wscurran

Copy link
Copy Markdown
Contributor

✨ Thanks for the fix. This addresses the false CDI detection failure during onboarding. Maintainers will review the fallback logic for Docker CDI spec directories.


Related open issues:

@senthilr-nv

Copy link
Copy Markdown
Collaborator

@cv Please:

  1. Approve the approve-credentialed-e2e-skip-for-fork-pr environment for PR fix(onboard): fall back to default CDI spec dirs when docker info reports none #7347 in E2E Gate run 30120003754.
  2. Independently review PR fix(onboard): fall back to default CDI spec dirs when docker info reports none #7347 and, if satisfied, submit a GitHub PR approval.

Exact pair:

  • Head: ea35cb7de2be13b77528bef47c2c78cb147b5945
  • Base/live main: b9c82f11ad9c93d28fea7e87fffb7c6dc3c07a02

Required CI passed for this pair. The environment approval records the policy-required skip for credential-bearing fork jobs onboard-repair and onboard-resume; no fork code received repository secrets. It does not replace independent code review, and neither action authorizes merging.

@senthilr-nv senthilr-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and approve the file changes at exact head ea35cb7 against base b9c82f1.
This is an existing CDI preflight bug fix, not a new supported product surface. Required CI, focused tests, CodeQL, security checks, documentation receipt, and automated reviews pass for this head. All displayed commits are Verified.
This approval covers only the reviewed code at this exact head. The protected fork E2E-skip approval and final merge decision remain separate.

@senthilr-nv
senthilr-nv merged commit 361ceac into NVIDIA:main Jul 24, 2026
64 of 69 checks passed
@senthilr-nv senthilr-nv mentioned this pull request Jul 25, 2026
23 tasks
senthilr-nv added a commit that referenced this pull request Jul 25, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Adds the canonical pre-tag `## v0.0.95` release entry to
`docs/changelog/2026-07-24.mdx`, before the existing v0.0.94 entry. The
entry summarizes approved user-visible changes merged since v0.0.94 and
excludes internal-only prerequisites.

## Changes

- Adds the v0.0.95 summary and detailed bullets for gateway lifecycle,
recovery, state transfer, inference compatibility, sandbox security,
Discord policy, and E2E evidence.
- Links each user-facing theme to the most specific published
documentation.
- Records the release entry in the shared native changelog used by the
OpenClaw, Hermes, and Deep Agents guides.

Source summary:

- [#7246](#7246),
[#7228](#7228),
[#7267](#7267),
[#7489](#7489),
[#7509](#7509),
[#7351](#7351), and
[#7290](#7290) ->
`docs/changelog/2026-07-24.mdx`: Gateway authority, forward teardown and
retry, managed recovery, Hermes restart recovery, scoped uninstall, and
orphan-aware backup behavior.
- [#7344](#7344) and
[#7416](#7416) ->
`docs/changelog/2026-07-24.mdx`: Atomic SQLite restore and host download
verification.
- [#7476](#7476),
[#7347](#7347),
[#7281](#7281),
[#7485](#7485),
[#7491](#7491), and
[#7422](#7422) ->
`docs/changelog/2026-07-24.mdx`: Windows Ollama reuse, CDI fallback,
bounded OpenRouter connection setup, Nemotron-3 request compatibility,
and managed Deep Agents retry and provider-error behavior.
- [#6884](#6884),
[#7481](#7481),
[#6878](#6878),
[#7467](#7467),
[#7502](#7502),
[#7503](#7503),
[#7504](#7504), and
[#7486](#7486) ->
`docs/changelog/2026-07-24.mdx`: Trusted base-image overrides, local
rebuild images, runtime validation, config preservation, reviewed
package updates, and fewer final-image payload layers.
- [#7303](#7303) ->
`docs/changelog/2026-07-24.mdx`: Scoped Discord application-command
management.
- [#7488](#7488),
[#7465](#7465),
[#7497](#7497),
[#7464](#7464),
[#7501](#7501),
[#7494](#7494), and
[#7493](#7493) ->
`docs/changelog/2026-07-24.mdx`: Selected-test risk signals, retry
cleanup, full root-image validation, direct-main Hermes setup, executed
PR-gate evidence, nightly history, and runner wait reporting.
- [#7447](#7447) is an internal
pinned-runtime prerequisite and is intentionally excluded from canonical
supported-integration documentation.
- [#7370](#7370) adds
maintainer-only advisory reconciliation tooling and does not change
supported user behavior.
- [#7495](#7495) updates existing
documentation and does not add a new v0.0.95 behavior claim.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [x] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates

- [ ] Tests added or updated for changed behavior
- [x] Existing tests cover changed behavior — justification:
`test/changelog-docs.test.ts` validates the dated changelog structure,
heading uniqueness, and published links.
- [ ] Tests not applicable — justification:
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Documentation Writer Review

- [x] Documentation writer subagent reviewed the completed changes
- Result: `docs-updated`
- Evidence: `docs/changelog/2026-07-24.mdx`; writing rules,
documentation style, factual release meaning, and published links
reviewed at exact head `58b02f2bf`.
- Agent: Codex documentation writer reviewer
<!-- docs-review-head-sha: 58b02f2 -->
<!-- docs-review-agents-blob-sha: 9c9b36d -->

## DGX Station Hardware Evidence

- [ ] Tested on DGX Station
- Tested commit:
- Station profile/scenario:
- Result:
- Supporting evidence:

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — command/result or justification: `npx
vitest run test/changelog-docs.test.ts` passed 6 tests.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result:
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — the
build passed with 0 errors and 2 Fern warnings.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
  * Added a new v0.0.95 changelog entry above v0.0.94.
* Documented improved externally supervised gateway lifecycle ownership.
  * Improved snapshot restore reliability and SQLite state handling.
  * Tightened CLI `backup-all` behavior and host artifact verification.
* Updated Windows onboarding guidance (including Ollama service reuse
and CDI directory fallback).
* Noted inference compatibility fixes, deeper agent failure
classification, stricter base-image validation, updated Discord bot
command permissions, and refined E2E release automation evidence
handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False "Docker CDI GPU support was not detected" on native Linux although CDI GPU passthrough works

6 participants