Contact
Skip to the page text

Documentation / Guides / Installation

Installing on VMware vSphere

Why two virtual machines

The control plane can run continuously in its own VM, and you add or remove GPU VMs with any number of GPUs as you wish, with no change for API clients. This gives you full flexibility on your GPU resources, yet continuous operations on the inference services and APIs.

Overview

Control plane VMInference node VM
Example name and addressonprem-ai-control-plane, 10.20.0.10onprem-ai-inference-node, 10.20.0.21
vCPUs48 for 1-2 GPUs, 16 for 4 GPUs, 32 for 8 GPUs
Memory8 GB32 GB for 1 GPU, 64 GB for 2-4 GPUs, 128 GB for 5-8 GPUs; all reserved
Disk128 GB64 GB system + 500 GB or more for model weights
GPUnone1 or more, DirectPath I/O
Runs all the timeyesas demand needs
  • A few special models have larger CPU workloads and need more vCPUs and memory than these sizes. This is uncommon; the model's deploy profile lists its limits.
  • Tested with: not yet. Written for vSphere 7 and 8, vCenter, NVIDIA GPUs, Ubuntu Server 24.04 LTS.
  • Not covered: NVIDIA vGPU (one GPU shared between VMs; needs an NVIDIA AI Enterprise license).
  • Install options in detail: Installing and updating the control plane, Installing, updating, moving and removing an inference node.

Before you start

  • Host firmware: VT-d (Intel) or AMD-Vi / IOMMU (AMD) on, Above 4G decoding on, SR-IOV on when offered.

  • GPU: on the VMware Compatibility Guide for passthrough on your ESXi version.

  • Host memory: both VMs, plus ESXi. A GPU VM reserves all its memory.

  • Addresses: fixed for both VMs (static or DHCP reservation). The control plane's address must never change.

  • Network:

    FromToPort
    Inference node VMControl plane VM443
    BrowsersControl plane VM3443
    API clientsControl plane VM443
    AnythingInference node VMnone
  • Internet: both VMs, directly or through a proxy. Behind a proxy, do the steps of the guide Outbound proxy on both VMs before the install: the proxy for Docker, the proxy's certificate authority when it inspects TLS, and the proxy in both install commands: the variable HTTPS_PROXY for the control plane VM, the option --outbound-proxy-url for the inference node VM.

Step 1: Enable passthrough on the ESXi host

  1. vSphere Client: host → Configure → Hardware → PCI Devices → All PCI Devices.
  2. Filter NVIDIA, select every function of the GPU, Toggle Passthrough.
  3. Maintenance mode, reboot the host. The Passthrough column then says Active.

Step 2: Create the control plane VM

New Virtual Machine:

  • Guest OS: Linux, Ubuntu Linux (64-bit)
  • 4 CPUs, 8 GB memory, 128 GB disk
  • SCSI controller VMware Paravirtual, network adapter VMXNET 3
  • CD/DVD: the Ubuntu Server 24.04 ISO, Connect At Power On

Ubuntu installer:

  • Network: manual, 10.20.0.10/24
  • Storage: entire disk; set the root volume to the full size
  • OpenSSH server: yes
  • Featured snaps: none (Docker as a snap is not supported)

After the first boot:

sudo apt-get update
sudo apt-get install -y open-vm-tools docker.io docker-compose-v2

Step 3: Install the control plane

curl -fsSL https://get.onprem.ai/control-plane | sh
  • Asks for sudo once.
  • Open https://10.20.0.10:3443. The first visit creates the first administrator.
  • Browser certificate warning: see Trusting the control plane in your browser.

Step 4: Create the inference node VM

Clone or make a template now, if you want to. Never after step 6: a clone after step 6 copies the inference node's identity.

New Virtual Machine as in step 2, with:

  • CPUs: 8 for 1-2 GPUs, 16 for 4 GPUs, 32 for 8 GPUs
  • Memory: 32 GB for 1 GPU, 64 GB for 2-4 GPUs, 128 GB for 5-8 GPUs
  • Memory → Reserve all guest memory (All locked)
  • Disk 1: 64 GB, system
  • Disk 2: 1000 GB, model weights. Exclude it from backups: model weights can be downloaded again.
  • Add New Device → PCI Device → the GPU, one per GPU. Dynamic DirectPath IO takes any free GPU of that model.
  • VM Options → Boot Options: Firmware EFI, Secure Boot off

VM Options → Advanced → Edit Configuration → Add Configuration Params:

NameValueWhen
pciPassthru.use64bitMMIOTRUEalways
pciPassthru.64bitMMIOSizeGBsee belowalways
pciPassthru.allowP2PTRUE2 or more GPUs
pciPassthru.RelaxACSforP2PTRUE2 or more GPUs

64bitMMIOSizeGB reserves address space for the GPUs' memory; it uses no RAM. Too small: the VM does not power on, or shows no GPU. Too large: only a slower boot. Safe values, from Broadcom's rule: add the GPUs' memory sizes, round the sum up to the next power of 2, then up to the next power of 2 again (Broadcom KB 323402). One H200 GPU has 141 GB:

GPUs in the VM64bitMMIOSizeGB
1 x H200512
2 x H2001024
4 x H2002048
8 x H2004096

Tested with 2 H200 GPUs: 288 was too small; 1024 worked. Smaller values work on an HGX server (SXM GPUs, NVSwitch): 128 GB per GPU plus 32 GB, 1056 for 8 GPUs in Broadcom's test (Deploy VMware Private AI on HGX servers). Other GPUs: the value from the GPU or server vendor, or the rule above; NVIDIA lists per-model values (Creating your first NVIDIA AI Enterprise VM).

Install Ubuntu as in step 2, with 10.20.0.21/24. Leave disk 2 empty.

Limits of a GPU VM:

  • No vMotion, no snapshots, no suspend.
  • Stop it with Shut Down Guest OS, never Power Off. Some GPUs then need a host power cycle.

Step 5: GPU driver, Docker, NVIDIA Container Toolkit

On the inference node VM.

GPU visible?

lspci -nn | grep -i nvidia

Driver:

sudo apt-get update
sudo apt-get install -y open-vm-tools linux-headers-$(uname -r)
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get install -y nvidia-open
  • nvidia-open: Turing (2018) and newer. Older GPUs: cuda-drivers.

Display modules off (they can hang at shutdown and lock the GPU):

printf 'blacklist nvidia_drm\nblacklist nvidia_modeset\ninstall nvidia_drm /bin/false\ninstall nvidia_modeset /bin/false\n' \
  | sudo tee /etc/modprobe.d/nvidia-headless.conf
sudo update-initramfs -u
sudo reboot

Check: every GPU with its memory; only nvidia and nvidia_uvm loaded.

nvidia-smi
lsmod | grep nvidia

Docker and the NVIDIA Container Toolkit:

sudo apt-get install -y docker.io
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey \
  | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -fsSL https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \
  | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \
  | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

Check: the answer names nvidia.

sudo docker info --format '{{json .Runtimes}}'

Step 6: Install the inference node

  1. Control plane: Servers → Add Inference Node, copy the command.

  2. Run it on the inference node VM within 15 minutes (the join token works once, for 15 minutes):

    curl -fsSL https://get.onprem.ai/node | sh -s -- \
      --control-plane-gateway-address 10.20.0.10 \
      --control-plane-root-certificate-sha256 <fingerprint> --join-token <token>
  3. Mount disk 2 as the cached file set directory (lsblk names it, here /dev/sdb):

    sudo onprem-ai-node stop
    sudo mkfs.xfs -L cached-file-sets /dev/sdb
    sudo mkdir -p /var/lib/onprem-ai/inference-node/cached-file-sets
    echo 'LABEL=cached-file-sets /var/lib/onprem-ai/inference-node/cached-file-sets xfs defaults,nofail 0 2' \
      | sudo tee -a /etc/fstab
    sudo systemctl daemon-reload
    sudo mount /var/lib/onprem-ai/inference-node/cached-file-sets
    sudo chown onprem-ai:onprem-ai /var/lib/onprem-ai/inference-node/cached-file-sets
    sudo onprem-ai-node start

    The node's identity stays on disk 1, which your backup keeps. Details: Data directories.

Step 7: Check

  • Servers: the inference node is Connected, with every GPU.
  • On the VM: sudo onprem-ai-node doctor names anything wrong.
  • First model: Getting Started.

Adding and removing GPU virtual machines

The control plane keeps running through all of these.

TaskSteps
Add an inference nodeSteps 4 to 7 with a new VM, a new address and a new command from Add Inference Node.
More GPUs in an existing VMShut Down Guest OS, add the PCI device, raise 64bitMMIOSizeGB, power on. Servers shows the new GPUs. Its models stop while the VM is down.
Remove an inference node for goodMove its models to other inference nodes first. Then on the VM: sudo onprem-ai-node uninstall --remove-data. Delete the VM.
Pause an inference nodesudo onprem-ai-node stop, then Shut Down Guest OS. It keeps its models and comes back with sudo onprem-ai-node start.
  • Models keep serving from their replicas on the other inference nodes.
  • A model with all its replicas on the removed node stops serving. Deploy a replica elsewhere first: Deploying models.

When a step fails

What you seeFix
Toggle Passthrough greyed out, or Not capableTurn on VT-d / AMD-Vi in the host firmware. Check the server vendor's GPU slot rules.
Power on: "Invalid memory setting: memory reservation (sched.mem.min) should be equal to memsize"Reserve all guest memory (All locked) (step 4).
Power on fails with a PCI passthrough error, or a black consoleCheck use64bitMMIO, raise 64bitMMIOSizeGB, check firmware EFI (step 4).
VM log: NVRM: BAR1 is 0M; nvidia-smi: No devices were foundRaise 64bitMMIOSizeGB (step 4).
nvidia-smi: couldn't communicate with the NVIDIA driverSecure Boot off (step 4). GPU older than Turing: cuda-drivers.
After a VM restart: No devices were found, log shows WPR2 already upPower cycle the host. Check the display modules are off (step 5). Use Shut Down Guest OS.
Multi-GPU model stuck in Starting, log stops at NCCL, GPUs at 100%Check the two P2P settings (step 4). Some GPUs cannot do P2P under ESXi: use one GPU per replica.
Two inference nodes connect and disconnect in turnA clone made after step 6. On the clone only: sudo onprem-ai-node remove-data --reset-identity, then sudo onprem-ai-node connect with a new command from Add Inference Node. Never uninstall --remove-data on the clone: it removes the original too.
Install stops: Docker not running, or a snapsudo snap remove docker, then docker.io (step 2).
Install stops: token expired or already usedNew command from Add Inference Node.
Install stops: control plane not reachableOpen port 443 from 10.20.0.21 to 10.20.0.10 (NSX, network, ufw).
Install stops: certificate does not name the addressSee Installing an inference node, The address in the install command.
doctor: nvidia-container-runtime-not-registeredRepeat the toolkit block (step 5).
Servers shows no GPUssudo onprem-ai-node doctor; Inference Node Container Detection explains each finding.

Found a mistake, or is something missing? Suggest an improvement to this page on GitHub.

Platform release 5.10.4, . Source of this page at v5.10.4. This page as Markdown.