Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
KVM VGA Passthrough [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
earlboy
n00b
n00b


Joined: 09 Nov 2005
Posts: 28

PostPosted: Tue Jul 01, 2014 10:32 am    Post subject: KVM VGA Passthrough [SOLVED] Reply with quote

Is there a gentoo guide on KVM PCI and VGA passthrough?

Currently I have my VM running on Xen with VGA passthough, problem is I also need my nvidia card for my linux for boinc stuff, but xen won't work with nvidia drivers, so I'm thinking on switching to KVM.

Got all relevent kernel configuration set up and have it build into the kernel. And installed qemu.
As a test, I tried to pass my spare sata controller (my board has two) to the VM, set up the pci-stub to grab it, via kernel parameter pci-stub.ids. Dmesg shows that pci stub is grabbing the sata controller.
But, upon setting up a VM with virt-manager, I'm getting an error "vfio: error, group 7 is not viable, please ensure all devices within the iommu_group are bound to their vfio bus driver".

My rig:

Intel i7
asrock Z77 Extreme6
Nvidia 660 GTX - intented for linux use
Radeon 7970 - for windows VM.


Last edited by earlboy on Wed Jul 02, 2014 7:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
earlboy
n00b
n00b


Joined: 09 Nov 2005
Posts: 28

PostPosted: Tue Jul 01, 2014 1:52 pm    Post subject: Reply with quote

After further digging, I found how to locate the devices in iommu group. The bad news is that the sata controller I need to pass to the vm belongs to a multi function device which includes the ethernet controller.

The way I understand the error is that all of the devices in an iommu group must be bound to vfio driver, so it's a no go for the sata controller.

Managed to pass usb controller which is the only device in an iommu group successfully.
Will try vga passthrough next.

Xen seems to have an advantage with pci passthrough since my xen setup was able to pass the sata controller, which my win 7 vm uses.
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 2576
Location: Dallas area

PostPosted: Tue Jul 01, 2014 4:22 pm    Post subject: Reply with quote

You can just pass the disk attached to the sata controller, if only windows is using that disk or pass the windows partition.

and yes all devices in an iommu group must be passed.
_________________
Asus m5a99fx, FX 8320 - amd64-multilib, 3.15.9-zen, glibc-2.17, gcc-4.7.3-r1, eudev
xorg-server-1.16, openbox w/lxpanel, nouveau, oss4(2011)
Back to top
View user's profile Send private message
earlboy
n00b
n00b


Joined: 09 Nov 2005
Posts: 28

PostPosted: Wed Jul 02, 2014 7:11 pm    Post subject: Reply with quote

Update :

After further googling around and reading several how to I've finally succeded.

Using my test rig, sata controller and vga card is now being passed through the VM (usb should be a lot easier). However I had to give up on vfio and use the old pci-assign method.

I'm optimistic that vfio will work, howerver, it will require effort and compromises on my side.
1. I have to move, my second vga card to my third pcie slot, because placing it on the second slot will group it with my primary vga card.
Problem with this is my casing, which will require modding for me to put my second vga card into the third pcie slot. Or I could just get a new bigger casing.

2. I have to switch my sata controllers for the host and vm. Because the asmedia controller is gouped with the lan card and a lot of other devices, while the intel one is grouped on it's own. (Currently the intel sata control is used by my linux host and the asmedia controller by the vm). The asmedia controller only has two ports, but my linux hosts needs 3. 2 slots for my 2 hdd in lvm, and a dvd drive.

With pci-assign method I don't have to do those mentioned above.

My last problem before I can switch to kvm is, my win7 vm. As a work around to boot from a sata controller I had to use an efi loader called duet. (I started with xen 4.1 which would not boot from a passed through sata controller.)
Duet hangs when I use it in kvm.
If I don't find another efi loader, looks like I have to reinstall windows on the vm.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum