openclaw - ✅(Solved) Fix feat: GPU passthrough for Docker sandbox [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#57976Fetched 2026-04-08 01:55:22
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
2
Participants
Timeline (top)
cross-referenced ×1subscribed ×1

Fix Action

Fix / Workaround

Current workarounds are all suboptimal:

  • Run on CPU (slow, impractical for larger models)
  • Expose an HTTP service outside the sandbox (fragile, extra infra)
  • Disable sandboxing for agents that need GPU (defeats the purpose)

PR fix notes

PR #58124: feat: add GPU passthrough for Docker sandbox

Description (problem / solution / changelog)

Closes #57976

What: Adds a gpus option to the sandbox Docker configuration.

Why: Sandboxed agents can't access host GPUs, blocking local AI workloads like Whisper transcription. Our use case: a sandboxed agent receives voice messages and needs to transcribe them with a local Whisper model.

How: One new optional string field flowing through the existing config pipeline — types → schema → resolution → container args. Maps directly to Docker's --gpus flag.

{ sandbox: { docker: { gpus: "all" } } }

4 files, 7 lines added. Opt-in only, no default behavior changes.

Changed files

  • docs/.generated/config-baseline.json (modified, +295/-168)
  • docs/.generated/config-baseline.jsonl (modified, +47/-45)
  • src/agents/sandbox/config.ts (modified, +1/-0)
  • src/agents/sandbox/docker.ts (modified, +3/-0)
  • src/config/types.sandbox.ts (modified, +2/-0)
  • src/config/zod-schema.agent-runtime.ts (modified, +1/-0)

Code Example

{
  agents: {
    defaults: {
      sandbox: {
        docker: {
          gpus: "all"  // maps to: docker create --gpus all
        }
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Problem

Sandboxed agents can't access host GPUs. This blocks running local AI models inside sandbox containers — for example, using local Whisper for audio transcription instead of a cloud API.

Current workarounds are all suboptimal:

  • Run on CPU (slow, impractical for larger models)
  • Expose an HTTP service outside the sandbox (fragile, extra infra)
  • Disable sandboxing for agents that need GPU (defeats the purpose)

Use case

We run a sandboxed agent that receives voice messages and needs to transcribe them with a local Whisper model using the host GPU.

Proposed solution

Add one optional field to sandbox.docker config:

{
  agents: {
    defaults: {
      sandbox: {
        docker: {
          gpus: "all"  // maps to: docker create --gpus all
        }
      }
    }
  }
}

gpus (string, optional) — passed directly to Docker's --gpus flag. Accepts "all", "1", "device=GPU-uuid", etc. Requires the NVIDIA Container Toolkit on the host.

Opt-in only, no default behavior changes. Same trust model as network: "bridge" or dangerouslyAllowExternalBindSources — the operator explicitly enables it.

extent analysis

Fix Plan

To enable sandboxed agents to access host GPUs, follow these steps:

{
  agents: {
    defaults: {
      sandbox: {
        docker: {
          gpus: "all"
        }
      }
    }
  }
}
  • Replace "all" with a specific GPU device ID (e.g., "device=GPU-uuid") if needed.
  • Restart the sandboxed agent to apply the changes.

Verification

To verify that the fix worked:

  • Check the Docker container logs for GPU-related errors.
  • Run a GPU-intensive task (e.g., a local Whisper model) inside the sandboxed container and monitor its performance.
  • Use tools like nvidia-smi to verify that the container has access to the host GPU.

Extra Tips

  • Ensure the host system has a compatible NVIDIA GPU and the necessary drivers installed.
  • Be cautious when enabling GPU access, as it may introduce security risks if not properly configured.
  • Consider implementing additional security measures, such as restricting GPU access to specific containers or users.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix feat: GPU passthrough for Docker sandbox [1 pull requests, 1 participants]