fix(local-ai): revert dedicated-memory admission caps for RTX Spark - #1422
Conversation
Revert the DXGI cap from 03975b6 and its later NVML fallback, which exclude RTX Spark 48GB devices with a 16GB carveout. Restore CUDA-reported total/free memory while preserving retryable partial facts, current catalog selection, and setup/recovery behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d82b14c5-913a-4f60-a2d9-2a5877593a5a
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 14, 2026, 3:51 PM ET / 19:51 UTC. ClawSweeper reviewWhat this changesThe PR restores CUDA-reported memory for Local AI model qualification, removes dedicated-memory caps, and updates hardware tests and setup documentation. Merge readiness⛔ Blocked before merge - 4 items remain The rollback remains necessary relative to current main and contains no definite introduced correctness defect. Target-device validation merits maintainer judgment because earlier Spark evidence includes both allocation failure and successful inference on different builds. Priority: P2 Review scores
Verification
How this fits togetherLocal AI qualification converts NVIDIA driver readings into a GPU, model, and runtime selection before setup downloads model files. These readings also influence launch readiness and recovery. flowchart TD
A[NVIDIA CUDA driver] --> B[Hardware probe]
B --> C{Hardware facts complete?}
C -->|No| D[Retryable unavailable state]
C -->|Yes| E[Model qualification]
E --> F[Setup and model download]
F --> G[Runtime launch and recovery]
Decision needed
Why: The intended policy reversal is explicit, but historical Spark outcomes conflict across builds and the current proof never admits a model. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Supported Spark installations should qualify and remain usable through fresh setup and recovery, with allocation failures handled by the existing runtime diagnostics. Do we have a high-confidence way to reproduce the issue? Yes, source establishes that main caps the reported 46,332 MiB CUDA capacity at a 16,320 MiB dedicated reading and excludes catalog models. Successful inference on the target SKU at this head remains unverified. Is this the best way to solve the issue? Yes for the explicitly requested admission rollback: the patch removes the cap machinery without undoing identity, retry, catalog, or recovery improvements. Its hardware usability claims still need the stated evidence decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bd9ce43b4d9c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Landing decision: proceed with the requested surgical rollback. The maintainer explicitly requested restoring CUDA-only admission for the reported RTX Spark 48 GB / 16 GB-carveout regression and subsequently directed this PR to be merged after the target-hardware limitation had been disclosed. Both the local scoped Codex review and ClawSweeper identify no actionable introduced correctness defect. CI Gate, core/CLI, tray/setup/integration, UI/accessibility, setup/connect and recovery E2E, and CodeQL checks have now passed at 4723adb. We accept the documented qualification tradeoff for this rollback: CUDA-visible capacity can admit a model that later fails to load. This is not a claim of current-head Spark inference or native ARM64 proof; those remain unverified. Default setup no longer gates installation on inference. Recovery and runtime error handling are unchanged. No further scope expansion is warranted for this revert. |
Summary
Surgically revert the dedicated-memory admission cap introduced by
03975b60ac59d96641e46aa3c536e56eea90ee09in #1253 (fix(local-ai): bound GPU admission by dedicated device memory), including its later NVML fallback. The reported regression affects RTX Spark's 48 GB SKU with a 16 GB carveout: dedicated-memory accounting limits admission to the carveout instead of CUDA-visible memory.cuMemGetInfototal/free memory as the sole GPU-memory authority. Remove DXGI/NVML cap readers and their now-unused LUID interop.Default setup already skips inference validation. Explicit inference proof and recovery pipelines still run inference and are unchanged. Qualification is not a guarantee that a runtime model load or inference will succeed.
Required proof pools
windows-wsl-dgx-blackwell: target RTX Spark unified-memory admission regression. Not verified / blocked: no target Spark hardware available in this session.windows-11-arm64: target ARM64 Spark hardware behavior. Not verified / blocked: architecture-specific qualification is covered by unit tests, not a native ARM64 run.Validation
Validated commit:
4723adb7..\build.ps1: passed all five projects and documentation validation.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 3,984 passed, 32 skipped, 0 failed.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 2,976 passed, 0 failed. Tray settings isolated withOPENCLAW_TRAY_DATA_DIR; project built first to prevent a fresh-worktree no-op.dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --filter 'FullyQualifiedName~LocalAiPortHandoffTests|FullyQualifiedName~SetupPipelineTests|FullyQualifiedName~LocalAiGpuVerificationTests': 54 passed, 0 failed.OPENCLAW_REPO_ROOTset to the isolated worktree for tests.python .\.agents\skills\autoreview\scripts\autoreview --mode localwith the explicit rollback scope: Codex review clean, no accepted/actionable findings.Real behavior proof
Ran
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-build --no-restore --filter 'FullyQualifiedName~LocalInferenceHardwareProbeTests' --logger 'console;verbosity=detailed'withOPENCLAW_RUN_GPU_PROOF=1.Current-head live output:
The hardware test compares the production probe's output to the exact native CUDA snapshot it consumed, avoiding a second free-memory reading that could race other workloads. This proves uncapped CUDA reporting on the local discrete GPU, not Spark compatibility or successful inference.
Not verified / blocked: live RTX Spark 48 GB / 16 GB-carveout admission, native ARM64 execution, and target-device inference. No UI controls, MCP contracts, gateway setup steps, or recovery steps changed.