> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Working with InfiniBand™ topology of a GPU cluster

[InfiniBand™ topology](/compute/clusters/gpu/topology) can help you increase performance of multi-VM jobs in GPU clusters.

## Prerequisites

<Tabs group="interfaces">
  <Tab title="CLI">
    [Install and configure](/cli/install) the Nebius AI Cloud CLI.
  </Tab>

  <Tab title="Go SDK">
    [Install and initialize the Nebius SDK for Go](/grpc-api/sdk/go).
  </Tab>

  <Tab title="Python SDK">
    [Install and initialize the Nebius SDK for Python](/grpc-api/sdk/python).
  </Tab>

  <Tab title="JavaScript SDK">
    [Install and initialize the Nebius SDK for JavaScript](/grpc-api/sdk/javascript).
  </Tab>
</Tabs>

## How to get InfiniBand™ topology of a GPU cluster

After you [create a GPU cluster and add VMs to it](/compute/clusters/gpu/index#how-to-enable-infiniband-for-vms-with-gpus), you can view the InfiniBand™ topology of this cluster and its VMs.

<Tabs>
  <Tab title="Cluster topology">
    To get the topology for all VMs in a GPU cluster:

    <Tabs group="interfaces">
      <Tab title="CLI">
        Run the following command:

        ```bash theme={null}
        nebius compute gpu-cluster get --id computegpucluster-***
        ```

        In the `--id` parameter, specify the GPU cluster ID.

        The output example is the following:

        ```text theme={null}
        ...
        status:
          infiniband_topology_path:
            instances:
              - instance_id: computeinstance-***rnqz
                path:
                  - ***27bf
                  - ***bb9b
                  - ***b7ad
              - instance_id: computeinstance-***pepp
                path:
                  - ***27bf
                  - ***bb9b
                  - ***e1ff
              - ...
        ```
      </Tab>

      <Tab title="Go SDK">
        ```go theme={null}
        gpuCluster, err := sdk.Services().Compute().V1().
            GpuCluster().Get(
                ctx,
                &compute.GetGpuClusterRequest{
                    Id: "computegpucluster-***",
                },
            )
        if err != nil {
            return err
        }
        fmt.Println(gpuCluster)
        ```

        In the code, specify the GPU cluster ID.
      </Tab>

      <Tab title="Python SDK">
        ```python theme={null}
        gpu_cluster_service = GpuClusterServiceClient(sdk)
        gpu_cluster = await gpu_cluster_service.get(
            GetGpuClusterRequest(id="computegpucluster-***"),
        )
        print(gpu_cluster)
        ```

        In the code, specify the GPU cluster ID.
      </Tab>

      <Tab title="JavaScript SDK">
        ```ts theme={null}
        const getGpuClusterService = new GpuClusterService(sdk);
        const gpuCluster = await getGpuClusterService.get(
          GetGpuClusterRequest.create({
            id: "computegpucluster-***",
          }),
        );
        console.log(gpuCluster);
        ```

        In the code, specify the GPU cluster ID.
      </Tab>
    </Tabs>
  </Tab>

  <Tab title="VM topology">
    To get the topology for an individual VM:

    <Tabs group="interfaces">
      <Tab title="CLI">
        Run the following command:

        ```bash theme={null}
        nebius compute instance get --id computeinstance-***
        ```

        In the `--id` parameter, specify the ID of the VM attached to the GPU cluster.

        The output example is the following:

        ```text theme={null}
        ...
        status:
          infiniband_topology_path:
            path:
              - ***27bf
              - ***bb9b
              - ***e1ff
        ```
      </Tab>

      <Tab title="Go SDK">
        ```go theme={null}
        instance, err := sdk.Services().Compute().V1().
            Instance().Get(
                ctx,
                &compute.GetInstanceRequest{
                    Id: "computeinstance-***",
                },
            )
        if err != nil {
            return err
        }
        fmt.Println(instance)
        ```

        In the code, specify the ID of the VM attached to the GPU cluster.
      </Tab>

      <Tab title="Python SDK">
        ```python theme={null}
        instance_service = InstanceServiceClient(sdk)
        instance = await instance_service.get(
            GetInstanceRequest(id="computeinstance-***"),
        )
        print(instance)
        ```

        In the code, specify the ID of the VM attached to the GPU cluster.
      </Tab>

      <Tab title="JavaScript SDK">
        ```ts theme={null}
        const getInstanceService = new InstanceService(sdk);
        const instance = await getInstanceService.get(
          GetInstanceRequest.create({
            id: "computeinstance-***",
          }),
        );
        console.log(instance);
        ```

        In the code, specify the ID of the VM attached to the GPU cluster.
      </Tab>
    </Tabs>
  </Tab>
</Tabs>

In the topology data, the `path` list shows components of the [InfiniBand™ network layers](/compute/clusters/gpu/topology#architecture-of-infiniband-topology):

```text theme={null}
***27bf # 1st network layer (InfiniBand™ fabric)
***bb9b # 2nd network layer (point of delivery, POD)
***e1ff # 3rd network layer (scalable unit, SU)
```

## How to create the Slurm topology configuration

To set up topology in [Slurm](https://slurm.schedmd.com) and run jobs for ML workloads, you need the [topology.conf](https://slurm.schedmd.com/topology.conf.html) file. This file shows the network hierarchy: how nodes are interconnected, what layers they are located at and what switches are used.

The `topology.conf` file represents InfiniBand™ topology. You can create this file based on the [information about a given GPU cluster](#how-to-get-infiniband-topology-of-a-gpu-cluster). To create the file, run one of the scripts from the [Nebius AI Cloud solution library](https://github.com/nebius/nebius-solution-library/tree/main/scripts/ib-topology) on GitHub.

***

*InfiniBand and InfiniBand Trade Association are registered trademarks of the InfiniBand Trade Association.*
