Learn / DGX Spark Cluster Setup

Cluster setup, part 1: connect and test

Let's connect two DGX Sparks, and prove the fast link works. We're at the bottom of the stack: the machines, and the cable between them.

Chapters

  1. 0:00Introduction
  2. 0:06Where this fits: The AI stack
  3. 0:11Step one: One cable
  4. 0:20Before you change anything: Two ways to set it up
  5. 0:36By hand: Set the addresses
  6. 0:49Both directions: Add SSH keys
  7. 0:59Test the link: Prove it's fast
  8. 1:13Measure it: Run the NCCL test
  9. 1:26Wrap up
Read the transcript

Introduction

Let's connect two DGX Sparks, and prove the fast link works.

Where this fits: The AI stack

We're at the bottom of the stack: the machines, and the cable between them.

Step one: One cable

Join them with one approved cable, using the same port on each Spark. Hold the pull tab upward, and push gently. Never force it.

Before you change anything: Two ways to set it up

The easy way is Cluster Assistant, in NVIDIA Sync. It sets the addresses and the keys. Or do it by hand, with a network file and SSH keys. Either way, this changes network settings. Keep your normal connection working.

By hand: Set the addresses

By hand, first see which interfaces are up. One port shows up as two. Give each its own address, in a network file. Then try it. This can interrupt the network, and goes back if you don't confirm.

ibdev2netdev
sudo nano /etc/netplan/40-cx7.yaml
sudo netplan try

Both directions: Add SSH keys

Copy your key to the other Spark. Check its fingerprint before you say yes. Then run a command there, with no password asked. Do the same from the other side.

ssh-copy-id -i ~/.ssh/id_ed25519.pub \
  USER@SPARK-TWO-LINK-ADDRESS
ssh USER@SPARK-TWO-LINK-ADDRESS hostname

Test the link: Prove it's fast

Check that both link interfaces are up. Ping the other Spark, on both addresses. Ask which way the traffic goes. It should be the cable, not your home network. Then check the speed the link reports.

Measure it: Run the NCCL test

Last, follow NVIDIA's NCCL playbook. It builds the test on both Sparks. Run it when both are idle, because it loads the GPUs. Keep the result, as your own baseline.

Wrap up

Keep cluster ports private. Part two helps you choose how to use both Sparks.

Sources

More lessons