A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/compute/docs/gpus/create-gpu-vm-accelerator-optimized below:

Create an A3, A2, or G2 VM | Compute Engine Documentation

Skip to main content Create an A3, A2, or G2 VM

Stay organized with collections Save and categorize content based on your preferences.

Linux Windows

This document explains how to create a VM that uses a machine type from the A3 High, A3 Mega, A3 Edge, A2, and G2 machine series. To learn more about creating VMs with attached GPUs, see Overview of creating an instance with attached GPUs.

Tip: When provisioning A3 Ultra machine types, you must reserve capacity to create instances or clusters, use Spot VMs, or create a resize request in a MIG. For more information about the parameters to set when creating an A3 Ultra instance, see Create an A3 Ultra or A4 instance. Before you begin Required roles

To get the permissions that you need to create VMs, ask your administrator to grant you the Compute Instance Admin (v1) (roles/compute.instanceAdmin.v1) IAM role on the project. For more information about granting roles, see Manage access to projects, folders, and organizations.

This predefined role contains the permissions required to create VMs. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to create VMs:

You might also be able to get these permissions with custom roles or other predefined roles.

Create a VM that has attached GPUs

You can create an A3 High, A3 Mega, A3 Edge, A2, or G2 accelerator-optimized VM by using the Google Cloud console, Google Cloud CLI, or REST.

To make some customizations to your G2 VMs, you might need to use the Google Cloud CLI or REST. See G2 limitations.

Console
  1. In the Google Cloud console, go to the Create an instance page.

    Go to Create an instance

  2. Specify a Name for your VM. See Resource naming convention.

  3. Select a region and zone where GPUs are available. See the list of available GPU regions and zones.

  4. In the Machine configuration section, select the GPUs machine family.

    1. Complete one of the following steps to select either a predefined or custom machine type based on the machine series:

      • For all GPU machine series, you can select a predefined machine type as follows:

        1. In the GPU type list, select your GPU type.

          • For A3 High, A3 Mega, or A3 Edge accelerator-optimized VMs, select NVIDIA H100 80GB, or NVIDIA H100 80GB MEGA.
          • For A2 accelerator-optimized VMs, select either NVIDIA A100 40GB or NVIDIA A100 80GB.
          • For G2 accelerator-optimized VMs, select NVIDIA L4.
        2. In the Number of GPUs list, select the number of GPUs.

          Note: Each accelerator-optimized machine type has a fixed number of GPUs attached. If you adjust the number of GPUs, the machine type changes.
      • For the G2 machine series, you can select a custom machine type as follows:

        1. In the GPU type list, select NVIDIA L4.
        2. In the Machine type section, select Custom.
        3. To specify the number of vCPUs and the amount of memory for the instance, drag the sliders or enter the values in the text boxes. The console displays an estimated cost for the instance as you change the number of vCPUs and memory.
    2. Optional: The G2 machine series supports NVIDIA RTX Virtual Workstations (vWS) for graphics workloads. If you plan on running graphics-intensive workloads on your G2 VM, select Enable Virtual Workstation (NVIDIA GRID).

  5. In the Boot disk section, click Change. This opens the Boot disk configuration page.

  6. On the Boot disk configuration page, do the following:

    1. On the Public images tab, choose a supported Compute Engine image or Deep Learning VM Images.
    2. Specify a boot disk size of at least 40 GB.
    3. To confirm your boot disk options, click Select.
  7. Optional: Configure provisioning model. For example, if your workload is fault-tolerant and can withstand possible VM preemption, consider using Spot VMs to reduce the cost of your VMs and the attached GPUs. For more information, see GPUs on Spot VMs. To do this, complete the following steps:

    1. In the Availability policies section, select Spot from the VM provisioning model list. This setting disables automatic restart and host maintenance options for the VM.
    2. Optional: In the On VM termination list, select what happens when Compute Engine preempts the VM:
      • To stop the VM during preemption, select Stop (default).
      • To delete the VM during preemption, select Delete.
  8. To create and start the VM, click Create.

gcloud

To create and start a VM, use the gcloud compute instances create command with the following flags. VMs with GPUs can't live migrate, make sure that you set the --maintenance-policy=TERMINATE flag.

The following optional flags are shown in the sample command:

  gcloud compute instances create VM_NAME \
      --machine-type=MACHINE_TYPE \
      --zone=ZONE \
      --boot-disk-size=DISK_SIZE \
      --image=IMAGE \
      --image-project=IMAGE_PROJECT \
      --maintenance-policy=TERMINATE \
      [--provisioning-model=SPOT] \
      [--accelerator=type=nvidia-l4-vws,count=VWS_ACCELERATOR_COUNT]
  
Replace the following: REST

Send a POST request to the instances.insert method. VMs with GPUs can't live migrate, make sure you set the onHostMaintenance parameter to TERMINATE.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances
{
"machineType": "projects/PROJECT_ID/zones/ZONE/machineTypes/MACHINE_TYPE",
"disks":
[
  {
    "type": "PERSISTENT",
    "initializeParams":
    {
      "diskSizeGb": "DISK_SIZE",
      "sourceImage": "SOURCE_IMAGE_URI"
    },
    "boot": true
  }
],
"name": "VM_NAME",
"networkInterfaces":
[
  {
    "network": "projects/PROJECT_ID/global/networks/NETWORK"
  }
],
"scheduling":
{
  "onHostMaintenance": "terminate",
  ["automaticRestart": true]
},
}

Replace the following: Additional settings: Install drivers

For the VM to use the GPU, you need to Install the GPU driver on your VM.

Examples

In these examples, most of the VMs are created by using the Google Cloud CLI. However, you can also use either the Google Cloud console or REST to create these VMs.

The following examples show how to create VMs using the following images:

COS (A3 Edge/High)

You can create either a3-edgegpu-8g or a3-highgpu-8g VMs that have attached H100 GPUs by using Container-optimized (COS) images.

For detailed instructions on how to create these a3-edgegpu-8g or a3-highgpu-8gVMs that use Container-Optimized OS, see Create an A3 VM with GPUDirect-TCPX enabled.

Public OS image (G2)

You can create VMs that have attached GPUs that use either a public image that is available on Compute Engine or a custom image.

To create a VM using the most recent, non-deprecated image from the Rocky Linux 8 optimized for Google Cloud image family that uses the g2-standard-8 machine type and has an NVIDIA RTX Virtual Workstation, complete the following steps:

  1. Create the VM. In this example, optional flags such as boot disk type and size are also specified.

    gcloud compute instances create VM_NAME \
        --project=PROJECT_ID \
        --zone=ZONE \
        --machine-type=g2-standard-8  \
        --maintenance-policy=TERMINATE --restart-on-failure \
        --network-interface=nic-type=GVNIC \
        --accelerator=type=nvidia-l4-vws,count=1 \
        --image-family=rocky-linux-8-optimized-gcp \
        --image-project=rocky-linux-cloud \
        --boot-disk-size=200GB \
        --boot-disk-type=pd-ssd
    

    Replace the following:

  2. Install NVIDIA driver and CUDA. For NVIDIA L4 GPUs, CUDA version XX or higher is required.

DLVM image (A2)

Using DLVM images is the easiest way to get started because these images already have the NVIDIA drivers and CUDA libraries pre-installed.

These images also provide performance optimizations.

The following DLVM images are supported for NVIDIA A100:

For more information about the DLVM images that are available, and the packages installed on the images, see the Deep Learning VM documentation.

  1. Create a VM using the tf2-ent-2-3-cu110 image and the a2-highgpu-1g machine type. In this example, optional flags such as boot disk size and scope are specified.

    gcloud compute instances create VM_NAME \
       --project PROJECT_ID \
       --zone ZONE \
       --machine-type a2-highgpu-1g \
       --maintenance-policy TERMINATE \
       --image-family tf2-ent-2-3-cu110 \
       --image-project deeplearning-platform-release \
       --boot-disk-size 200GB \
       --metadata "install-nvidia-driver=True,proxy-mode=project_editors" \
       --scopes https://www.googleapis.com/auth/cloud-platform
    

    Replace the following:

  2. The preceding example command also generates a Vertex AI Workbench user-managed notebooks instance for the VM. To access the notebook, in the Google Cloud console, go to the Vertex AI Workbench > User-managed notebooks page.

    Go to the User-managed notebooks page

Multi-Instance GPU (A3 and A2 VMs only)

A Multi-Instance GPU partitions a single NVIDIA H100 or A100 GPU within the same VM into as many as seven independent GPU instances. They run simultaneously, each with its own memory, cache and streaming multiprocessors. This setup enables the NVIDIA H100 or A100 GPU to deliver guaranteed quality-of-service (QoS) at up to 7x higher utilization compared to earlier GPU models.

You can create up to seven Multi-instance GPUs. For A100 40GB GPUs, each Multi-instance GPU is allocated 5 GB of memory. With the A100 80GB and H100 80GB GPUs the allocated memory doubles to 10 GB each.

For more information about using Multi-Instance GPUs, see NVIDIA Multi-Instance GPU User Guide.

To create Multi-Instance GPUs, complete the following steps:

  1. Create an A3 High, A3 Mega, A3 Edge, or A2 accelerator-optimized VM.

  2. Enable NVIDIA GPU drivers.

    Pro Tip: You can skip this step by creating VMs with Deep Learning VM Images. Each Deep Learning VM Images has an NVIDIA GPU driver pre-installed.

  3. Enable Multi-Instance GPUs..

    sudo nvidia-smi -mig 1
    
  4. Review the Multi-Instance GPU shapes that are available.

    sudo nvidia-smi mig --list-gpu-instance-profiles
    

    The output is similar to the following:

    +-----------------------------------------------------------------------------+
    | GPU instance profiles:                                                      |
    | GPU   Name             ID    Instances   Memory     P2P    SM    DEC   ENC  |
    |                              Free/Total   GiB              CE    JPEG  OFA  |
    |=============================================================================|
    |   0  MIG 1g.10gb       19     7/7        9.62       No     16     1     0   |
    |                                                             1     1     0   |
    +-----------------------------------------------------------------------------+
    |   0  MIG 1g.10gb+me    20     1/1        9.62       No     16     1     0   |
    |                                                             1     1     1   |
    +-----------------------------------------------------------------------------+
    |   0  MIG 1g.20gb       15     4/4        19.50      No     26     1     0   |
    |                                                             1     1     0   |
    +-----------------------------------------------------------------------------+
    |   0  MIG 2g.20gb       14     3/3        19.50      No     32     2     0   |
    |                                                             2     2     0   |
    +-----------------------------------------------------------------------------+
    |   0  MIG 3g.40gb        9     2/2        39.25      No     60     3     0   |
    |                                                             3     3     0   |
    +-----------------------------------------------------------------------------+
    .......
    
  5. Create the Multi-Instance GPU (GI) and associated compute instances (CI) that you want. You can create these instances by specifying either the full or shortened profile name, profile ID, or a combination of both. For more information, see Creating GPU Instances.

    The following example creates two MIG 3g.20gb GPU instances by using the profile ID (9).

    The -C flag is also specified which creates the associated compute instances for the required profile.

    sudo nvidia-smi mig -cgi 9,9 -C
    
  6. Check that the two Multi-Instance GPUs are created:

    sudo nvidia-smi mig -lgi
    
  7. Check that both the GIs and corresponding CIs are created.

    sudo nvidia-smi
    

    The output is similar to the following:

    +-----------------------------------------------------------------------------+
    | NVIDIA-SMI 525.125.06   Driver Version: 525.125.06   CUDA Version: 12.0     |
    |-------------------------------+----------------------+----------------------+
    | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
    | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
    |                               |                      |               MIG M. |
    |===============================+======================+======================|
    |   0  NVIDIA H100 80G...  Off  | 00000000:04:00.0 Off |                   On |
    | N/A   33C    P0    70W / 700W |     39MiB / 81559MiB |     N/A      Default |
    |                               |                      |              Enabled |
    +-------------------------------+----------------------+----------------------+
    |   1  NVIDIA H100 80G...  Off  | 00000000:05:00.0 Off |                   On |
    | N/A   32C    P0    69W / 700W |     39MiB / 81559MiB |     N/A      Default |
    |                               |                      |              Enabled |
    +-------------------------------+----------------------+----------------------+
    ......
    
    +-----------------------------------------------------------------------------+
    | MIG devices:                                                                |
    +------------------+----------------------+-----------+-----------------------+
    | GPU  GI  CI  MIG |         Memory-Usage |        Vol|         Shared        |
    |      ID  ID  Dev |           BAR1-Usage | SM     Unc| CE  ENC  DEC  OFA  JPG|
    |                  |                      |        ECC|                       |
    |==================+======================+===========+=======================|
    |  0    1   0   0  |     19MiB / 40192MiB | 60      0 |  3   0    3    0    3 |
    |                  |      0MiB / 65535MiB |           |                       |
    +------------------+----------------------+-----------+-----------------------+
    |  0    2   0   1  |     19MiB / 40192MiB | 60      0 |  3   0    3    0    3 |
    |                  |      0MiB / 65535MiB |           |                       |
    +------------------+----------------------+-----------+-----------------------+
    ......
    
    +-----------------------------------------------------------------------------+
    | Processes:                                                                  |
    |  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
    |        ID   ID                                                   Usage      |
    |=============================================================================|
    |  No running processes found                                                 |
    +-----------------------------------------------------------------------------+
    
What's next?

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

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["This document details the process of creating a Virtual Machine (VM) that utilizes accelerator-optimized machine families, including A3, A2, and G2 machine series, for enhanced performance."],["Users can set up and authenticate their Google Cloud environment using the console, gcloud CLI, or REST API, with specific instructions for each method provided."],["Creating a VM with GPUs involves selecting a GPU type (NVIDIA H200, H100, A100, or L4), the number of GPUs, and configuring the boot disk with a minimum size of 40 GB, along with the option of using Spot VMs for cost reduction."],["The document outlines specific limitations and requirements for each accelerator-optimized machine type (A3 Ultra/Mega/High/Edge, A2 Ultra/Standard, G2), such as operating system compatibility, discount availability, and supported disk types, to help the user when selecting what is appropriate for their use."],["Multi-Instance GPU (MIG) setup is described for A3 and A2 VMs, allowing for the partitioning of a single GPU into multiple independent GPU instances, and instructions are provided on how to create VMs with various images such as Deep Learning VM Images, Container-Optimized OS images, and public OS images."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4