Using the GPU execution environment

Language Icon 1 month ago · 6 min read
Cloud
Contribute Go to Code
Some Linux CUDA images have been deprecated. Refer to our Discuss post for the list of affected images.

You can run your jobs in the GPU execution environment, using either Windows or Linux virtual machines, for access to NVIDIA GPUs for specialized workloads.

To use the Linux GPU execution environment, use the machine executor and specify a GPU-enabled image. For a full list of machine executor images see the CircleCI Developer Hub or the Configuration Reference.

version: 2.1

jobs:
  build:
    machine:
      image: linux-cuda-12:default
      resource_class: gpu.nvidia.medium
    steps:
      - run: nvidia-smi

To use the Windows GPU execution environment, you can either choose to use the Windows orb and specify the built-in GPU executor, or use the machine executor and specify a Windows GPU-enabled image. Refer to the Orb Registry page for full details, and the Developer Hub for full details of available machine executor images.

  • Windows GPU with orb

  • Windows GPU with machine

version: 2.1

orbs:
  win: circleci/windows@4.1.1

jobs:
  build:
    executor: win/server-2019-cuda
    steps:
      - run: '&"C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe"'
version: 2.1

jobs:
  build:
    machine:
      image: windows-server-2019-nvidia:stable
    steps:
      - run: '&"C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe"'

Available resource classes

Specify a resource class to fit your project and requirements. For further details on credit usage for these options, see the Resource Class pricing and plans page.

Linux GPU

version: 2.1

jobs:
  build:
    machine:
      image: linux-cuda-12:default
    resource_class: gpu.nvidia.medium
    steps:
      - run: nvidia-smi
Class vCPUs RAM GPUs GPU model GPU Memory (GiB) Disk Size (GiB) Cloud Server

gpu.nvidia.small

4

16

1

NVIDIA Tesla P4

16

150

check icon

cancel icon

gpu.nvidia.small.gen2

4

16

1

NVIDIA A10G

24

150

check icon

cancel icon

gpu.nvidia.small.multi

4

15

2

NVIDIA Tesla T4

16

150

check icon

cancel icon

gpu.nvidia.medium.multi

8

30

4

NVIDIA Tesla T4

16

150

check icon

cancel icon

gpu.nvidia.medium

8

30

1

NVIDIA Tesla T4

16

150

check icon

cancel icon

gpu.nvidia.large

8

30

1

NVIDIA Tesla V100

16

150

check icon

cancel icon

Windows GPU

For Windows there is currently one resource class option. This will be used by default so you are not required to specify it in your configuration.

Class vCPUs RAM GPUs GPU model GPU Memory (GiB) Disk Size (GiB) Cloud Server

windows.gpu.nvidia.medium

16

60

1

NVIDIA Tesla T4

16

200

check icon

cancel icon

View resource usage

To view the compute resource usage for the duration of a job in the CircleCI web app:

  1. Select Dashboard from the sidebar menu.

  2. Use the dropdown menus to select a project and a branch.

  3. Expand your workflow.

  4. Select a job by clicking on the job name.

  5. Select the Resources tab to view CPU and RAM usage for the duration of the job.

You can use these insights to decide whether to make changes to the job’s configured resource class.

Resources tab