[SATLUG] kvm pci passthrough

Mark Mayfield mayfield_mark at gvtc.com
Thu Jan 31 20:34:39 CST 2013


I basically followed someone else's

https://docs.google.com/document/d/1ef_nfl652L0HLn_wGvnpgjsBJd9LZzaV_-rIcEEoK8Y/edit?pli=1

I used a nvidia card for the host and an ati card for the guest. This 
avoids having to deal trying to get the radeon module to load for one 
radeon and not the other.

I added iommu=pt iommu=1 rd.driver.blacklist=radeon radeon.modeset=0
to my kernel options

I did have to add a special option to the kvm module.

I created /etc/modprobe.d/kvm_iommu_map_guest.conf

and put
options kvm allow_unsafe_assigned_interrupts=1

without loading kvm with that option the guest would fail to attach my 
video card.

Thats pretty much it. I used libvirt and added the radeon and hdmi sound 
card thats built into with the add physcial pci device option. I fumbled 
around adding usb devices until got a usb keyboard and mouse working.

The system would crash if I used the usb passthrough option. I had to 
pass the pci usb controller to get it to work.

The most important thing here is that you have a board with an iommu option.
No iommu, no gaming virtual machine.

radeon hd 6 series cards are supposed to work well. the 7 series is 
known to be problematic.
Nvidia's are possible but I've gathered probably more trouble than there 
worth. Just get a radeon hd 6 series.

xen is suppossed to be better at rebooting with a passed through video 
card. But I want to keep spice. I'm hoping the reboot will be solved 
with an update sometime in the near future.

I have a bunch of games running on it now and have not had any issues 
outside of the rebooting problem.

On 01/31/2013 05:34 PM, Todd W. Bucy wrote:
> wow I've been searching for that Holy Grail for about 3 years now.  any
> chance on you posting a tutorial?
> On Jan 29, 2013 2:59 PM, "Mark Mayfield" <mayfield_mark at gvtc.com> wrote:
>
>> Something happened with my email and I had had to transfer my satlug
>> account to a different address.
>>
>>
>> Anyway I had a very productive experience with kvm recently. I was using
>> xen for a while but I stumbled onto spice and have been loving it. Libvirt,
>> spice and pulseaudio work well together without a fight, unlike vnc. The
>> video driver for spice, qxl is way better than cirrus and the other video
>> drivers. The spice vdagent provides copy and paste ability between the host
>> and guest. These improvements make it much more usable for day to day
>> desktop virtualization.
>>
>> Having finally gotten the video card I've been needing to complete my
>> gaming virtual machine project that's been in the works for about a year, I
>> decided to give kvm a shot instead of xen. After stumbling upon an option I
>> had to pass to the kvm module I successfully passed a Radeon HD 6850 to a
>> Windows 8 virtual machine. After getting the video card installed, running
>> the windows experience tool and installing game I was a little
>> disappointed. I did achieve a 5.9 rating but the game movement was less
>> than ideal. After some tinkering I figured out that the virtual keyboard
>> and mouse couldn't keep up with the game. I managed to pass through a usb
>> controller and use a dedicated keyboard and mouse for the virtual.
>>
>> The virtual machine runs Halo, Assassins Creed 2, Crysis and Skyrim
>> (medium settings). The only real glitch is that I have to reboot the host
>> to reboot the guest. If I try to reboot the guest without rebooting the
>> host the guest crashes.
>>
>> I will post a screenshot of the virtual machine later.
>>
>> FYI for performance I'm using a raw disk image with no cache, virtio
>> storage and network drivers, hugepages and elevator=noop.
>> --
>> ______________________________**_________________
>> SATLUG mailing list
>> SATLUG at satlug.org
>> http://alamo.satlug.org/**mailman/listinfo/satlug<http://alamo.satlug.org/mailman/listinfo/satlug>to manage/unsubscribe
>> Powered by Rackspace (www.rackspace.com)
>>



More information about the SATLUG mailing list