Originally Posted by lloyd mcclendon
KVM currently 'sort-of' works with passthrough - it will assign and may even be picked up and work ok, but the code to 'reset' the card back to normal when the VM shuts off is currently not there. So if you shutdown your guest, your host will crash if you try to start the guest back up. I experienced this myself and there's plenty of other KVM users out there who have documented the same behavior, regardless of hardware selected. The card did actually work fine until I shut the guest off. I'd expect QEMU/KVM to have this code added in a year or two - I may switch back at that point, but lets see how XEN goes for a bit first.
Regarding NVIDIA, supposedly the 'quadro' series cards do support it, but whether or not anyone has gotten it to work is spotty at best. There are even some users out there who have used the 'nvflash' tool to hack in their custom built firmware updates with memory mappings built to support resetting the card. There's a neat pdf out there somewhere where the guy loosely outlines the steps to do this. I would never do this as it's a good way to brick your card ... say you type 0x00007A400000 instead of 0x0007A400000
Also there are some blurbs out there that if you contact nvidia support they will send you patched firmware for the card, but when I called support they said this is misinformation and they have never offered said patches.
"nvidia has been the single worst company
we've ever dealt with ... so nvidia, :bleep: you." -Linus
No not really, like i mentioned in a previous post kvm will crash the host when doing vga passthrough if you dont bind your gpu to pci-stub before the radeon driver loads, i recently switched from arch + xen to opensuse + kvm because of xen poor power management options on my amd machine (suspend doesnt work, cool'n quiet crash my system, etc), and im passing though a radeon 6950 without issues, i can reboot or shutdown the vm as much as i want without a single crash, and it seems most of my performance issues in the past were related to ksm.
Here's how i bind my gpu:
First of all you need to build your kernel with pci-stub built-in or add the pci-stub module to your initrd, then you need to find out the ids of your card.
07:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Cayman PRO [Radeon HD 6950]
07:00.1 Audio device: Advanced Micro Devices [AMD] nee ATI Cayman/Antilles HDMI Audio [Radeon HD 6900 Series]
07:00.0 0300: 1002:6719
07:00.1 0403: 1002:aa80
So now you add this to your grub config file:
It will end up looking something like this:
linux /vmlinuz-3.7.10-1.1-desktop root=/dev/mapper/system-root resume=/dev/system/swap splash=silent quiet showopts iommu=1 pci-stub.ids=1002:6719,1002:aa80
dmesg | grep pci-stub
[ 2.136667] pci-stub: add 1002:6719 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[ 2.136674] pci-stub 0000:07:00.0: claimed by stub
[ 2.136676] pci-stub: add 1002:AA80 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[ 2.136682] pci-stub 0000:07:00.1: claimed by stub
Also there's some interesting development in the kvm + qemu camp using vfio-pci to get primary vga passthrough working on NVIDIA and AMD using secondary devices, here are the patches for qemu: