# Runtime environment

> The image, hardware, filesystem, environment variables and time limit every run starts with.

## Image

| Property | Value |
| --- | --- |
| Default image | `pytorch/pytorch:2.14.0-cuda12.6-cudnn9-runtime` |
| Includes | Python, PyTorch 2.14, CUDA 12.6, cuDNN 9 |
| Override | `--image <ref>`: any public image with `sh`, and `python` for a `.py` entrypoint |

Install other dependencies in the command:

```bash
div run -- 'pip install -r requirements.txt && python train.py'
```

`pip install` works without a virtual environment, because every run sets `PIP_BREAK_SYSTEM_PACKAGES=1`.

## Hardware

| `--gpu` | GPUs | Cores | Memory |
| --- | --- | --- | --- |
| `b300`, `h200`, `h100`, `l40s` | `--gpus` (default 1) | 1 per GPU | 8 GiB per GPU |
| `cpu` | none | 1 | 2 GiB |

Request more with `--cpu` (up to 64 cores) and `--memory` (up to 336 GiB). See [Container size](https://docs.divergentlabs.xyz/compute/cli/run.md#container-size) for prices. A run that exceeds its memory is killed.

## Filesystem

| Path | Contents | Kept after the run |
| --- | --- | --- |
| `/workspace` | a copy of the uploaded code. The command starts here. | no |
| `/mnt/<volume>` | each of the org's volumes | yes |
| `/tmp/divergent/result.json` | the run's [result](https://docs.divergentlabs.xyz/compute/cli/result.md) (`DIVERGENT_RESULT_PATH`) | as the result |
| `/tmp/divergent/telemetry.jsonl` | the run's [telemetry](https://docs.divergentlabs.xyz/compute/cli/telemetry.md) (`DIVERGENT_TELEMETRY_PATH`) | as telemetry |

With `--no-upload`, the command starts in the image's working directory.

Volumes are mounted when the run starts. A directory under `/mnt` that is not an existing volume is temporary, and its files are deleted when the run ends. `div run` creates any volume named as `/mnt/<volume>` in the command before the run starts. See [Keep data and checkpoints on a volume](https://docs.divergentlabs.xyz/compute/guides/volumes.md).

## Environment variables

If the same name is set by several sources, the later row wins.

| Source | Variables |
| --- | --- |
| Every run | `PIP_BREAK_SYSTEM_PACKAGES=1` |
| [Secrets](https://docs.divergentlabs.xyz/compute/cli/secrets.md) | every secret in the `default` environment whose products include `runs` |
| `--env` | each `KEY=value` passed |
| Every run | `DIVERGENT_RUN_ID`, `DIVERGENT_RUN_NAME`, `DIVERGENT_RESULT_PATH`, `DIVERGENT_TELEMETRY_PATH` |
| [Eval runs](https://docs.divergentlabs.xyz/compute/cli/eval.md#environment-variables-in-an-eval-run) | `DIVERGENT_MODEL`, `DIVERGENT_MODEL_VERSION_ID`, `DIVERGENT_MODEL_PATH`, `DIVERGENT_MODEL_DIGEST`, `DIVERGENT_EVALUATION` |

## Lifetime

The command runs under `sh -lc`. A run ends when:

- the command exits,
- you stop it with `div stop`,
- it reaches its `--max-spend` limit,
- the org reaches its usage limit or runs out of credit, or
- it has run for 24 hours.

`div run` exits with the command's exit code.
