Skip to content

GPUs

A sandbox that you create with gpu=1 gets a whole NVIDIA GPU for itself. A sandbox without it gets no GPU.

from boxfork import Sandbox
with Sandbox.create("nvidia/cuda:12.9.1-base-ubuntu24.04", gpu=1) as sbx:
print(sbx.run("nvidia-smi").stdout)
  • One GPU, one owner. The GPU allocator gives each GPU to a maximum of one sandbox.
  • A check at the start. The daemon asks each new GPU sandbox which GPUs it sees. If the answer is not the GPUs that the sandbox got, the daemon removes the sandbox and the create fails.
  • Health. A GPU that does not answer nvidia-smi on the host does not go to a sandbox.
  • Release when idle. If you ask for it, an idle sandbox releases its GPU. See Suspend and wake.

On 6 December 2026, boxfork ran on a Google Cloud VM with one NVIDIA L4, under gVisor:

Check Result
A sandbox with --gpu 1 started in 452 ms
nvidia-smi in the sandbox shows the L4
A second GPU sandbox while the GPU is taken refused
CUDA vectorAdd in a sandbox Test PASSED, in 352 ms

These are single runs, not medians. The Google Cloud guide gives the full record.

  • Machines with more than one GPU, other GPU models and other drivers.
  • GPUs on Kubernetes. The API service on Kubernetes refuses a sandbox with a GPU at this time.
  • A shared GPU for trusted sandboxes is planned (#17).