proxmox-vfio-toggle

1 script

A small bash script that toggles a Proxmox host between VFIO passthrough (GPU dedicated to a VM) and amdgpu mode (driver loaded so the GPU can be passed to LXCs for Ollama, Jellyfin, Frigate, and friends). Run on the fly via curl, or install to /usr/local/sbin. Designed to be run as root (Proxmox default), so the one-liners below skip sudo.

Proxmox VE AMD iGPU VFIO LXC Homelab
--enable
vfio

Restore vfio.conf, re-blacklist amdgpu, rebuild initramfs, and reboot. The GPU comes back bound to vfio-pci, ready for VM passthrough.

--disable
amdgpu

Disable vfio*.conf, comment out the amdgpu blacklist, rebuild initramfs, and reboot. The driver loads on boot so the iGPU can be passed to LXCs.

--status
read-only

Print whether VFIO passthrough is currently ENABLED, DISABLED, or UNKNOWN based on the modprobe state. Safe to run, no reboot.

--install
setup

Drop the script into /usr/local/sbin/vfio-toggle.sh for repeated use. Optional. Without it the script runs fine on the fly via curl.

Run / install

#curl -fsSL https://pacnpal.github.io/proxmox-vfio-toggle/vfio-toggle.sh | bash

Docs & source