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.
Restore vfio.conf, re-blacklist amdgpu, rebuild initramfs, and reboot. The GPU comes back bound to vfio-pci, ready for VM passthrough.
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.
Print whether VFIO passthrough is currently ENABLED, DISABLED, or UNKNOWN based on the modprobe state. Safe to run, no reboot.
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.
#curl -fsSL https://pacnpal.github.io/proxmox-vfio-toggle/vfio-toggle.sh | bash
--install--status is read-only and never touches the filesystem