# GPU Sandboxes

Daytona provides **GPU sandboxes** for AI agents doing GPU-accelerated work, such as writing and profiling CUDA kernels, 3D and graphics workloads, and other GPU-accelerated compute. A GPU sandbox is a Linux container sandbox with one or more **NVIDIA** or **AMD** GPUs attached.

GPU sandboxes are ephemeral. Daytona deletes a GPU sandbox when it stops. A GPU sandbox runs on on-demand capacity, which is reserved until the sandbox is deleted, or on spot capacity, which Daytona can reclaim for on-demand sandboxes.

| **Term**          | **Description**                                                                                                    |
| ----------------- | ------------------------------------------------------------------------------------------------------------------ |
| **Sandbox**       | A Linux container sandbox with one or more GPUs attached, created on demand to run GPU code.                       |
| **GPU**           | A processor built for parallel computation. GPU sandboxes attach NVIDIA or AMD GPUs.                               |
| **GPU unit**      | One GPU attached to a sandbox. A create request sets the number of units.                                          |
| **GPU type**      | The GPU model, such as H100 or MI355X. A create request sets one type or an ordered list of types.                |
| **On-demand**     | GPU capacity reserved for the sandbox until it is deleted. On-demand GPU sandboxes count against the GPU quota.    |
| **Spot**          | Preemptible GPU capacity. Daytona deletes a spot GPU sandbox when an on-demand GPU sandbox needs the capacity.    |
| **Region**        | The shared region that runs GPU sandboxes on shared capacity. Daytona reports it as the earth region.              |
| **Volume**        | Shared storage mounted into a sandbox at a path. Data written to the mount path remains after the sandbox is deleted. |

## Use cases

An agent uses a GPU sandbox the way an engineer uses a GPU workstation: a real GPU for GPU-accelerated work, isolated from your infrastructure.

- **CUDA development**: an agent writes a CUDA kernel, compiles it, runs it on a real GPU, profiles it, and iterates on the result, without access to your hosts.
- **3D and graphics workloads**: rendering, geometry processing, and other GPU-accelerated graphics work run on a dedicated GPU instead of on shared hardware.
- **GPU-accelerated compute**: CUDA and ROCm workloads, such as simulation, signal processing, and data processing, run on NVIDIA or AMD GPUs sized for the job.
- **Agent-generated GPU code**: an agent writes PyTorch, CUDA, or other GPU code, runs it on a real GPU, and reads the result. The sandbox is deleted when the work is done.
- **Evaluation and benchmarks**: each kernel, build, or test case runs on its own GPU in a clean environment, so timings and results do not depend on another run.
- **Batch and interruptible jobs**: jobs that tolerate interruption run on [spot](#spot) capacity, and write their results to a volume so nothing is lost when the sandbox is preempted.

## Create a GPU sandbox

Daytona provides **GPU sandboxes** for agents doing GPU-accelerated work, such as writing and profiling CUDA kernels, 3D and graphics workloads, and other GPU-accelerated compute. GPU sandboxes are ephemeral and support up to **8 GPUs**. Resource limits scale with the number of GPU units: each GPU adds up to **16 vCPUs**, **192GB RAM**, and **512GB disk**. Supported **NVIDIA** and **AMD** GPU types:

- **NVIDIA H100**
- **NVIDIA H200**
- **NVIDIA B200**
- **NVIDIA B300**
- **NVIDIA RTX Pro 6000**
- **NVIDIA RTX 4090**
- **NVIDIA RTX 5090**
- **AMD Instinct MI355X**

GPU sandboxes are on-demand. See [spot GPU sandboxes](#spot) for preemptible GPU capacity. Use the [GPU capacity](#gpu-capacity) endpoint to check available GPU units before creating a sandbox. When no GPU capacity is available, a GPU sandbox waits until capacity frees up.

GPU sandboxes on shared regions run in the [earth region](https://www.daytona.io/docs/en/regions.md#earth-region). Daytona selects the shared region, ignores the requested target, and reports `earth` as the sandbox `target`. GPU sandboxes on [dedicated](https://www.daytona.io/docs/en/regions.md#dedicated-regions) and [custom](https://www.daytona.io/docs/en/regions.md#custom-regions) regions keep their real region ID. To run GPU sandboxes in a specific geographic location, contact [support@daytona.io](mailto:support@daytona.io).


Create a GPU sandbox from a default snapshot.

| **Snapshot**      | **vCPU** | **Memory** | **Storage** | **GPU** |
| ----------------- | -------- | ---------- | ----------- | ------- |
| **`daytona-gpu`** | 1        | 1GiB       | 1GiB        | 1       |

1. Go to [Daytona Sandboxes ↗](https://app.daytona.io/dashboard/sandboxes)
2. Click <Button>Create Sandbox</Button>
3. Select a GPU <Button>Snapshot</Button>: **`daytona-gpu`**
4. Click <Button>Create</Button>


```python
from daytona import Daytona, CreateSandboxFromSnapshotParams

daytona = Daytona()
sandbox = daytona.create(
    CreateSandboxFromSnapshotParams(
        snapshot="daytona-gpu",
        auto_delete_interval=0,
    )
)
```


```typescript
import { Daytona } from '@daytona/sdk'

const daytona = new Daytona()
const sandbox = await daytona.create({
  snapshot: 'daytona-gpu',
  autoDeleteInterval: 0,
})
```


```ruby
require 'daytona'

daytona = Daytona::Daytona.new
sandbox = daytona.create(
  Daytona::CreateSandboxFromSnapshotParams.new(
    snapshot: 'daytona-gpu',
    auto_delete_interval: 0
  )
)
```


```go
package main

import (
	"context"

	"github.com/daytona/clients/sdk-go/pkg/daytona"
	"github.com/daytona/clients/sdk-go/pkg/types"
)

func main() {
	client, _ := daytona.NewClient()
	ctx := context.Background()
	autoDelete := 0
	_, _ = client.Create(ctx, types.SnapshotParams{
		Snapshot: "daytona-gpu",
		SandboxBaseParams: types.SandboxBaseParams{
			AutoDeleteInterval: &autoDelete,
		},
	})
}
```


```java
import io.daytona.sdk.Daytona;
import io.daytona.sdk.Sandbox;
import io.daytona.sdk.model.CreateSandboxFromSnapshotParams;

public class App {
    public static void main(String[] args) {
        try (Daytona daytona = new Daytona()) {
            CreateSandboxFromSnapshotParams params = new CreateSandboxFromSnapshotParams();
            params.setSnapshot("daytona-gpu");
            params.setAutoDeleteInterval(0);
            Sandbox sandbox = daytona.create(params);
        }
    }
}
```


```bash
daytona create --snapshot daytona-gpu --auto-delete 0
```


```bash
curl 'https://app.daytona.io/api/sandbox' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data '{
  "snapshot": "daytona-gpu",
  "autoDeleteInterval": 0
}'
```



Create a GPU sandbox with custom GPU resources: units and types.

1. Go to [Daytona Sandboxes ↗](https://app.daytona.io/dashboard/sandboxes)
2. Click <Button>Create Sandbox</Button>
3. Enter an <Button>Image</Button> (e.g. **`pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime`**)
4. Set <Button>GPU</Button> to the number of GPU units (e.g. **`1`**)
5. Select <Button>GPU Type</Button>: **`H100`**, **`H200`**, **`B200`**, **`B300`**, **`RTX-PRO-6000`**, **`RTX-4090`**, **`RTX-5090`**, **`MI355X`**

    The GPU type field accepts a single value or an ordered list of preferred types.

    Daytona uses the first available type in the order you provide. This lets you fall back from a preferred GPU to an alternative when the first choice is not available.


```python
from daytona import Daytona, CreateSandboxFromImageParams, Resources, GpuType

daytona = Daytona()
sandbox = daytona.create(
    CreateSandboxFromImageParams(
        image="pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime",
        auto_delete_interval=0,
        resources=Resources(
            gpu=1,
            gpu_type=[GpuType.H100, GpuType.RTX_PRO_6000],
        ),
    )
)
```


```typescript
import { Daytona, GpuType } from '@daytona/sdk'

const daytona = new Daytona()
const sandbox = await daytona.create({
  image: 'pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime',
  autoDeleteInterval: 0,
  resources: {
    gpu: 1,
    gpuType: [GpuType.H100, GpuType.RTX_PRO_6000],
  },
})
```


```ruby
require 'daytona'

daytona = Daytona::Daytona.new
sandbox = daytona.create(
  Daytona::CreateSandboxFromImageParams.new(
    image: 'pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime',
    auto_delete_interval: 0,
    resources: Daytona::Resources.new(
      gpu: 1,
      gpu_type: [Daytona::GpuType::H100, Daytona::GpuType::RTX_PRO_6000]
    )
  )
)
```


```go
package main

import (
	"context"

	"github.com/daytona/clients/sdk-go/pkg/daytona"
	"github.com/daytona/clients/sdk-go/pkg/types"
)

func main() {
	client, _ := daytona.NewClient()
	ctx := context.Background()
	autoDelete := 0
	_, _ = client.Create(ctx, types.ImageParams{
		Image: "pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime",
		SandboxBaseParams: types.SandboxBaseParams{
			AutoDeleteInterval: &autoDelete,
		},
		Resources: &types.Resources{
			GPU:     1,
			GpuType: []types.GpuType{types.GpuTypeH100, types.GpuTypeRtxPro6000},
		},
	})
}
```


```java
import io.daytona.sdk.Daytona;
import io.daytona.sdk.Sandbox;
import io.daytona.sdk.model.CreateSandboxFromImageParams;
import io.daytona.sdk.model.Resources;
import io.daytona.api.client.model.GpuType;
import java.util.List;

public class App {
    public static void main(String[] args) {
        try (Daytona daytona = new Daytona()) {
            CreateSandboxFromImageParams params = new CreateSandboxFromImageParams();
            params.setImage("pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime");
            params.setAutoDeleteInterval(0);
            Resources resources = new Resources();
            resources.setGpu(1);
            resources.setGpuType(List.of(GpuType.H100, GpuType.RTX_PRO_6000));
            params.setResources(resources);
            Sandbox sandbox = daytona.create(params);
        }
    }
}
```


```bash
curl 'https://app.daytona.io/api/sandbox' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data '{
  "buildInfo": {
    "dockerfileContent": "FROM pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime\n"
  },
  "autoDeleteInterval": 0,
  "gpu": 1,
  "gpuType": ["H100", "RTX-PRO-6000"]
}'
```



### NVIDIA

Create a GPU sandbox with NVIDIA GPUs.

1. Go to [Daytona Sandboxes ↗](https://app.daytona.io/dashboard/sandboxes)
2. Click <Button>Create Sandbox</Button>
3. Enter an <Button>Image</Button> (e.g. **`pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime`**)
4. Set <Button>GPU</Button> to the number of GPU units (e.g. **`1`**)
5. Select <Button>GPU Type</Button>: **`H100`**, **`H200`**, **`B200`**, **`B300`**, **`RTX-PRO-6000`**, **`RTX-4090`**, **`RTX-5090`**


```python
from daytona import Daytona, CreateSandboxFromImageParams, Resources, GpuType

daytona = Daytona()
sandbox = daytona.create(
    CreateSandboxFromImageParams(
        image="pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime",
        auto_delete_interval=0,
        resources=Resources(
            gpu=1,
            gpu_type=[GpuType.H100],
        ),
    )
)
```


```typescript
import { Daytona, GpuType } from '@daytona/sdk'

const daytona = new Daytona()
const sandbox = await daytona.create({
  image: 'pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime',
  autoDeleteInterval: 0,
  resources: {
    gpu: 1,
    gpuType: [GpuType.H100],
  },
})
```


```ruby
require 'daytona'

daytona = Daytona::Daytona.new
sandbox = daytona.create(
  Daytona::CreateSandboxFromImageParams.new(
    image: 'pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime',
    auto_delete_interval: 0,
    resources: Daytona::Resources.new(
      gpu: 1,
      gpu_type: [Daytona::GpuType::H100]
    )
  )
)
```


```go
package main

import (
	"context"

	"github.com/daytona/clients/sdk-go/pkg/daytona"
	"github.com/daytona/clients/sdk-go/pkg/types"
)

func main() {
	client, _ := daytona.NewClient()
	ctx := context.Background()
	autoDelete := 0
	_, _ = client.Create(ctx, types.ImageParams{
		Image: "pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime",
		SandboxBaseParams: types.SandboxBaseParams{
			AutoDeleteInterval: &autoDelete,
		},
		Resources: &types.Resources{
			GPU:     1,
			GpuType: []types.GpuType{types.GpuTypeH100},
		},
	})
}
```


```java
import io.daytona.sdk.Daytona;
import io.daytona.sdk.Sandbox;
import io.daytona.sdk.model.CreateSandboxFromImageParams;
import io.daytona.sdk.model.Resources;
import io.daytona.api.client.model.GpuType;
import java.util.List;

public class App {
    public static void main(String[] args) {
        try (Daytona daytona = new Daytona()) {
            CreateSandboxFromImageParams params = new CreateSandboxFromImageParams();
            params.setImage("pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime");
            params.setAutoDeleteInterval(0);
            Resources resources = new Resources();
            resources.setGpu(1);
            resources.setGpuType(List.of(GpuType.H100));
            params.setResources(resources);
            Sandbox sandbox = daytona.create(params);
        }
    }
}
```


```bash
curl 'https://app.daytona.io/api/sandbox' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data '{
  "buildInfo": {
    "dockerfileContent": "FROM pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime\n"
  },
  "autoDeleteInterval": 0,
  "gpu": 1,
  "gpuType": ["H100"]
}'
```


### AMD

Create a GPU sandbox with AMD GPUs.

1. Go to [Daytona Sandboxes ↗](https://app.daytona.io/dashboard/sandboxes)
2. Click <Button>Create Sandbox</Button>
3. Enter an <Button>Image</Button> <br /> (e.g. **`rocm/vllm:rocm10.0.0_ubuntu24.04_py3.14_pytorch_2.12.0_vllm_0.27.0`**)
4. Set <Button>GPU</Button> to the number of GPU units (e.g. **`1`**)
5. Select <Button>GPU Type</Button>: **`MI355X`**


```python
from daytona import Daytona, CreateSandboxFromImageParams, Resources, GpuType

daytona = Daytona()
sandbox = daytona.create(
    CreateSandboxFromImageParams(
        image="rocm/vllm:rocm10.0.0_ubuntu24.04_py3.14_pytorch_2.12.0_vllm_0.27.0",
        auto_delete_interval=0,
        resources=Resources(
            gpu=1,
            gpu_type=[GpuType.MI355X],
        ),
    )
)
```


```typescript
import { Daytona, GpuType } from '@daytona/sdk'

const daytona = new Daytona()
const sandbox = await daytona.create({
  image: 'rocm/vllm:rocm10.0.0_ubuntu24.04_py3.14_pytorch_2.12.0_vllm_0.27.0',
  autoDeleteInterval: 0,
  resources: {
    gpu: 1,
    gpuType: [GpuType.MI355X],
  },
})
```


```ruby
require 'daytona'

daytona = Daytona::Daytona.new
sandbox = daytona.create(
  Daytona::CreateSandboxFromImageParams.new(
    image: 'rocm/vllm:rocm10.0.0_ubuntu24.04_py3.14_pytorch_2.12.0_vllm_0.27.0',
    auto_delete_interval: 0,
    resources: Daytona::Resources.new(
      gpu: 1,
      gpu_type: [Daytona::GpuType::MI355X]
    )
  )
)
```


```go
package main

import (
	"context"

	"github.com/daytona/clients/sdk-go/pkg/daytona"
	"github.com/daytona/clients/sdk-go/pkg/types"
)

func main() {
	client, _ := daytona.NewClient()
	ctx := context.Background()
	autoDelete := 0
	_, _ = client.Create(ctx, types.ImageParams{
		Image: "rocm/vllm:rocm10.0.0_ubuntu24.04_py3.14_pytorch_2.12.0_vllm_0.27.0",
		SandboxBaseParams: types.SandboxBaseParams{
			AutoDeleteInterval: &autoDelete,
		},
		Resources: &types.Resources{
			GPU:     1,
			GpuType: []types.GpuType{types.GpuTypeMI355X},
		},
	})
}
```


```java
import io.daytona.sdk.Daytona;
import io.daytona.sdk.Sandbox;
import io.daytona.sdk.model.CreateSandboxFromImageParams;
import io.daytona.sdk.model.Resources;
import io.daytona.api.client.model.GpuType;
import java.util.List;

public class App {
    public static void main(String[] args) {
        try (Daytona daytona = new Daytona()) {
            CreateSandboxFromImageParams params = new CreateSandboxFromImageParams();
            params.setImage("rocm/vllm:rocm10.0.0_ubuntu24.04_py3.14_pytorch_2.12.0_vllm_0.27.0");
            params.setAutoDeleteInterval(0);
            Resources resources = new Resources();
            resources.setGpu(1);
            resources.setGpuType(List.of(GpuType.MI355X));
            params.setResources(resources);
            Sandbox sandbox = daytona.create(params);
        }
    }
}
```


```bash
curl 'https://app.daytona.io/api/sandbox' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data '{
  "buildInfo": {
    "dockerfileContent": "FROM rocm/vllm:rocm10.0.0_ubuntu24.04_py3.14_pytorch_2.12.0_vllm_0.27.0\n"
  },
  "autoDeleteInterval": 0,
  "gpu": 1,
  "gpuType": ["MI355X"]
}'
```


## Spot

Spot GPU sandboxes are preemptible and run on GPU capacity that is not being used by reserved (on-demand) sandboxes. They support the same GPU types, unit counts, and resource limits as on-demand GPU sandboxes. 

A spot GPU sandbox can be terminated at any time without notice when an on-demand GPU sandbox needs the capacity. Daytona does not send a preemption warning or a dedicated preemption webhook. Design workloads to tolerate immediate interruption.

When a spot GPU sandbox is destroyed, normal [sandbox lifecycle state](#lifecycle) updates still apply. Daytona records when the preemption occurred with a `spotEvictedAt` timestamp. Sandboxes destroyed by spot GPU preemption remain retrievable for 24 hours.

Spot GPU sandboxes require Tier 2 or higher. Spot GPU sandboxes do not count against the organization's GPU quota. Available GPU capacity is the only limit. If no spot GPU is available, create fails immediately.


```python
from daytona import Daytona, CreateSandboxFromImageParams, Resources, GpuType

daytona = Daytona()
sandbox = daytona.create(
    CreateSandboxFromImageParams(
        image="pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime",
        auto_delete_interval=0,
        spot=True,
        resources=Resources(gpu=1, gpu_type=GpuType.H100),
    )
)
```


```typescript
import { Daytona, GpuType } from '@daytona/sdk'

const daytona = new Daytona()
const sandbox = await daytona.create({
  image: 'pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime',
  autoDeleteInterval: 0,
  spot: true,
  resources: {
    gpu: 1,
    gpuType: GpuType.H100,
  },
})
```


```ruby
require 'daytona'

daytona = Daytona::Daytona.new
sandbox = daytona.create(
  Daytona::CreateSandboxFromImageParams.new(
    image: 'pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime',
    auto_delete_interval: 0,
    spot: true,
    resources: Daytona::Resources.new(gpu: 1, gpu_type: Daytona::GpuType::H100)
  )
)
```


```go
package main

import (
	"context"

	"github.com/daytona/clients/sdk-go/pkg/daytona"
	"github.com/daytona/clients/sdk-go/pkg/types"
)

func main() {
	client, _ := daytona.NewClient()
	ctx := context.Background()
	autoDelete := 0
	_, _ = client.Create(ctx, types.ImageParams{
		Image: "pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime",
		SandboxBaseParams: types.SandboxBaseParams{
			AutoDeleteInterval: &autoDelete,
			Spot:               true,
		},
		Resources: &types.Resources{
			GPU:     1,
			GpuType: []types.GpuType{types.GpuTypeH100},
		},
	})
}
```


```java
import io.daytona.sdk.Daytona;
import io.daytona.sdk.Sandbox;
import io.daytona.sdk.model.CreateSandboxFromImageParams;
import io.daytona.sdk.model.Resources;
import io.daytona.api.client.model.GpuType;
import java.util.List;

public class App {
    public static void main(String[] args) {
        try (Daytona daytona = new Daytona()) {
            CreateSandboxFromImageParams params = new CreateSandboxFromImageParams();
            params.setImage("pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime");
            params.setAutoDeleteInterval(0);
            params.setSpot(true);
            Resources resources = new Resources();
            resources.setGpu(1);
            resources.setGpuType(List.of(GpuType.H100));
            params.setResources(resources);
            Sandbox sandbox = daytona.create(params);
        }
    }
}
```


```bash
curl 'https://app.daytona.io/api/sandbox' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data '{
  "buildInfo": {
    "dockerfileContent": "FROM pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime\n"
  },
  "autoDeleteInterval": 0,
  "spot": true,
  "gpu": 1,
  "gpuType": ["H100"]
}'
```


## GPU allocation

A create request sets the number of GPU units and the GPU type. Daytona places the sandbox on capacity with that many free units of the requested type. With an ordered list of types, Daytona uses the first type in the list that has capacity. If a request sets no GPU type, Daytona places the sandbox on an NVIDIA GPU. To get an AMD GPU, request the MI355X type explicitly.

If no GPU capacity is available, an on-demand GPU sandbox waits in the **Pending Build** state until capacity frees up. A [spot](#spot) GPU sandbox fails instead.

### Regions

GPU sandboxes on shared regions run in the [earth region](https://www.daytona.io/docs/en/regions.md#earth-region). Daytona selects the shared region, ignores the requested target, and reports the earth region as the sandbox target. GPU sandboxes on [dedicated](https://www.daytona.io/docs/en/regions.md#dedicated-regions) and [custom](https://www.daytona.io/docs/en/regions.md#custom-regions) regions keep their real region ID. To run GPU sandboxes in a specific geographic location, contact [support@daytona.io](mailto:support@daytona.io).

### Credits

On-demand GPU sandboxes require GPU credits. Spot GPU sandboxes require GPU credits or spot GPU credits. To add credits, go to the **Wallet** page in the [Daytona Dashboard ↗](https://app.daytona.io/dashboard/).

### GPU capacity

Get the available GPU capacity. The response lists available GPU units by GPU type, split into on-demand and spot. Capacity is aggregated across all shared regions in the [earth region](https://www.daytona.io/docs/en/regions.md#earth-region) region and changes as sandboxes are created and deleted. The response does not reserve capacity and does not apply the organization's GPU quota. On-demand GPU sandboxes remain subject to the quota. Spot GPU sandboxes are limited only by available capacity.


```bash
curl 'https://app.daytona.io/api/organizations/{organizationId}/gpu-capacity' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```


```json
{
  "observedAt": "2026-09-14T17:31:05.412Z",
  "capacity": [
    { "gpuType": "H100", "availableOnDemand": 12, "availableSpot": 4 },
    { "gpuType": "H200", "availableOnDemand": 0, "availableSpot": 0 },
    { "gpuType": "RTX-PRO-6000", "availableOnDemand": 6, "availableSpot": 6 }
  ]
}
```

| **Field**               | **Description**                                                                                                     |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------- |
| **`observedAt`**        | Time Daytona calculated the capacity. Responses are cached for up to five seconds.                                  |
| **`capacity`**          | One entry for each GPU type.                                                                                        |
| **`gpuType`**           | The GPU type.                                                                |
| **`availableOnDemand`** | GPU units available to on-demand GPU sandboxes. Includes units held by spot GPU sandboxes that Daytona can reclaim. |
| **`availableSpot`**     | GPU units free for spot GPU sandboxes.                                                                              |

## Resources

A GPU sandbox has up to **8** GPU units. If a GPU create request omits CPU, memory, or disk, Daytona applies the following defaults. The defaults are per sandbox and do not scale with the number of GPU units. A GPU sandbox created from a snapshot uses the snapshot's resources. The default GPU snapshot has 1 GPU unit, 1 vCPU, 1 GiB memory, and 1 GiB disk.

| **Resource** | **Default** |
| ------------ | ----------- |
| vCPU         | 16          |
| Memory       | 192 GiB     |
| Disk         | 512 GiB     |

## Filesystem persistence

Filesystem persistence keeps the contents of a sandbox's disk: files, installed packages, cloned repositories, and build artifacts. A sandbox with a preserved filesystem starts with its environment intact, with nothing to reinstall or rebuild.

GPU sandboxes are ephemeral: stop deletes the sandbox and its filesystem. To keep results, mount a [volume](https://www.daytona.io/docs/en/volumes.md) and write to the mount path. The volume and its data remain after the sandbox is deleted, and any other sandbox can mount the same volume.


```python
from daytona import Daytona, CreateSandboxFromSnapshotParams, VolumeMount

daytona = Daytona()
volume = daytona.volume.get("gpu-results", create=True)

# Mount the volume in the GPU sandbox
sandbox = daytona.create(
    CreateSandboxFromSnapshotParams(
        snapshot="daytona-gpu",
        auto_delete_interval=0,
        volumes=[VolumeMount(volume_id=volume.id, mount_path="/home/daytona/results")],
    )
)

# Write results to the volume
sandbox.fs.upload_file(b"done", "/home/daytona/results/output.txt")

# Stop deletes the sandbox; the volume keeps the results
sandbox.stop()
```


```typescript
import { Daytona } from '@daytona/sdk'

const daytona = new Daytona()
const volume = await daytona.volume.get('gpu-results', true)

// Mount the volume in the GPU sandbox
const sandbox = await daytona.create({
  snapshot: 'daytona-gpu',
  autoDeleteInterval: 0,
  volumes: [{ volumeId: volume.id, mountPath: '/home/daytona/results' }],
})

// Write results to the volume
await sandbox.fs.uploadFile(Buffer.from('done'), '/home/daytona/results/output.txt')

// Stop deletes the sandbox; the volume keeps the results
await sandbox.stop()
```


```ruby
require 'daytona'

daytona = Daytona::Daytona.new
volume = daytona.volume.get('gpu-results', create: true)

# Mount the volume in the GPU sandbox
sandbox = daytona.create(
  Daytona::CreateSandboxFromSnapshotParams.new(
    snapshot: 'daytona-gpu',
    auto_delete_interval: 0,
    volumes: [DaytonaApiClient::SandboxVolume.new(volume_id: volume.id, mount_path: '/home/daytona/results')]
  )
)

# Write results to the volume
sandbox.fs.upload_file('done', '/home/daytona/results/output.txt')

# Stop deletes the sandbox; the volume keeps the results
sandbox.stop
```


```go
package main

import (
	"context"

	"github.com/daytona/clients/sdk-go/pkg/daytona"
	"github.com/daytona/clients/sdk-go/pkg/types"
)

func main() {
	client, _ := daytona.NewClient()
	ctx := context.Background()

	volume, err := client.Volume.Get(ctx, "gpu-results")
	if err != nil {
		volume, err = client.Volume.Create(ctx, "gpu-results")
		if err != nil {
			panic(err)
		}
	}

	// Mount the volume in the GPU sandbox
	autoDelete := 0
	sandbox, err := client.Create(ctx, types.SnapshotParams{
		Snapshot: "daytona-gpu",
		SandboxBaseParams: types.SandboxBaseParams{
			AutoDeleteInterval: &autoDelete,
			Volumes: []types.VolumeMount{
				{VolumeID: volume.ID, MountPath: "/home/daytona/results"},
			},
		},
	})
	if err != nil {
		panic(err)
	}

	// Write results to the volume
	if err := sandbox.FileSystem.UploadFile(ctx, []byte("done"), "/home/daytona/results/output.txt"); err != nil {
		panic(err)
	}

	// Stop deletes the sandbox; the volume keeps the results
	if err := sandbox.Stop(ctx); err != nil {
		panic(err)
	}
}
```


```java
import io.daytona.sdk.Daytona;
import io.daytona.sdk.Sandbox;
import io.daytona.sdk.exception.DaytonaNotFoundException;
import io.daytona.sdk.model.CreateSandboxFromSnapshotParams;
import io.daytona.sdk.model.Volume;
import io.daytona.sdk.model.VolumeMount;

import java.util.Collections;

public class App {
    public static void main(String[] args) {
        try (Daytona daytona = new Daytona()) {
            Volume volume;
            try {
                volume = daytona.volume().getByName("gpu-results");
            } catch (DaytonaNotFoundException e) {
                volume = daytona.volume().create("gpu-results");
            }

            // Mount the volume in the GPU sandbox
            VolumeMount mount = new VolumeMount();
            mount.setVolumeId(volume.getId());
            mount.setMountPath("/home/daytona/results");

            CreateSandboxFromSnapshotParams params = new CreateSandboxFromSnapshotParams();
            params.setSnapshot("daytona-gpu");
            params.setAutoDeleteInterval(0);
            params.setVolumes(Collections.singletonList(mount));
            Sandbox sandbox = daytona.create(params);

            // Write results to the volume
            sandbox.fs.uploadFile("done".getBytes(), "/home/daytona/results/output.txt");

            // Stop deletes the sandbox; the volume keeps the results
            sandbox.stop();
        }
    }
}
```


```bash
daytona volume create gpu-results

# Mount the volume in the GPU sandbox
daytona create --snapshot daytona-gpu --auto-delete 0 --volume gpu-results:/home/daytona/results

# Write results to the volume
daytona exec [SANDBOX_ID] -- sh -c 'echo done > /home/daytona/results/output.txt'

# Stop deletes the sandbox; the volume keeps the results
daytona stop [SANDBOX_ID]
```


```bash
# Mount the volume in the GPU sandbox
curl 'https://app.daytona.io/api/sandbox' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data '{
  "snapshot": "daytona-gpu",
  "autoDeleteInterval": 0,
  "volumes": [
    { "volumeId": "{volumeId}", "mountPath": "/home/daytona/results" }
  ]
}'

# Write results to the volume
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/files/upload-v2?path=/home/daytona/results/output.txt' \
  --request POST \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --form 'file=@output.txt'

# Stop deletes the sandbox; the volume keeps the results
curl 'https://app.daytona.io/api/sandbox/{sandboxId}/stop' \
  --request POST \
  --header 'Authorization: Bearer YOUR_API_KEY'
```


## Memory persistence

Memory persistence keeps the runtime state of a sandbox: running processes, open connections, and everything loaded in RAM. A sandbox with preserved memory continues from the point it was frozen, with processes still running, instead of starting from a clean boot.

GPU sandboxes do not preserve memory. Stop deletes the sandbox, and pause, memory snapshots, and forks are not supported. To keep results, write them to a volume before the sandbox stops, as shown in [filesystem persistence](#filesystem-persistence).

## Lifecycle

Every GPU sandbox moves through a lifecycle. A GPU sandbox can have several different states. Each state reflects the status of your sandbox. A GPU sandbox transitions between states in response to user actions, or automatically when one of its [timeouts](#timeouts) elapses.

<SandboxDiagram variant="gpu" />

| **Feature**                | **Ephemeral** |
| -------------------------- | ------------- |
| **Stop and start**         | ✗             |
| **Pause and resume**       | ✗             |
| **Fork**                   | ✗             |
| **Archive**                | ✗             |
| **Delete**      | ✓             |
| **Filesystem persistence** | ✗             |
| **Memory persistence**     | ✗             |
| **Memory snapshot**        | ✗             |
| **Filesystem snapshot**    | ✗             |
| **Spot (preemption)** | ✓         |

<Collapsible title="Sandbox states">

| **State**             | **Description**                                                                      |
| --------------------- | ------------------------------------------------------------------------------------ |
| **Pending Build**     | The sandbox waits for GPU capacity or for the build to start.                        |
| **Building Snapshot** | The sandbox is building a snapshot from an image.                                    |
| **Pulling Snapshot**  | The sandbox is pulling a snapshot.                             |
| **Creating**          | The sandbox is being created.                                                        |
| **Starting**          | The sandbox is starting.                                                             |
| **Started**           | The sandbox is running and accepts requests.                                         |
| **Deleting**          | The sandbox is being deleted.                                                        |
| **Deleted**           | The sandbox is deleted.                                                              |
| **Error**             | The sandbox hit an error.                                                            |

</Collapsible>

<Collapsible title="State transitions">

| **Initial state**     | **Target state**      | **Trigger**                                                                  |
| --------------------- | --------------------- | ---------------------------------------------------------------------------- |
| **Pending Build**     | **Building Snapshot** | The queued build starts.                                                     |
| **Building Snapshot** | **Creating**          | The snapshot finishes building.                                              |
| **Pulling Snapshot**  | **Creating**          | The snapshot is available.                                                   |
| **Creating**          | **Started**           | The sandbox finishes starting.                                               |
| **Started**           | **Deleting**          | A stop or delete is requested, the auto-stop interval or TTL elapses, or Daytona preempts a spot sandbox. |
| **Deleting**          | **Deleted**           | The sandbox is removed and its GPUs are released.                            |

</Collapsible>

### Delete

Delete a sandbox.

:::note
By default delete is fire-and-forget: it returns as soon as the API accepts the deletion request, without waiting for the sandbox to be destroyed. Pass the `wait` flag to block until the sandbox reaches the destroyed state.
:::


```python
sandbox.delete()

# Block until the sandbox is deleted
sandbox.delete(timeout=60, wait=True)
```


```typescript
await sandbox.delete()

// Block until the sandbox is deleted
await sandbox.delete(60, true)
```


```ruby
sandbox.delete

# Block until the sandbox is deleted
sandbox.delete(60, wait: true)
```


```go
err = sandbox.Delete(ctx)

// Block until the sandbox is deleted
err = sandbox.DeleteAndWait(ctx, 60*time.Second)
```


```java
sandbox.delete();

// Block until the sandbox is deleted
sandbox.delete(60, true);
```


```bash
daytona delete [SANDBOX_ID] | [SANDBOX_NAME]
```


```bash
curl 'https://app.daytona.io/api/sandbox/{sandboxIdOrName}' \
  --request DELETE \
  --header 'Authorization: Bearer YOUR_API_KEY'
```


### Timeouts

Two intervals end a GPU sandbox automatically. Each interval is set in minutes.

- [Auto-stop](https://www.daytona.io/docs/en/sandboxes.md#auto-stop-interval) stops the sandbox after inactivity. A stopped GPU sandbox is deleted. The default is **`15`** minutes, and **`0`** disables it.
- [Wall-clock TTL](https://www.daytona.io/docs/en/sandboxes.md#wall-clock-ttl) deletes the sandbox at a fixed deadline, whether or not it is active.


```python
sandbox = daytona.create(CreateSandboxFromSnapshotParams(
    snapshot="daytona-gpu",
    auto_delete_interval=0,
    auto_stop_interval=30,
    ttl_minutes=240,
))
```


```typescript
const sandbox = await daytona.create({
  snapshot: 'daytona-gpu',
  autoDeleteInterval: 0,
  autoStopInterval: 30,
  ttlMinutes: 240,
})
```


```ruby
sandbox = daytona.create(
  Daytona::CreateSandboxFromSnapshotParams.new(
    snapshot: 'daytona-gpu',
    auto_delete_interval: 0,
    auto_stop_interval: 30,
    ttl_minutes: 240
  )
)
```


```go
autoDelete := 0
autoStop := 30
ttlMinutes := 240
sandbox, err := client.Create(ctx, types.SnapshotParams{
	Snapshot: "daytona-gpu",
	SandboxBaseParams: types.SandboxBaseParams{
		AutoDeleteInterval: &autoDelete,
		AutoStopInterval:   &autoStop,
		TtlMinutes:         &ttlMinutes,
	},
})
```


```java
CreateSandboxFromSnapshotParams params = new CreateSandboxFromSnapshotParams();
params.setSnapshot("daytona-gpu");
params.setAutoDeleteInterval(0);
params.setAutoStopInterval(30);
params.setTtlMinutes(240);
Sandbox sandbox = daytona.create(params);
```


```bash
curl 'https://app.daytona.io/api/sandbox' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data '{
  "snapshot": "daytona-gpu",
  "autoDeleteInterval": 0,
  "autoStopInterval": 30,
  "ttlMinutes": 240
}'
```