GPU pass through in Proxmox using Pulumi
A practical guide to automating GPU passthrough with Proxmox and Pulumi
Setting up GPU passthrough in Proxmox using Infrastructure as Code (IaC) with Pulumi enables automated and reproducible VM deployments with direct GPU access.
Prerequisites
Before implementing GPU passthrough, ensure your system meets these requirements,
-
IOMMU/VT-d support, and
-
UEFI BIOS settings enabled.
Pulumi Implementation
Hereβs the simplified version of how to implement GPU passthrough using Pulumi with Go language.
vm.VirtualMachineArgs{
NodeName: pulumi.String("pve"),
Bios: pulumi.String("ovmf"),
Machine: pulumi.String("q35"),
Hostpcis: vm.VirtualMachineHostpciArray{
vm.VirtualMachineHostpciArgs{
Device: pulumi.String("hostpci0"),
Pcie: pulumi.Bool(true),
Id: pulumi.String("0000:17:00.0"), // Your GPU PCI ID
},
},
}
The code above demonstrates the essential configuration for GPU passthrough,
-
Use OVMF BIOS for UEFI support,
-
Q35 machine type for modern PCI Express support, and
-
Correct PCI ID for your GPU.
To verify the GPU configurations run the following command sudo lshw -C display to show detailed information about the graphics card.
Key Limitations of GPU Passthrough in Proxmox
-
Consumer grade GPU limited to one per virtual machine when using PCIe passthrough.
-
VMs must be shut down before switching GPU assignment
Originally published on Medium
π π π The source code for this blog post can be found here πππ
Reference:
[1] https://www.pulumi.com/registry/packages/proxmoxve/
[2] https://registry.terraform.io/providers/bpg/proxmox/latest/docs/resources/virtual_environment_vm