NemoClaw icon indicating copy to clipboard operation
NemoClaw copied to clipboard

bug: onboard passes --gpu to gateway/sandbox on DGX Spark, causing FailedPrecondition

Open ericksoa opened this issue 8 months ago • 1 comments

Problem

nemoclaw onboard detects the host NVIDIA GPU via nim.detectGpu() and passes --gpu to both openshell gateway start and openshell sandbox create. On DGX Spark, this causes:

Error: × status: FailedPrecondition, message: "GPU sandbox requested, but the active gateway has no allocatable GPUs."

The sandbox still gets created (the error is non-fatal), but downstream failures cascade — port forwarding conflicts with stale sandboxes, and openshell policy set --wait fails with "sandbox not found" because the sandbox is in a degraded state.

Root Cause

The official NVIDIA DGX Spark playbooks (NemoClaw, OpenShell) do not use --gpu on gateway or sandbox creation. On Spark, GPU access is provided through Ollama running on the host, routed to the sandbox via openshell provider create / openshell inference set. The sandbox itself does not need direct GPU passthrough.

The NemoClaw Spark troubleshooting table explicitly states:

"No GPU detected" → "Expected on DGX Spark; proceeds normally"

Our onboard.js (line 116, 187) unconditionally passes --gpu whenever gpu.nimCapable is truthy, which is true on any host with an NVIDIA GPU — including DGX Spark where GPU passthrough to openshell sandboxes is not configured or expected.

Affected Code

  • bin/lib/onboard.js line 116: if (gpu && gpu.nimCapable) gwArgs.push("--gpu");
  • bin/lib/onboard.js line 187: if (gpu && gpu.nimCapable) createArgs.push("--gpu");

Additional Finding

The official Spark playbook includes a Docker configuration step that our setup-spark.sh does not perform:

sudo nvidia-ctk runtime configure --runtime=docker

This registers the NVIDIA container runtime in daemon.json. Our setup-spark.sh only sets default-cgroupns-mode: host but never configures the NVIDIA runtime. This may be a separate issue but is worth noting.

Proposed Fix

--gpu should only be passed when:

  1. A host NVIDIA GPU is detected, AND
  2. The user explicitly selects local NIM inference (not cloud API or Ollama), AND
  3. GPU passthrough is verified to work (e.g., openshell doctor or a test docker run --gpus all)

On DGX Spark specifically, the onboard flow should follow the official playbook: gateway without --gpu, sandbox without --gpu, inference routed through a host-side Ollama provider.

Acceptance Criteria

  • [ ] nemoclaw onboard completes without GPU-related errors on DGX Spark
  • [ ] --gpu is not passed to gateway/sandbox when inference is routed through Ollama or cloud API
  • [ ] Policy presets apply successfully after sandbox creation
  • [ ] E2E validation on DGX Spark: full install → onboard → sandbox creation → inference routing → live inference response through the sandbox, matching the official playbook flow
  • [ ] No regression on non-Spark Linux hosts where --gpu is intentionally used

References

  • Official NemoClaw Spark playbook: https://build.nvidia.com/spark/nemoclaw/instructions
  • Official OpenShell Spark playbook: https://build.nvidia.com/spark/openshell
  • NVIDIA Container Runtime docs: https://docs.nvidia.com/dgx/dgx-spark/nvidia-container-runtime-for-docker.html
  • Internal Spark install guide: spark-install.md (line 106: "GPU passthrough | Untested on Spark")

ericksoa avatar Mar 17 '26 19:03 ericksoa

Closed by #238

kjw3 avatar Mar 17 '26 20:03 kjw3