A RetroSearch Logo

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

Search Query:

Showing content from https://developers.google.com/compute/docs/gpus/add-remove-gpus below:

Add or remove GPUs | Compute Engine Documentation

Skip to main content Add or remove GPUs

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

Linux Windows

Compute Engine provides graphics processing units (GPUs) that you can add to your virtual machine (VM) instances. You can use these GPUs to accelerate specific workloads on your VMs such as machine learning and data processing.

You can only use two machine families when running GPUs on Compute Engine:

Before you begin Accelerator-optimized VMs

Each accelerator-optimized machine type has a specific model of NVIDIA GPUs attached. If you have graphics-intensive workloads, such as 3D visualization, you can also create virtual workstations that use NVIDIA RTX Virtual Workstations (vWS). NVIDIA RTX Virtual Workstation is available for some GPU models.

Machine type GPU model NVIDIA RTX Virtual Workstation (vWS) model A4X NVIDIA GB200 Grace Blackwell Superchips (nvidia-gb200).

Each Superchip contains four NVIDIA B200 Blackwell GPUs.

A4 NVIDIA B200 Blackwell GPUs (nvidia-b200) A3 Ultra NVIDIA H200 SXM GPUs (nvidia-h200-141gb) A3 Mega NVIDIA H100 SXM GPUs (nvidia-h100-mega-80gb) A3 High, A3 Edge NVIDIA H100 SXM GPUs (nvidia-h100-80gb) A2 Ultra NVIDIA A100 80GB GPUs (nvidia-a100-80gb) A2 Standard NVIDIA A100 40GB GPUs (nvidia-a100-40gb) G4 (Preview) NVIDIA RTX PRO 6000 Blackwell Server Edition (nvidia-rtx-pro-6000) G2 NVIDIA L4 GPUs (nvidia-l4) NVIDIA L4 Virtual Workstation GPUs (nvidia-l4-vws)

You can modify each accelerator-optimized VM as follows:

Modify the GPU count

You can modify the GPU count of an A2 standard or G2 accelerator-optimized VM by using either the Google Cloud console, or REST.

Console

You can modify the number of GPUs for your VM by stopping the VM and editing the VM configuration.

  1. Verify that all of your critical applications are stopped on the VM.

  2. In the Google Cloud console, go to the VM instances page to see your list of VMs.

    Go to VM instances

  3. Click the name of the VM that you want to modify the number of GPUs for. The Details page opens.

  4. Complete the following steps from the Details page.

    1. If the VM is running, click stop Stop to stop the VM. If there is no Stop option, click more_vert More actions > stop Stop.

    2. Click edit Edit.

    3. In the Machine configuration section, select the GPUs machine family, and then do the following:

      1. In the Number of GPUs list, increase or decrease the GPU count.

        Note: Each accelerator-optimized machine type has a specific number of GPUs attached. If you adjust the number of GPUs, the machine type changes.
    4. To apply your changes, click Save.

    5. To restart the VM, click Start/Resume.

REST

You can modify the number of GPUs on your VM by stopping the VM and changing the machine type. Each accelerator-optimized machine type has a specific number of GPUs attached. If you change the machine type, this adjusts the number of GPUs that are attached to the VM.

  1. Verify that all of your critical applications are stopped on the VM, and then create a POST command to stop the VM so it can move to a host system where GPUs are available.

    POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/stop
    
  2. After the VM stops, create a POST request to modify the machine type.

    POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/setMachineType
    
    {
       machineType: "zones/ZONE/machineTypes/MACHINE_TYPE"
    }
    
  3. Start the VM.

    POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/start
    

Replace the following:

Limitations A2 VMs G2 VMs N1-general purpose VMs

This section covers how to add, modify, or remove GPUs from a N1-general purpose machine.

In summary, the process to add, modify, or remove GPUs from an existing VM is as follows:

  1. Check that your VM has a boot disk size of at least 40 GB.
  2. Stop the VM.
  3. Add, modify, or remove the GPUs.

    If your VM didn't have GPUs attached before, you need to complete the following steps:

    1. Prepare your VM for the modification.
    2. Modify the host maintenance setting for the VM. VMs with GPUs cannot live migrate because they are assigned to specific hardware devices. For more information, see GPU restrictions.
    3. Change the machine type. GPUs are only supported on select machine types.
    4. Install a GPU driver on your VM, so that your system can use the device.
Prepare your VM

When a GPU is added to a VM, the order of the network interface can change.

Most public images on Compute Engine don't have persistent network interface names and adjust to the new order.

However, if you are using either SLES or a custom image, you must update the system setting to prevent the network interface from persisting. To prevent the network interface from persisting, run the following command on your VM:

 rm /etc/udev/rules.d/70-persistent-net.rules 
Add GPUs or modify GPU type on existing VMs

This section covers how to add GPUs, or modify the GPU type on an existing N1 general-purpose VMs. This procedure supports the following GPU types:

NVIDIA GPUs:

NVIDIA RTX Virtual Workstation (vWS) (formerly known as NVIDIA GRID):

Console

To add GPUs or modify the GPU type, complete the following steps.

  1. Verify that all of your critical applications are stopped on the VM.

  2. In the Google Cloud console, go to the VM instances page to see your list of VMs.

    Go to VM instances

  3. Click the name of the VM that you want to update. The Details page opens.

  4. Complete the following steps from the Details page.

    1. If the VM is running, click stop Stop. If there is no Stop option, click more_vert More actions > stop Stop.

    2. Click edit Edit.

    3. In the Machine configuration section, select the GPUs machine family, and then do the following:

      1. In the GPU type list, select or switch to any of the GPU types supported on N1 VMs.

      2. In the Number of GPUs list, select the number of GPUs.

      3. If your GPU model supports NVIDIA RTX Virtual Workstations (vWS) for graphics workloads, and you plan on running graphics-intensive workloads on this VM, select Enable Virtual Workstation (NVIDIA GRID).

    4. If your VM didn't have GPUs attached before, complete the following:

      1. If the VM has a shared-core machine type, you must change the machine type. In the Machine type list, select one of the preset N1 machine types. Alternatively, you can also specify custom machine type settings.

      2. In the Management section, complete the following:

        1. In the On host maintenance list, select Terminate VM instance. VMs with attached GPUs can't live migrate. See Handle GPU host events.

        2. In the Automatic restart list, select On.

    5. To apply your changes, click Save.

    6. To restart the VM, click Start/Resume.

REST

You can add or modify GPUs on your VM by stopping the VM and changing your VM's configuration through the API.

  1. Verify that all of your critical applications are stopped on the VM and then create a POST command to stop the VM so it can move to a host system where GPUs are available.

    POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/stop
    
  2. If your VM didn't have GPUs attached before, complete the following steps:

    1. Identify the GPU type that you want to add to your VM. You can submit a GET request to list the GPU types that are available to your project in a specific zone.

      GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/acceleratorTypes
      
    2. If the VM has a shared-core machine type, you must change the machine type to have one or more vCPUs. You cannot add accelerators to VMs with shared-core machine types.

    3. Create a POST command to set the scheduling options for the VM.

      POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/setScheduling
      
      {
      "onHostMaintenance": "TERMINATE",
      "automaticRestart": true
      }
      
  3. Create a POST request to add or modify the GPUs that are attached to your VM.

    POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/setMachineResources
    
        {
         "guestAccelerators": [
          {
            "acceleratorCount": ACCELERATOR_COUNT,
            "acceleratorType": "https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/acceleratorTypes/ACCELERATOR_TYPE"
          }
         ]
        }
    
  4. Start the VM.

    POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/start
    

    Replace the following:

Install drivers

To install the drivers, choose one of the following options:

Remove GPUs

This section covers how to remove the following GPU types from an existing N1 general-purpose VM.

NVIDIA GPUs:

NVIDIA RTX Virtual Workstation (vWS) (formerly known as NVIDIA GRID):

You can use the Google Cloud console to remove GPUs from an existing VM. To remove GPUs, complete the following steps:

  1. Verify that all of your critical applications are stopped on the VM.

  2. In the Google Cloud console, go to the VM instances page to see your list of VMs.

    Go to VM instances

  3. Click the name of the VM that you want to remove GPUs from. The Details page opens.

  4. Complete the following steps from the Details page.

    1. If the VM is running, click stop Stop to stop the VM. If there is no Stop option, click more_vert More actions > stop Stop.

    2. On the toolbar, click edit Edit.

    3. In the Machine configuration section, select the General purpose machine family, and then do the following:

      1. To view attached GPUs, expand Advanced configurations.

      2. In the GPUs section, remove GPUs using one of the following options:

        • To remove some GPUs, in the Number of GPUs list, select a new number.

        • To remove all GPUs, click delete Delete GPU.

    4. Optional: Modify the VM host maintenance policy setting. VMs with GPUs must have the host maintenance policy set to Terminate VM instance. But if you removed all GPUs, you have the option to live migrate this VM during host maintenance. For more information, see Set VM host maintenance policy.

    5. To apply your changes, click Save.

    6. To restart the VM, click Start/Resume.

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-11 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-11 UTC."],[[["Compute Engine allows the addition of GPUs to virtual machines (VMs) to accelerate workloads like machine learning and data processing, utilizing accelerator-optimized (A3, A2, G2) or N1 general-purpose machine families."],["Accelerator-optimized VMs, including A3, A2, and G2 types, have specific NVIDIA GPU models attached, such as H100, A100, and L4, with varying capabilities and options for modifying GPU counts or machine types within their respective families."],["Modifying GPU counts on A2 Standard and G2 VMs can be done via the Google Cloud console or REST API by stopping the VM and adjusting the machine type or GPU number, but removing GPUs from accelerator-optimized machines often requires creating a new VM or changing to a different machine family."],["N1 general-purpose VMs can have various NVIDIA GPU models added, modified, or removed, requiring the VM to be stopped, potentially needing a machine type change if it was shared-core, and adjustment of host maintenance settings to \"Terminate VM instance\" due to GPU limitations."],["Before modifying or adding GPUs, it is important to verify that critical applications are stopped, to install the correct GPU drivers after any changes, and to be aware of the specific limitations and requirements for different machine types and GPU models, including operating system compatibility, discounts, and supported features."]]],[]]


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