Sure:
Proxmox Host Setup:
Enable IOMMU in BIOS (AMD: AMD-Vi, Intel: VT-d)
Edit /etc/default/grub:
For AMD: Add amd_iommu=on iommu=pt to GRUB_CMDLINE_LINUX_DEFAULT
For Intel: Add intel_iommu=on iommu=pt
Run update-grub and reboot
Load VFIO modules - add to /etc/modules:
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
Then run "update-initramfs -u -k all" and reboot
Verify IOMMU: Run "dmesg | grep -e DMAR -e IOMMU" (should show enabled)
VM Configuration:
Shut down your VM
In Proxmox: Hardware → Add → PCI Device → Select your GPU → Check "All Functions"
Start VM
Inside Debian 13 VM:
Edit /etc/apt/sources.list.d/debian.sources - ensure each Components line has:
Components: main contrib non-free-firmware non-free
Add Nvidia container toolkit repo:
run "curl -fsSL
https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg"
then rrun "echo "deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg]
https://nvidia.github.io/libnvidia-container/stable/deb/amd64 /" | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list"
Install everything:
run "sudo apt update && sudo apt install -y dkms linux-headers-$(uname -r) nvidia-driver nvidia-container-toolkit"
Configure Docker and reboot:
run "sudo nvidia-ctk runtime configure --runtime=docker"
then run "sudo reboot"
Test:
run "nvidia-smi"
run "docker run --rm --gpus all nvidia/cuda:12.6.0-base-ubuntu24.04 nvidia-smi"
Common Issues:
1. If nvidia-smi fails: Check /usr/sbin/dkms status. If status shows "added" not "installed", run "sudo /usr/sbin/dkms install nvidia-current/<version>"
2. Missing contrib repo causes dependency errors - it's required
3. DKMS must be installed before/with nvidia-driver or kernel module won't build. DKMS requires the kernel headers that match your current kernel. You may want to install "linux-headers-amd64" using apt, so that when the kernel updates, the headers will automatically update too.
In your docker compose files you need to include the highlighted section for containers using the GPU
services:
ollama:
image: ollama/ollama:latest
container_name: ollama
restart: unless-stopped
volumes:
- /mnt/ollama:/root/.ollama
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]