Skip to content
Latchkey

How to Use a Cloud GPU Runner in GitHub Actions

A cloud GPU runner is provisioned on demand for a single job and destroyed after, so you pay for GPU time only while the workflow runs.

Point runs-on at a runner group or label backed by a GPU instance type. Providers such as ephemeral runner controllers boot a GPU VM per job, run your steps, then terminate it.

Steps

  • Configure a runner group or label mapped to a GPU instance type.
  • Reference that label in runs-on.
  • Keep the job short so the GPU VM lifetime, and the bill, stays small.

Workflow

.github/workflows/ci.yml
jobs:
  gpu-test:
    runs-on: gpu-a10g
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v4
      - run: nvidia-smi
      - run: python -m pytest tests/gpu -q

Gotchas

  • GPU instances cost several times a CPU runner; add a timeout-minutes so a hang cannot run for hours.
  • Cold-boot time counts against the job; cache the container image on the instance where possible.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →