[Yandex Cloud documentation](../../../index.md) > [Yandex Compute Cloud](../../index.md) > [Step-by-step guides](../index.md) > GPU clusters > Creating a GPU cluster

# Creating a GPU cluster


{% note info %}

By default, a [cloud](../../../resource-manager/concepts/resources-hierarchy.md#cloud) has a zero [quota](../../concepts/limits.md#compute-quotas) for creating GPU clusters. To change the [quota](https://console.yandex.cloud/cloud?section=quotas), contact [support](https://center.yandex.cloud/support).

{% endnote %}

This section explains how to create a GPU cluster. Currently, GPU clusters can only be created in the `ru-central1-a` and `ru-central1-d` [availability zones](../../../overview/concepts/geo-scope.md).

After creating a cluster, you can [add](gpu-add-to-cluster.md) [VMs](../../concepts/vm.md) from the same availability zone to it.

{% list tabs group=instructions %}

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the [CLI](../../../cli/index.md) command for creating a GPU cluster:

     ```bash
     yc compute gpu-cluster create --help
     ```

     Note that currently, you can only create GPU clusters with the `infiniband` interconnect type.
  1. Create a GPU cluster in the default availability zone:

     ```bash
     yc compute gpu-cluster create --interconnect-type infiniband
     ```

- Terraform {#tf}

  If you do not have Terraform yet, [install it and configure the Yandex Cloud provider](../../../tutorials/infrastructure-management/terraform-quickstart.md#install-terraform).
  
  
  To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), [authenticate](../../../terraform/authentication.md) using the appropriate method.

  1. In the Terraform configuration file, describe the resource you want to create:

     ```hcl
     provider "yandex" {
       zone = "ru-central1-a"
     }

     resource "yandex_compute_gpu_cluster" "default" {
       name               = "<GPU_cluster_name>"
       interconnect_type  = "<interconnect_type>"
       zone               = "ru-central1-a"
       labels             = {
         <label_1_key> = "<label_1_value>"
         <label_2_key> = "<label_2_value>"
       }
     }
     ```

     Where:
     * `name`: GPU cluster name. This is a required setting.
     * `interconnect_type`: Interconnect type. Currently, you can only create GPU clusters with the `infiniband` interconnect type. This is a required setting.
     * `labels`: Resource [label](../../../resource-manager/concepts/labels.md) in `<key> = "<value>"` format. This is an optional setting.

     For more information about the `yandex_compute_gpu_cluster` resource properties, see [this Terraform provider guide](../../../terraform/resources/compute_gpu_cluster.md).
  1. Create the resources:

     1. In the terminal, navigate to the configuration file directory.
     1. Make sure the configuration is correct using this command:
     
        ```bash
        terraform validate
        ```
     
        If the configuration is valid, you will get this message:
     
        ```bash
        Success! The configuration is valid.
        ```
     
     1. Run this command:
     
        ```bash
        terraform plan
        ```
     
        You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
     1. Apply the configuration changes:
     
        ```bash
        terraform apply
        ```
     
     1. Type `yes` and press **Enter** to confirm the changes.

  This will create a GPU cluster in the specified [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder). You can check the new GPU cluster and its settings using the [management console](https://console.yandex.cloud) or this [CLI](../../../cli/index.md) command:

  ```bash
  yc compute gpu-cluster get <GPU_cluster_name>
  ```

{% endlist %}