gpu parameter on @app.queue, @app.api, or @app.task to choose the hardware a resource runs on. You can use a short name, a GPU pool, an exact device, or a list of these.
gpu or cpu, the resource can run on any GPU.
How GPU strings are matched
The SDK resolves a string in this order and raises an error listing the valid options if nothing matches:"any", which allows every GPU.- A pool ID such as
"ADA_24"(case-insensitive). - An exact device name such as
"NVIDIA B200", or its enum name such as"NVIDIA_B200". - A fragment of a device name, such as
"4090","B200", or"h100". Every device whose name contains the fragment matches, so"H100"selects all three H100 variants.
Serverless endpoints (queue and API resources) select hardware by pool. If you pass an exact device, the endpoint uses that device’s pool, so workers can run on any GPU in the same pool. Tasks run on Pods, which select by device.
GPU pools
Userunpod.GpuGroup to request any GPU in a pool.
GPU types
Userunpod.GpuType to request one exact device.
Choose a GPU
- For development, use
GpuGroup.ANYor a list of several pools so workers start quickly even when one GPU type is scarce. - For production, pin a specific pool or device so performance and cost are predictable.
- For multiple GPUs per worker, combine
gpuwithgpu_count, for examplegpu="H100", gpu_count=4. - For a minimum driver version, set
min_cuda_version, for examplemin_cuda_version="12.8".
Next steps
- Run on CPUs when you don’t need a GPU.
- See every resource parameter.