NVIDIA Container Toolkit & CDI Setup on Proxmox GPU Passthrough VMs
Overview
NVIDIA Container Toolkit with CDI (Container Device Interface) enables Docker containers to access physical GPUs. On Proxmox VMs with GPU PCI passthrough, CDI specs must be explicitly generated and Docker must be configured to use them.
Prerequisites
- Proxmox VM with NVIDIA GPU PCI passthrough configured (IOMMU, vfio-pci)
- NVIDIA driver installed and
nvidia-smiworking on the host - Docker installed
Step-by-Step
1. Install NVIDIA Container Toolkit
2. Generate CDI Specs
Verify the spec was created:
3. (If Needed) Create AMD CDI Stub
On Proxmox GPU passthrough VMs, Docker’s CDI resolution may also require an amd.yaml spec. If NemoClaw or other GPU-passthrough tools fail with “AMD CDI spec not found”, create a minimal stub:
4. Configure Docker for CDI
5. Verify GPU Access
You should see the GPU listed with driver version and CUDA capabilities.
Common Pitfalls
| Pitfall | Resolution |
|---|---|
| “AMD CDI spec not found” | Create stub /etc/cdi/amd.yaml as described above |
CDI specs in /run/cdi/ conflict with /etc/cdi/ | Clean both directories and regenerate |
| GPU works on host but not in containers | Verify CDI specs exist and Docker was restarted |
Container starts but nvidia-smi fails inside | Check container runtime is docker (not containerd directly) |