Skip to main content
To boost performance of the high-performance computing (HPC) and AI workloads that you run in a Managed Service for Kubernetes cluster, you can set it up so that the GPUs on its nodes are interconnected directly using InfiniBand. In this tutorial, you will create a Managed Service for Kubernetes cluster with GPUs interconnected using InfiniBand, install operators and drivers from NVIDIA on it, and run NVIDIA NCCL tests to check InfiniBand performance.

Costs

The tutorial includes the following chargeable resources:

Prerequisites

  1. Install and configure the Nebius AI Cloud CLI.
  2. Save IDs of the default subnet and the k8s-node-group-sa default service account to environment variables:
  3. Install kubectl and Helm.

Steps

Set up a Managed Service for Kubernetes cluster with GPUs and InfiniBand

  1. Create a GPU cluster:
  2. Create a Managed Service for Kubernetes cluster with a public endpoint:
  3. Create a node group in the cluster:
    For this tutorial, it is required that:
    • The node group has the GPU cluster specified.
    • The node group includes at least two nodes.
    • The nodes use a VM platform and preset compatible with GPU clusters: In this command, the nodes use the gpu-h100-sxm VM platform with the 8gpu-128vcpu-1600gb preset.
    • The nodes use a boot disk image offered by Managed Kubernetes that contains drivers and other components for GPUs. Without this image, you need to install the drivers and components manually. For more details, see GPU drivers and other components.
  4. Generate a kubeconfig file with the cluster details for kubectl:
    To verify that kubectl is connected to the cluster, you can run kubectl cluster-info.

Run the NCCL tests

  1. Install the Kubeflow Training Operator (also known as Kubeflow Trainer).
  2. Create a namespace for the tests, named nccl-test in this tutorial:
  3. Create nccl-test.yaml with an MPIJob for your tests.
    This example is for 2 nodes. If you created a node group with a different number of nodes, change accordingly the mpirun command in .spec.mpiReplicaSpecs.Launcher.template.spec.containers[0].args and the number of workers in .spec.mpiReplicaSpecs.Worker.replicas.
  4. Deploy the MPIJob in nccl-test:
  5. Check that the test Pods are running:
    Wait until all the Pods are running, like this:
  6. Check the test logs:
    In the result, check the average bus bandwidth. If its value is higher than 300 GB/sec, the connection is stable. Example:
    The average bus bandwidth is not equal to the InfiniBand one as some of the NCCL operations it measures use NVLink. Nevertheless, it accurately estimates the connection. To stop streaming logs, press Ctrl + C.
  7. Delete the MPIJob.
    You should delete the MPIJob even if you want to run another test. In this case, redeploy the MPIJob as described in steps 2–3.

How to delete the created resources

Some of the created resources are chargeable. If you do not need them, delete these resources, so Nebius AI Cloud does not charge for them:
  • Delete the installed operator:
  • Delete the node group with GPUs:
  • Delete the entire cluster:

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