Confidential Virtual Machine (CVM)
A Confidential Virtual Machine (CVM) runs your node inside an Intel TDX virtual machine. Its memory is encrypted by the CPU, and its TDX quote records the software it runs.
An 8× H200, B200 or B300 node earns the unrented incentive while idle only with GPU Profiling, GPU splitting or a CVM whose TDX quote the validator verifies.
Prerequisites
| Part | Requirement |
|---|---|
| CPU | Intel TDX and SGX: 5th Gen Xeon Scalable (Emerald Rapids), Xeon 6 (Granite Rapids), or 4th Gen (Sapphire Rapids) XCC/MCC SKUs. /dev/sgx_enclave and /dev/sgx_provision present after boot. |
| GPU | NVIDIA Confidential Computing: Hopper (H100, H200) or Blackwell (B200, GB200). See the NVIDIA compatibility matrix. |
| BIOS | Latest version, with Intel TDX, Intel SGX and VT-x / VT-d on |
| Kernel | Intel TDX kernel, tested 6.14.0-1009-intel or newer (uname -r) |
| OS | Ubuntu 25.04, KVM with kvm_intel loaded, Docker and Docker Compose |
| Boot parameters | intel_iommu=on and your GPU IDs in vfio-pci.ids. See Kernel boot parameters. |
Check Before You Rack It
Five checks decide whether a node can ever attest. Run them before the first CVM launch.
1. TDX Module Version
sudo dmesg | grep -i 'TDX module'
The build must be 882 or higher (TDX module 2.0.08). If older, update the BIOS, or copy Intel's signed module from the TDX module releases to the EFI partition:
tar -xvzf intel_tdx_module.tar.gz
sudo mkdir -p /boot/efi/EFI/TDX/
sudo cp TDX-Module/intel_tdx_module.so /boot/efi/EFI/TDX/TDX-SEAM.so
sudo cp TDX-Module/intel_tdx_module.so.sigstruct /boot/efi/EFI/TDX/TDX-SEAM.so.sigstruct
sudo reboot
2. NUMA Topology
cat /sys/devices/system/node/possible
cat /sys/devices/system/node/online
Both must print the same range. If not, change the base image in key-provider/Dockerfile.key-provider to gramineproject/gramine:1.9-jammy and rebuild with sudo ./cvm_upgrade_guard.sh upgrade.
3. Platform Registration and PCCS
A multi-socket platform must be registered with Intel. Turn on SGX Auto MP Registration in BIOS, or run PCKIDRetrievalTool against your own PCCS:
PCKIDRetrievalTool -url https://localhost:8081 -use_secure_cert false
Then set pccs_url in key-provider/sgx_default_qcnl.conf to that PCCS.
4. QEMU Build
/opt/qemu-dstack/bin/qemu-system-x86_64 --version # QEMU emulator version 9.2.1
The host must run the dstack QEMU 9.2.1 build. If not, build kvinwang/qemu-tdx (branch dstack-qemu-9.2.1) with --prefix=/opt/qemu-dstack, and set it in /etc/dstack/client.conf:
[qemu]
path = /opt/qemu-dstack/bin/qemu-system-x86_64
5. Runner Image Digest
EXECUTOR_RUNNER_IMAGE_DIGEST in .env is the fingerprint of the executor-runner image. lium-cvm.sh writes it into the CVM's compose file, and the validator's attestation check reads that file's hash. The compose file is fixed at new, so a wrong digest can be fixed only by recreating the CVM.
grep EXECUTOR_RUNNER_IMAGE_DIGEST .env
Use the digest and the expected compose hash from the "CVM attestation" section of the current executor release notes. The digest does not change with every release; currently:
EXECUTOR_RUNNER_IMAGE_DIGEST=sha256:f8421a1d93c62029326e86bbd5ad5192c480477c68e87811fe4084bd499c854c
expected compose hash: 0cc30085543511090db2952809f104dd30ec7d8630abb9fc4cde8590068ec104
Check the measurement
After sudo ./lium-cvm.sh new <name> and before run:
python3 scripts/compose_hash.py --check run/vms/<name>/shared/app-compose.json
The expected line must also match the published expected compose hash shown above; otherwise your checkout differs from that release.
Exit 1 means the CVM's compose differs from the expected one: check the digest, the measured files (app/docker-compose.yml, app/init_script.sh, app/pre_launch_script.sh) and the new flags (--enable-logs, --enable-sysinfo or an --env other than prod change the hash). Then recreate the VM directory and run new again.
sudo rm -rf run/vms/<name> erases the CVM's encrypted data disk. On a CVM that has run, Pause New Rentals, wait for the last pod to end and export your data first.
Setup Guide
The CVM is the node: the executor runs inside it, and the GPUs in CVM_GPUS (or all) are passed through to it. Do not run the normal node install on these GPUs, and no node needs to run first.
1. Get the Files
git clone https://github.com/Datura-ai/lium-io.git
cd lium-io/neurons/executor/dstacktee
Run every command below from this folder.
2. Check System Compatibility
./lium-cvm.sh check
Fix any errors before you continue.
3. Load vfio-pci
On Ubuntu vfio-pci is a module, so vfio-pci.ids= on the kernel command line does nothing until the module loads. Load it at every boot, ahead of any NVIDIA driver (use your GPU and NVSwitch IDs from lspci -nn | grep -i nvidia):
printf 'vfio\nvfio_iommu_type1\nvfio_pci\n' | sudo tee /etc/modules-load.d/vfio-pci.conf
printf 'options vfio-pci ids=10de:2335,10de:22a3\nsoftdep nvidia pre: vfio-pci\nsoftdep nouveau pre: vfio-pci\n' \
| sudo tee /etc/modprobe.d/vfio-pci.conf
printf 'vfio\nvfio_iommu_type1\nvfio_pci\n' | sudo tee -a /etc/initramfs-tools/modules
sudo update-initramfs -u -k all
sudo reboot
After the reboot, ls /dev/vfio must list numbered groups, not only vfio.
4. Verify GPU is Bound to vfio-pci
./lium-cvm.sh lsgpu
lspci -nnk -s 19:00.0 # your GPU's PCI address
It must show Kernel driver in use: vfio-pci.
5. Enable GPU Confidential Computing Mode
Use NVIDIA's gpu-admin-tools, before the CVM starts. On a running CVM, stop it first; do not recreate it with new.
git clone https://github.com/NVIDIA/gpu-admin-tools.git
cd gpu-admin-tools
One Hopper GPU per CVM
sudo python3 ./nvidia_gpu_tools.py --devices gpus --set-ppcie-mode=off --reset-after-ppcie-mode-switch
sudo python3 ./nvidia_gpu_tools.py --devices gpus --set-cc-mode=on --reset-after-cc-mode-switch
All GPUs of an HGX Hopper node in one CVM (8× H100 / H200)
Use Protected PCIe mode. The whole board goes to one CVM: set CVM_GPUS=all in step 8, and bind the NVSwitches (10de:22a3) to vfio-pci too. Needs HGX firmware 1.7.1 or newer, Secure Boot off and IOMMU on.
sudo python3 ./nvidia_gpu_tools.py --devices gpus --set-cc-mode=off --reset-after-cc-mode-switch
sudo python3 ./nvidia_gpu_tools.py --devices gpus,nvswitches --set-ppcie-mode=on --reset-after-ppcie-mode-switch
sudo python3 ./nvidia_gpu_tools.py --devices gpus,nvswitches --query-ppcie-mode
From a pod on the node, nvidia-smi conf-compute --get-multigpu-mode must print Protected PCIe.
Blackwell (B200 / B300)
sudo python3 ./nvidia_gpu_tools.py --devices gpus --set-cc-mode=on --reset-after-cc-mode-switch
6. Download the OS Image
./lium-cvm.sh download
7. Start the Key Provider
The key provider supplies sealing keys to the CVM. Start it through the upgrade guard, from the lium-cvm.sh directory:
sudo ./cvm_upgrade_guard.sh start
The guard builds the image once and reuses it, so existing CVM disks stay readable. Do not run docker compose build in key-provider/ yourself.
Check it
docker compose -f key-provider/docker-compose.yaml ps
curl -k https://localhost:3443
8. Configure Environment and Create the CVM
cp .env.example .env
Set at least:
MINER_HOTKEY_SS58_ADDRESS=<your_hotkey>
EXTERNAL_PORT=8001
SSH_PORT=2200
RENTING_PORT_RANGE="19001,19002,19003" # comma list, no dash ranges
CVM_VCPUS=16
CVM_MEMORY=64G
CVM_DISK=200G
CVM_GPUS=19:00.0,3b:00.0 # vfio-pci addresses from step 4, or "all"
Create the CVM and check its measurement (Runner Image Digest):
sudo ./lium-cvm.sh new my-executor
python3 scripts/compose_hash.py --check run/vms/my-executor/shared/app-compose.json
9. Run the CVM
sudo ./lium-cvm.sh run my-executor
A QEMU warning TDX doesn't support requested feature: CPUID.07H_01H:EDX.avx10 is harmless.
run keeps QEMU in the foreground: closing the terminal or pressing Ctrl+C stops the CVM. Start it inside tmux (tmux new -s cvm, run the command, detach with Ctrl+B then D, return with tmux attach -t cvm) or from a systemd unit. The CVM does not start by itself after a host reboot; run it again.
10. Check the CVM Is Running
sudo ./lium-cvm.sh list shows the CVM, and the run terminal shows its boot. After you add the node (next step), the portal shows its validation status.
A production CVM has no live-logs page. The logs dashboard on port 8090 needs new --enable-logs, and that flag changes the compose hash, so validators reject the node. Use it only on a test CVM.
11. Add the Node in the Portal
lium-cvm.sh new prints Executor endpoint: <ip>:<port>. At provider.lium.io click Add Node, choose Enter the details, and enter the printed IP and port (EXTERNAL_PORT, 8001 by default). The dialog otherwise opens on the normal host installation command.
Troubleshooting
| Symptom | Fix |
|---|---|
Key provider logs No matching TCB level found | TDX Module Version |
load_enclave ... EINVAL | NUMA Topology |
AESM error 44, then load_enclave ... EPERM | Platform Registration and PCCS |
Verifier replies RTMR0 mismatch | QEMU Build |
401 Invalid validator signature, or the node never scores | Runner Image Digest |
vfio-dev: No such file or directory | Kernel boot parameters |
Kernel boot parameters
- Find your GPU IDs, for example
10de:2335:
lspci -nn | grep -i nvidia
- In
/etc/default/grub, set (with your IDs):
GRUB_CMDLINE_LINUX_DEFAULT="kvm_intel.tdx=on nohibernate intel_iommu=on video=efifb:off vfio_iommu_type1.dma_entry_limit=16777216 vfio-pci.ids=10de:2335,10de:22a3 kvm_intel.tdx=1 default_hugepagesz=1G hugepagesz=1G hugepages=10"
GRUB_CMDLINE_LINUX="console=tty0"
dma_entry_limit=16777216 is required: with a lower limit QEMU stops mid-boot with VFIO_MAP_DMA failed: No space left on device.
- Apply and reboot, then repeat step 4:
sudo update-grub
sudo reboot