Using the GPU execution environment

Last updated
Tags Cloud

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: ubuntu-2004-cuda-11.4:202110-01
    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.

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: ubuntu-2004-cuda-11.4:202110-01
    resource_class: gpu.nvidia.small
    steps:
      - run: nvidia-smi
Class vCPUs RAM GPUs GPU model GPU Memory (GiB) Disk Size (GiB)
gpu.nvidia.small 4 15 1 Nvidia Tesla P4 8 300
gpu.nvidia.medium 8 30 1 Nvidia Tesla T4 16 300
gpu.nvidia.large 8 30 1 Nvidia Tesla V100 16 300

Note: These resources require review by our support team. Open a support ticket if you would like to request access.

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)
windows.gpu.nvidia.medium 16 60 1 Nvidia Tesla T4 16 200

Note: These resources require review by our support team. Open a support ticket if you would like to request access.

GPUs on server v2.x

If you are using CircleCI server v2.x, you can configure your VM service to use GPU-enabled machine executors. See Running GPU Executors in Server.



Help make this document better

This guide, as well as the rest of our docs, are open source and available on GitHub. We welcome your contributions.

Need support?

Our support engineers are available to help with service issues, billing, or account related questions, and can help troubleshoot build configurations. Contact our support engineers by opening a ticket.

You can also visit our support site to find support articles, community forums, and training resources.