quickstart →

GPU runners for GitHub Actions: options, pricing and setup

Run GitHub Actions jobs on a GPU: GitHub's T4 runner and its limits, self-hosted GPU runners, and EC2 GPU runners with RunsOn, with prices and examples.

Standard GitHub-hosted runners have no GPU, so a job that trains a model, runs CUDA kernels, or tests a GPU code path needs a different runner. There are three ways to get one:

OptionGPUsPlansPrice per minute
GitHub GPU larger runner1× NVIDIA Tesla T4 (16 GB)Team, Enterprise Cloud$0.052 on Linux, $0.102 on Windows
Self-hosted runner on your own GPU machineWhatever you ownAnyYour hardware
RunsOn on EC2, in your AWS accountT4, A10G, L4, L40S, A100, H100, H200…Any, including FreeFrom $0.0039 (T4, 4 vCPUs, 16 GB of RAM, spot), plus a license

GitHub’s GPU runner#

GitHub offers one GPU size as a larger runner: 4 vCPUs, 28 GB of RAM, 176 GB of SSD and one NVIDIA Tesla T4 with 16 GB of VRAM, on Ubuntu or Windows. To set it up, an organization admin creates a new GitHub-hosted runner, picks a GPU-optimized image (NVIDIA’s image from the Partner tab, with the drivers installed) and a size from the GPU-powered tab, then jobs target it by name:

.github/workflows/ci.yml
jobs:
cuda-tests:
runs-on: linux-gpu-t4 # the name given to the runner
steps:
- uses: actions/checkout@v7
- run: nvidia-smi
- run: make test-cuda

What to know before choosing it:

  • Team or Enterprise Cloud only, with a payment method on file. It’s billed like the other larger runners: see who can use them for how your plan’s included compute applies.
  • One GPU, one model. The T4 is a 2018 inference card: fine for CUDA unit tests and small models, slow for training anything sizeable, and there’s no multi-GPU size.
  • At most 100 concurrent GPU jobs, one of GitHub’s concurrency limits.
  • Slower to start. GitHub keeps smaller warm pools for larger runners than for standard ones, so a job can wait while GitHub creates a VM, especially the first job after a quiet spell.
  • Price: at $0.052 a minute on Linux ($0.102 on Windows), a 30-minute nightly job costs about $47 a month ($92 on Windows), before included compute.

For an Apple GPU rather than an NVIDIA one, GitHub lists 8 GPU cores of hardware acceleration for its M2 macOS larger runner (macos-latest-xlarge), which jobs select by label with no setup: see larger runners.

Self-hosted GPU runners#

Any machine with an NVIDIA GPU, the driver and the runner application can run GPU jobs. Register it with a label such as gpu and target runs-on: [self-hosted, linux, gpu]. Install the NVIDIA Container Toolkit too if jobs use containers (docker run --gpus all).

A job that runs in a container needs the same flag, passed through container.options. This holds on any runner with the toolkit, RunsOn’s GPU images included:

.github/workflows/ci.yml
jobs:
cuda-tests:
runs-on: [self-hosted, linux, gpu]
container:
image: nvidia/cuda:12.6.3-runtime-ubuntu24.04
options: --gpus all
steps:
- run: nvidia-smi

Self-hosting is the cheapest route for a GPU workstation you already own. On cloud GPUs it’s often the most expensive one: a GPU instance left running between jobs costs dollars an hour while idle, so you need ephemeral runners that start per job and stop afterwards. Ephemeral or not, GitHub advises against self-hosted runners on public repositories, because a fork pull request can run its own workflow on them. If you must, take these precautions.

GPU runners with RunsOn#

RunsOn starts an EC2 instance in your AWS account for each job and terminates it when the job ends, so no GPU instance sits idle between jobs. Pick the GPU instance and a GPU image (NVIDIA driver, CUDA toolkit and container toolkit preinstalled) in the label:

.github/workflows/ci.yml
jobs:
cuda-tests:
runs-on: runs-on=${{ github.run_id }}/family=g4dn.xlarge/image=ubuntu24-gpu-x64
steps:
- uses: actions/checkout@v7
- run: nvidia-smi
- run: make test-cuda

RunsOn uses spot instances by default and falls back to on-demand when spot has no capacity. A job that AWS interrupts is rerun automatically, at most twice. That’s fine for test jobs, but for a long training run that can’t resume from a checkpoint, add /spot=false to the label to get an on-demand instance. A label that names a single instance type can also fail to launch when AWS has no capacity for it: allowing a second size of the same GPU, as in family=g4dn.xlarge+g4dn.2xlarge, makes that less likely.

Typical GPU runners in us-east-1, with their 7-day average spot price and their on-demand price (instance plus disk):

RunnerInstanceSpot / minOn-demand / min
4cpu·T4g4dn.xlarge$0.0039$0.0091
8cpu·T4g4dn.2xlarge$0.0050$0.013
16cpu·A10Gg5.4xlarge$0.013$0.027
48cpu·4×T4g4dn.12xlarge$0.021$0.066

These prices don’t include RunsOn’s flat yearly license, which is free for non-commercial use (see pricing).

Larger cards (L4 on g6, L40S on g6e) work the same way, if your AWS account has the quota for them. GPU quotas start at zero in new accounts, so request them before the first job. The 8-GPU A100, H100 and H200 machines, such as p4d.24xlarge and p5.48xlarge, connect their GPUs through NVSwitch and need NVIDIA Fabric Manager, which RunsOn’s GPU images don’t include as of November 2026: run them from a custom image that installs it. See GPU runners in the docs for images, quotas and examples.

GPU runners also take longer to start than CPU ones: GPU images are large, and the driver is slow to initialize on a cold boot. A stopped warm pool skips that first boot, but pool instances are always on-demand, so jobs that use one pay the on-demand price.

Running GPU tests without wasting GPU minutes#

A GPU minute costs several times a CPU minute, so keep the GPU job small:

.github/workflows/ci.yml
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
schedule:
- cron: "0 3 * * *" # nightly full run
jobs:
cpu-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: pytest -m "not gpu"
gpu-tests:
needs: cpu-tests # don't pay for a GPU if the cheap tests fail
if: |
github.event_name == 'schedule' ||
github.event.label.name == 'gpu' ||
(github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'gpu'))
runs-on: runs-on=${{ github.run_id }}/family=g4dn.xlarge/image=ubuntu24-gpu-x64
timeout-minutes: 60
steps:
- uses: actions/checkout@v7
- run: nvidia-smi
- run: pytest -m gpu
  • Run CPU tests first and the GPU job only after they pass (needs).
  • Run the full GPU suite nightly, and on pull requests only when asked: adding a gpu label starts a run (labeled in types), and other labels rerun only the CPU tests. The CPU job has no if on purpose: a skipped job reports success, even when it’s a required check. The label stays on the pull request, so later pushes run the GPU job again. Remove it when you’re done.
  • On a public repository, the label limits cost, not access. A fork pull request runs its own copy of the workflow, so its author can remove the if: and reach your GPU runner without the label, and by default GitHub asks for approval only for first-time contributors. To review every outside contributor’s run first, set fork pull request approval to Require approval for all external contributors.
  • Set timeout-minutes so a hung kernel doesn’t burn the default 6 hours.
  • Compile on a CPU runner: nvcc and wheel builds need the CUDA toolkit, not a GPU. Build in a cheap job, upload the result as an artifact, and have the GPU job only download and test it.
  • Build and cache Docker images outside the GPU job, and keep model weights close to it. Downloading a 10 GB model costs GPU minutes on every run, and so does restoring it from the cache, where the model alone fills the 10 GB a repository gets for free. On RunsOn, the opt-in Magic Cache serves actions/cache from S3 in the runner’s region, with no size cap, and a sticky disk or a custom image keeps the weights on disk with no download.
  • Check that the GPU is there before running anything expensive: nvidia-smi fails fast when the driver or the device is missing.