GPU sandboxes are in private preview and require your organization to be allowlisted, even if it already has access to CPU-only sandboxes in public preview. To request access, contact your account team or email forge-support@coreweave.com. Until your organization is allowlisted, requests to create GPU sandboxes fail with
CWSANDBOX_GPU_NOT_ALLOWED.Before you begin
You need the following:- GPU sandboxes enabled for your organization.
- A W&B API key.
-
The Python client,
cwsandbox1.14.2 or later, with thewandbextra:
How GPU requests work
GPU requests follow these rules:- A GPU request reserves GPUs and nothing else. Set CPU and memory explicitly, sized for the work you’ll run alongside the GPU. Omitted CPU and memory values can use the policy’s
defaultCpuanddefaultMemory, but the resolved allocation must still satisfy the policy’s resource requirements. - Sandboxes get whole GPUs. GPUs aren’t shared, partitioned, or time-sliced between sandboxes.
- A sandbox gets exactly 1 GPU. Serverless capacity supports only 1-GPU sandboxes.
- The GPU type is a filter, not a menu. The optional
typekey must match exactly, including case, one of the GPU types the runner advertises. Omit it to accept any GPU the runner has.
Run a GPU sandbox on serverless capacity
Serverless placement needs no runner and no policy of your own. CoreWeave owns the policy and the hardware. GPU sandboxes run in a virtual machine, so they suit untrusted code.Available GPUs
Serverless capacity runs one GPU model, the NVIDIA RTX PRO 6000 Blackwell Server Edition. Only 1-GPU sandboxes are supported on serverless capacity.
Two instance types carry it: High Memory and Standard Memory. They differ in host RAM, not in the GPU, and both present the same GPU type to a sandbox, so which one a sandbox lands on isn’t something you select.
Leave the
type key out of the GPU request so the platform assigns a GPU from CoreWeave-managed compute. The field is still accepted here, but it filters rather than selects: a type that matches no runner fails with CWSANDBOX_RUNNER_UNAVAILABLE. A runner that receives an unsupported type rejects it with CWSANDBOX_PLACEMENT_CONSTRAINT_UNSATISFIED.
Use resources to choose CPU and memory alongside the GPU count, as shown in the following example.
Disk is requested separately from CPU, memory, and GPU rather than alongside them: ResourceOptions has no disk field. The container’s root filesystem is Node-local ephemeral storage that the sandbox doesn’t reserve a share of, so df inside the sandbox reports the Node’s filesystem rather than a per-sandbox quota. For a dedicated writable path, declare a scratch volume:
medium="memory" for a tmpfs instead: a memory-backed volume must declare a size, and the memory-backed volumes on one container can’t total more than 80% of its memory request.
Leave runtime_class unset too. A GPU request selects the GPU virtual machine runtime class on its own, and a runtime class you pin is used exactly as given, so pinning the CPU class alongside a GPU request produces a sandbox that can’t reach the GPU.
Create the sandbox
SetWANDB_API_KEY to your W&B API key, then run the following example. It creates a sandbox with 1 GPU, 2 CPUs, and 8 GiB of memory, then prints the GPU that nvidia-smi reports.
- Python
- TypeScript
This example uses The flat
AuthStrategy.WANDB for a W&B API key.resources dict sets requests and limits to the same values. "gpu": 1 is shorthand for "gpu": {"count": 1}. Serverless supports only 1 GPU per sandbox, so keep the count at 1.The resource_gpu property returns the GPU allocation the platform confirmed, such as {'count': 1}.Container images
The platform provides the NVIDIA driver and thenvidia-smi tool inside a GPU sandbox, so the default image can already see the GPU. To run CUDA applications, use an image that ships the CUDA runtime and libraries your code needs, such as a pytorch/pytorch or nvidia/cuda image.
Match the image to the GPU. The RTX PRO 6000 Blackwell Server Edition is compute capability 12.0 (sm_120), which needs CUDA 12.8 or later, and PyTorch 2.7 was the first release built for it. An older image still reports the GPU’s name correctly, because that reads device metadata through the driver, then fails at the first kernel launch with CUDA error: no kernel image is available for execution on the device. Check that your framework lists sm_120 rather than trusting the device name:
Common errors
Next steps
- Sandbox configuration covers every
ResourceOptionsfield, QoS classes, and timeouts. - Get started covers CPU-only serverless sandboxes and credentials.