# GPU boxes

> Boxes with one NVIDIA GPU, an L4 or an L40S, billed by the hour from your prepaid balance. In beta.

URL: https://prized.dev/docs/gpu-boxes

A GPU box is a box with one NVIDIA GPU: the same Ubuntu machine, CLI, sync, ports and sessions as any [box](https://prized.dev/docs/boxes), with the NVIDIA driver, `nvidia-smi` and Docker's GPU runtime ready. GPU boxes are in beta: write to the support address shown on https://prized.dev/docs/troubleshooting to have your workspace added.

## Sizes [#sizes]

GPU L4 (`gpu-l4`): 8 vCPU / 32 GB, 1 × L4, 24 GB GPU, 500 GB disk; $1.25 an hour awake, $0.05 an hour asleep. GPU L40S (`gpu-l40s`): 8 vCPU / 64 GB, 1 × L40S, 48 GB GPU, 500 GB disk; $2.75 an hour awake, $0.05 an hour asleep.

* **Billed from your prepaid balance only.** [Overage](https://prized.dev/docs/billing#overage) never covers a GPU box's awake hours, including ones still owed after it pauses or becomes a CPU size: a create, resume or resize onto one needs the balance to run your boxes, it included, for four hours, and at zero it pauses even where overage keeps your other boxes running. Asleep, its disk bills like any box's.
* **A paid plan.** A GPU box needs a plan whose first invoice is paid; the free credit or a top-up alone does not start one.
* **One GPU box per workspace** during the beta.
* **Oregon only** during the beta: GPU boxes run in US West (Oregon), `us-west-2`. A create, fork, resize or resume onto a GPU size in any other region answers `403 gpu_unavailable` with `reason` `region_unavailable`, and a GPU box does not [move regions](https://prized.dev/docs/boxes#regions). Pick Oregon under **Region** in the create form, or `--region us-west-2` in the CLI.
* **Disk only.** GPU sizes have the disk in the table, not [infinite storage](https://prized.dev/docs/boxes#infinite-storage).

## Create [#create]

```bash
prized box new lab --size gpu-l4 --wait
```

Or pick GPU L4 or GPU L40S in the dashboard's create form. Then check the GPU:

```bash
prized ssh lab -- nvidia-smi
```

Containers reach it through Docker's GPU flag:

```bash
prized ssh lab -- docker run --rm --gpus all ubuntu nvidia-smi
```

## Move a box onto a GPU [#move-a-box-onto-a-gpu]

Fork it: a new GPU box from a copy of the disk, while the original keeps running.

```bash
prized fork lab --tier gpu-l40s
```

A box created as a Medium, Large or Extra Large can also change size in place, and back:

```bash
prized box resize lab gpu-l4
```

Nano through Small keep their memory when they pause, which a GPU machine cannot do, so they fork instead, and so does a box that started as one; the resize says so, or goes back to the size it came from. A GPU box changes size while it runs or sleeps, not while it is resuming. A box's first boot on a GPU installs the driver: a few minutes, with Docker restarted once, and `prized box info` shows `driver installing` until it is done.

## Pause and resume [#pause-and-resume]

* **A clean stop.** Files survive; processes restart on resume, as on Medium and larger ([Pause and resume](https://prized.dev/docs/boxes#pause-and-resume)).
* **GPU work counts as use.** A GPU kept busy holds off [auto-pause](https://prized.dev/docs/boxes#auto-pause) like a busy CPU does.
* **When no GPU is free**, a resume waits about 10 minutes, billed as awake, and then the box goes back to sleep, with `reconciler:wake_gave_up:capacity` in its events. Resume it again later, or fork it, which can start on any free GPU in the region. A resize onto a GPU size bills the size it came from until the GPU is running, and goes back to that size if it cannot get one, or stays paused if that cannot start either. A resize off a GPU size bills the GPU until it is off, and one between GPU sizes bills the GPU it has until the new one is running.
* **Back to a CPU size:** resize a paused GPU box to Medium or larger and it resumes on the CPU size, without waiting for a GPU.

## What a GPU box shows [#what-a-gpu-box-shows]

`prized box info` has a `gpu` line (the model, utilization, memory in use), and the box's page in the dashboard shows the same under its live numbers.
