> For the complete documentation index, see [llms.txt](https://circleci.com/docs/llms.txt)

# Using the GPU execution environment

Some Linux CUDA images have been deprecated. Refer to our [Discuss post](https://discuss.circleci.com/t/linux-cuda-deprecation-and-image-policy/48568) 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](https://circleci.com/developer/images?imageType=machine) or the [Configuration Reference](https://circleci.com/docs/reference/configuration-reference/#available-linux-gpu-images).

```yaml
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. Alternatively, use the machine executor and specify a Windows GPU-enabled image. Refer to the [Orb Registry page](https://circleci.com/developer/orbs/orb/circleci/windows) for full details, and the [Developer Hub](https://circleci.com/developer/images?imageType=machine) for full details of available machine executor images.

<Tabs>
<Tab title="Windows GPU with orb">

```yaml
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"'
```

</Tab>
<Tab title="Windows GPU with machine">

```yaml
version: 2.1

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

</Tab>
</Tabs>

## 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](https://circleci.com/product/features/resource-classes/).

### Linux GPU

```yaml
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 | **Yes** | **No** |
| `gpu.nvidia.small.gen2` | 4 | 16 | 1 | NVIDIA A10G | 24 | 150 | **Yes** | **No** |
| `gpu.nvidia.small.multi` | 4 | 15 | 2 | NVIDIA Tesla T4 | 16 | 150 | **Yes** | **No** |
| `gpu.nvidia.medium.multi` | 8 | 30 | 4 | NVIDIA Tesla T4 | 16 | 150 | **Yes** | **No** |
| `gpu.nvidia.medium` | 8 | 30 | 1 | NVIDIA Tesla T4 | 16 | 150 | **Yes** | **No** |
| `gpu.nvidia.large` | 8 | 30 | 1 | NVIDIA Tesla V100 | 16 | 150 | **Yes** | **No** |

### 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 | **Yes** | **No** |

### View resource usage

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

1.  In the [CircleCI web app](https://app.circleci.com), select your org from the org cards on your user homepage.
    
2.  Select **Pipelines** from the sidebar and locate your pipeline from the list. You can use the project, branch, date, and status search options to help.
    
3.  Select the job you want to access by selecting the job name.
    
4.  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.

> **Image:** Resources tab

Figure 1. Resources tab in web app for a job