[SOLVED] passthrough primary gpu to guest? i.e. release it from proxmox/unload it

zenowl77

Member
Feb 22, 2024
88
12
8
okay so i just reconfigured my hardware since i figured out i had my guest gpus on the PCIE slots connected to the DMI bus instead of cpu (oops) which was impacting performance. (by quite a bit it appears since i had both the ARC and tesla on dmi slots due to lack of space in the case/between the slots)

so this required me to remove my GTX 1060 3GB that was acting as the primary gpu and i moved the intel ARC A310 4GB into the primary slot, but i now have the problem that i need to pass the ARC to the guest (the arc is the only one that supports AV1 encoding so i have to pass it) and it does not support mdev like the GTX card did.

how do i release the primary gpu from proxmox to pass it to the vm without causing it to crash or anything?
 
solved with:

echo 1 > /sys/bus/pci/devices/0000\:67\:00.0/remove
echo 1 > /sys/bus/pci/devices/0000\:67\:00.0/rescan
(for those reading this having the same problem replace 0000\:67\:00.0 with whatever your device ID is, example mine is 0000:67:00.0 so find yours then change the 67 to whatever yours is, if it still doesnt work run it again with both whatever your gpu ID is and the audio controller of the gpu usually just one above it mine are 67 and 68 for example)

found the suggestion online to run the remove command followed by echo 1 > /sys/bus/pci/rescan

but it did not work. rescan had to be run on the specific device via echo 1 > /sys/bus/pci/devices/0000\:67\:00.0/rescan then it worked and i have successfully passed both the primary GPU and the nvidia vGPU profile to the same VM.

(note this system has no iGPU so this is the main GPU passed to the VM for reference in case anyone is trying to attempt the same thing)
 
Last edited:
  • Like
Reactions: leesteken
Instead of kicking it from the PCI(e) bus, you could also try unbind the vfio-pci driver and binding the actual driver again. There are some examples (with hookscripts) on this forum.