Overview of creating an instance with attached GPUs

Linux Windows

This document provides an overview of the steps required to create aCompute Engine instance with attached graphics processing units (GPUs).You can use GPUs to accelerate specific workloads, such as machine learning anddata processing.

You can also use some GPU machine types onAI Hypercomputer. AI Hypercomputer is asupercomputing system that is optimized to support your artificial intelligence(AI) and machine learning (ML) workloads. This option is recommended for creating adensely allocated, performance-optimized infrastructure that has integrationsfor Google Kubernetes Engine (GKE) and Slurm schedulers.

For more information about GPUs on Compute Engine, seeAbout GPUs.

Select the GPU model

For a list of GPU models that are available, seeGPU platforms. Also make a note of the machine type that issupported for the selected GPU model.

For each model, it might also be helpful to review the following:

Limitations

In addition to therestrictions for all instances with GPUs,each machine series with attached GPUs has the following limitations:

A4X instances

A4 instances

  • You can only request capacity by using thesupported consumption optionsfor an A4 machine type.
  • You don't receivesustaineduse discounts andflexible committed usediscounts for instances that use an A4 machine type.
  • You can only use an A4 machine type in certainregionsand zones.
  • You can't usePersistent Disk (regional or zonal) on an instance that uses an A4 machine type.
  • The A4 machine type is only available on theEmerald Rapids CPU platform.
  • You can't change the machine type of an existing instance to an A4 machine type. You can only create new A4 instances. After creating an instance using an A4 machine type, you can't change the machine type.
  • A4 machine types don't supportsole-tenancy.
  • You can't run Windows operating systems on an A4 machine type.

A3 Ultra instances

  • You can only request capacity by using thesupported consumption optionsfor an A3 Ultra machine type.
  • You don't receivesustaineduse discounts andflexible committed usediscounts for instances that use an A3 Ultra machine type.
  • You can only use an A3 Ultra machine type in certainregionsand zones.
  • You can't usePersistent Disk (regional or zonal) on an instance that uses an A3 Ultra machine type.
  • The A3 Ultra machine type is only available on theEmerald Rapids CPU platform.
  • You can't change the machine type of an existing instance to an A3 Ultra machine type. You can only create new A3-ultra instances. After creating an instance using an A3 Ultra machine type, you can't change the machine type.
  • You can't run Windows operating systems on an A3 Ultra machine type.
  • A3 Ultra machine types don't supportsole-tenancy.

A3 Mega instances

  • You can only request capacity by using thesupported consumption optionsfor an A3 Mega machine type.
  • You don't receivesustaineduse discounts andflexible committed usediscounts for instances that use an A3 Mega machine type.
  • You can only use an A3 Mega machine type in certainregionsand zones.
  • You can't useregional Persistent Disk on an instance that uses an A3 Mega machine type.
  • The A3 Mega machine type is only available on theSapphire Rapids CPU platform.
  • You can't change the machine type of an existing instance to an A3 Mega machine type. You can only create new A3-mega instances. After creating an instance using an A3 Mega machine type, you can't change the machine type.
  • You can't run Windows operating systems on an A3 Mega machine type.

A3 High instances

A3 Edge instances

  • You can only request capacity by using thesupported consumption optionsfor an A3 Edge machine type.
  • You don't receivesustaineduse discounts andflexible committed usediscounts for instances that use an A3 Edge machine type.
  • You can only use an A3 Edge machine type in certainregionsand zones.
  • You can't useregional Persistent Disk on an instance that uses an A3 Edge machine type.
  • The A3 Edge machine type is only available on theSapphire Rapids CPU platform.
  • You can't change the machine type of an existing instance to an A3 Edge machine type. You can only create new A3-edge instances. After creating an instance using an A3 Edge machine type, you can't change the machine type.
  • You can't run Windows operating systems on an A3 Edge machine type.
  • A3 Edge machine types don't supportsole-tenancy.

A2 Standard instances

  • You can only request capacity by using thesupported consumption optionsfor an A2 Standard machine type.
  • You don't receivesustaineduse discounts andflexible committed usediscounts for instances that use an A2 Standard machine type.
  • You can only use an A2 Standard machine type in certainregionsand zones.
  • The A2 Standard machine type is only available on theCascade Lake platform.
  • If your instance uses an A2 Standard machine type, you can only switch from one A2 Standard machine typetype to another A2 Standard machine type. You can't change to any other machine type.For more information, seeModify accelerator-optimized instances.
  • You can't use the Windows operating system with thea2-megagpu-16g machine type.When using a Windows operating system, choose a different A2 Standard machine type.
  • You can't do a quick format of the attached Local SSDs on Windows instances that use A2 Standard machine types.To format these Local SSDs, you must do a full format by using thediskpartutility and specifyingformat fs=ntfs label=tmpfs.

A2 Ultra instances

  • You can only request capacity by using thesupported consumption optionsfor an A2 Ultra machine type.
  • You don't receivesustaineduse discounts andflexible committed usediscounts for instances that use an A2 Ultra machine type.
  • You can only use an A2 Ultra machine type in certainregionsand zones.
  • The A2 Ultra machine type is only available on theCascade Lake platform.
  • If your instance uses an A2 Ultra machine type, you can't change the machine type.If you need to use a different A2 Ultra machine type, or any other machine type, you must create anew instance.
  • You can't change any other machine type to an A2 Ultra machine type. If you need ainstance that uses an A2 Ultra machine type, you must create a new instance.
  • You can't do a quick format of the attached Local SSDs on Windows instances that use A2 Ultramachine types. To format these Local SSDs, you must do a full format by using thediskpartutility and specifyingformat fs=ntfs label=tmpfs.

G4 instances

G2 instances

  • You can only request capacity by using thesupported consumption optionsfor a G2 machine type.
  • You don't receivesustaineduse discounts andflexible committed usediscounts for instances that use a G2 machine type.
  • You can only use a G2 machine type in certainregionsand zones.
  • The G2 machine type is only available on theCascade Lake platform.
  • Standard Persistent Disk (pd-standard) isn't supported on instances that use theG2 machine type. For supported disk types, seeSupported disk types for G2.
  • You can't createMulti-InstanceGPUs on an instance that uses a G2 machine type.
  • If you need to change the machine type of a G2 instance, reviewModify accelerator-optmized instances.
  • You can't useDeep Learning VM Images as boot disksfor instances that use the G2 machine type.
  • The current default driver for Container-Optimized OS doesn't support L4 GPUs running onG2 machine types. Also, Container-Optimized OS only supports a select set of drivers.If you want to use Container-Optimized OS on G2 machine types, review the following notes:
    • Use a Container-Optimized OS version that supports the minimum recommended NVIDIA driver version525.60.13 or later. For more information, review theContainer-Optimized OS release notes.
    • When youinstall the driver, specify the latest available version that works for the L4 GPUs. For example,sudo cos-extensions install gpu -- -version=525.60.13.
  • You must use the Google Cloud CLI or REST tocreate G2 instancesfor the following scenarios:
    • You want to specify custom memory values.
    • You want to customize the number of visible CPU cores.

N1+GPU instances

To learn about the limitations for N1 instances with GPUs, seefeatures for the N1 machine seriesandGPUs for the N1 machine series.

Choose an operating system

If you are using GPUs for machine learning, use one of the followingoperating systems:

  • Images optimized for AI workloads. You can use Ubuntu and Rocky images,which are available in accelerator-optimized versions with NVIDIA driversand CUDA Toolkit pre-installed. SeeOS imagesin the AI Hypercomputer documentation.

  • Deep Learning VM Images. Each Deep Learning VM has a GPU driverinstallation tool and includes packages such as TensorFlow and PyTorch. Youcan also use a Deep Learning VM for general GPU workloads. To learnmore about available images and packages installed on these images,seeChoosing an image in theDeep Learning VM documentation.

    Caution: You can't useDeep Learning VM Imageson boot disks for your VMs that use G2 machine types. G2 machinetypes are accelerator-optimized machine series that have NVIDIA L4 GPUs attached.

Alternatively, you can use a public or custom image. For mostpublic images orcustom images, you need to install NVIDIAdrivers and CUDA Toolkit. To help identify which drivers are appropriate foryour GPU model, seeinstalling GPU drivers.

Check GPU quota

To protect Compute Engine systems and users, new projects havea global GPU quota, which limits the total number of GPUs you can createin any supported zone. To review GPU quota, seeGPU quota.

Note: Some regions might display quotas even though GPUs are notcurrently available in that region. Ensure that the region that you arerequesting quotas for support GPUs. For a list of regions with GPUs, seeGPUs regions and zone availability.

If you need additional GPU quota,request a quota increase.When you request GPU quota, you must request quota for the GPU types that youwant to create in each region and an additional global quota for the total numberof GPUs of all types in all zones.

If your project has an established billing history, it will receive quotaautomatically after you submit the request.

GPU instances and preemptible allocation quotas

Instances that use thestandard provisioning modeltypically can't usepreemptible allocation quotas. Preemptible quotas are fortemporary workloads and are usually more available. If your project doesn't havepreemptible quota, and you have never requested it, then all instances in yourproject consume standard allocation quotas.

If you request preemptible allocation quota, then instances that use the standardprovisioning model must meet all of the following criteria to consumepreemptible allocation quota:

When you consume preemptible allocation for time-bound GPU workloads, you canbenefit from both uninterrupted run time and the high obtainability ofpreemptible allocation quota. For more information, seePreemptible quotas.

Create an instance that has attached GPUs

To create an instance that has attached GPUs, complete the following steps:

  1. Create the instance. The method used to create an instance depends on theworkload that you want to run.

    GPU machine types
    AI and ML workloadsGraphics and visualizationOther GPU workloads
    Accelerator-optimized A series machine types are designed for highperformance computing (HPC), artificial intelligence (AI), and machinelearning (ML) workloads.

    For these machine types, the GPU model is automatically attached to the instance.

    Accelerator-optimized G series machine types are designed for workloadssuch as NVIDIA Omniverse simulation workloads, graphics-intensive applications,video transcoding, and virtual desktops. These machine types supportNVIDIA RTX Virtual Workstations (vWS).

    The G series can also be used for training smaller models and forsingle-host inference.

    For these machine types, the GPU model is automatically attached to the instance.

    For N1 general-purpose machine types, except for the N1 shared-core(f1-micro andg1-small), you can attach a selectset of GPU models. Some of these GPU models also support NVIDIA RTX VirtualWorkstations (vWS).

    For AI, ML, and HPC workloads, choose one of the following options:

    To create a G2 (L4) or G4 (RTX PRO 6000) instance, seeCreate a G2or G4 instance.To create an N1 instance that has attached NVIDIA T4, P4, P100,or V100 GPUs, seeCreate an N1instance that has attached GPUs.
  2. For the instance to use the GPU, you need toinstall the GPU driver on your instance.If you enabled an NVIDIA RTX virtual workstation (formerly known as NVIDIA GRID),install a driver for virtual workstation.

What's next?

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.