> ## Documentation Index
> Fetch the complete documentation index at: https://docs.beam.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# GPU Acceleration

## Running Tasks on GPU

You can run any code on a cloud GPU by passing a `gpu` argument in your function decorator.

```python theme={null}
from beam import endpoint


@endpoint(gpu="A10G")
def handler():
    # Prints the available GPU drivers
    import subprocess
    print(subprocess.check_output(["nvidia-smi"], shell=True))

    return {"gpu":"true"}
```

### Available GPUs

GPU availability changes as fleet capacity is added. These GPU types are currently available serverless:

* `T4` (16Gi)
* `A10G` (24Gi)
* `RTX4090` (24Gi)
* `RTX5090` (32Gi)

Additional GPU types (`H100`, `H200`, `A100-80`, `L40S`, `A6000`, and more) are available as dedicated on-demand machines, which you can reserve with `beam machine reserve --gpu <type>`.

### Check GPU Availability

Run `beam machine list` to see live serverless availability and on-demand pricing for every GPU type.

```bash theme={null}
$ beam machine list

=> GPU inventory

  GPU          Serverless    On-demand
 ──────────────────────────────────────
  A10G         ● ready               —
  A100-80      —              $1.49/hr
  H100         —              $3.63/hr
  RTX4090      ● ready        $0.66/hr
  RTX5090      ● available           —
  T4           ● available           —
  ...
```

## Prioritizing GPU Types

You can split traffic across multiple GPUs by passing a list to the `gpu` parameter.

The list is ordered by priority. You can choose which GPUs to prioritize by specifying them at the front of the list.

```python theme={null}
gpu=["T4", "A10G", "RTX4090"]
```

In this example, the `T4` is prioritized over the `A10G`, followed by the `RTX4090`.

## Using Multiple GPUs

You can run workloads across multiple GPUs by using the `gpu_count` parameter.

<Warning>
  This feature is available *by request only*. Please send us a message in
  Slack, and we'll enable it on your account.
</Warning>

```python theme={null}
from beam import endpoint


@endpoint(gpu="A10G", gpu_count=2)
def handler():
    return {"hello": "world"}
```

## GPU Regions

Beam runs on servers distributed around the world, with primary locations in the United States, Europe, and Asia. If you would like your workloads to run in a specific region of the globe, [please reach out](https://join.slack.com/t/beam-cloud/shared_invite/zt-3enuvj3r7-OeAzVPYvyqQHy9avNrLL0w).
