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

# GPU job

> Demo: gpu function

Source: `demo/gpu/app.py` in the repository.

The same `@job`, placed on a GPU worker. Needs a pool with GPUs: on the Levers AI Lab cluster that is the
L40S Spot pool, elsewhere a GPU box joined with the agent or a cloud pool. Without any GPU worker the task stays
pending until one joins.

```bash theme={null}
cd demo/gpu

# see what GPU capacity the cluster has
levers9 machine list
levers9 pool list
levers9 worker list

# run a 4096×4096 matmul on the first available of RTXPro6000, A10G, T4
python app.py
# {"device": "cuda", "gpu": "NVIDIA RTX PRO 6000 Blackwell..., 98304 MiB", "n": 4096, "seconds": 0.02}

# add a GPU machine (on that machine)
levers9 machine create --pool rtxpro6000       # writes the join command to ~/.levers9/machines/ID.sh: run it on the box
```

Notes

* `gpu=["RTXPro6000", "A10G", "T4"]` is a preference order; `gpu_count` asks for more than one.
* The blueprint installs `torch` once and is cached; the first run builds it, later runs start in seconds.
* Available GPU names: `T4`, `L4`, `A10G`, `L40S`, `A100-40`, `A100-80`, `H100`, `RTXPro6000`, `H200`.
* The dashboard's **Workers** page shows GPU workers and their utilisation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.