Compute Engine provides graphics processing units (GPUs) that you can add to your virtual machines (VMs). You can use these GPUs to accelerate specific workloads on your VMs such as machine learning and data processing.
This document provides an overview of the steps required for creating a VM with attached GPUs.
Select the GPU model
For a list of GPU models that are available, see GPU platforms. Also make a note of the machine type that is supported for the selected GPU model.
For each model, it might also be helpful to review the following:
- Supported region and zones.
- GPU pricing to understand the cost to use each GPU model on your VMs. For VMs that use accelerator-optimized machines, also review VM instance pricing.
- Review the restrictions for VMs with GPUs.
Choose an operating system
If you are using GPUs for machine learning, you can use a Deep Learning VM Images for your VM. Each Deep Learning VM Images has a GPU driver pre-installed and include packages, such as TensorFlow and PyTorch. You can also use a Deep Learning VM Images for general GPU workloads. For information about the images available and the packages installed on the images, see Choosing an image. You can also use any public image or custom image, but some images might require a unique driver or install process that is not covered in this document.
You must identify which drivers are appropriate for your OS image. For steps to install drivers, see installing GPU drivers.
Check GPU quota
To protect Compute Engine systems and users, new projects have a global GPU quota, which limits the total number of GPUs you can create in any supported zone. To review GPU quota, see GPU quota.
If you need additional GPU quota, request a quota increase. When you request GPU quota, you must request quota for the GPU types that you want to create in each region and an additional global quota for the total number of GPUs of all types in all zones.
If your project has an established billing history, it will receive quota automatically after you submit the request.
Create a VM that has attached GPUs
To create a VM that has attached GPUs, complete the following steps:
Create the VM. The method used to create a VM depends on the GPU model selected.