You are not logged in.

#1 2015-10-02 22:18:18

burnbabyburn71
Member
Registered: 2015-08-04
Posts: 25

GPU pass-through (to VM) with one of two identical Graphics Cards?

Hi,

I've got two identical graphics cards and at this point I'm wondering if it is even possible to pass-through just one. The graphics cards are AMD 270Xs and I have no other graphics cards in my desktop (not even integrated). The issue is when I 'lspci' I get:

07:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Curacao XT [Radeon R7 370 / R9 270X/370 OEM] [1002:6810] (prog-if 00 [VGA controller])
	Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:3033]
	Flags: bus master, fast devsel, latency 0, IRQ 34
	Memory at d0000000 (64-bit, prefetchable) [size=256M]
	Memory at f7b00000 (64-bit, non-prefetchable) [size=256K]
	I/O ports at c000 [size=256]
	Expansion ROM at f7b40000 [disabled] [size=128K]
	Capabilities: <access denied>
	Kernel driver in use: radeon
	Kernel modules: radeon

and for the other card:

01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Curacao XT [Radeon R7 370 / R9 270X/370 OEM] [1002:6810] (prog-if 00 [VGA controller])
	Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:3033]
	Flags: bus master, fast devsel, latency 0, IRQ 33
	Memory at e0000000 (64-bit, prefetchable) [size=256M]
	Memory at f7e00000 (64-bit, non-prefetchable) [size=256K]
	I/O ports at e000 [size=256]
	Expansion ROM at f7e40000 [disabled] [size=128K]
	Capabilities: <access denied>
	Kernel driver in use: radeon
	Kernel modules: radeon

As you can see the IDs between both cards are the same, i.e [1462:3033] and [1462:3033] or [1002:6810]  and [1002:6810]. So if I use these IDs both GPUs will stop working and arch will not boot.

So is there any way around this issue (I'm surprised that this is even an issue)?

Offline

#2 2015-10-02 22:41:18

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,893

Re: GPU pass-through (to VM) with one of two identical Graphics Cards?

I think you have found a design flaw in vfio-pci / pci-stub modules.

The PCI ids they use are based on vendor:device , and as you discovered are not unique.
All cards from the same vendor with the same hardware share the same PCI id.

Easiest solution seems to be to replace one of the cards with another type, so host and guest card don't have the same card / pci id anymore.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2015-10-03 08:59:03

burnbabyburn71
Member
Registered: 2015-08-04
Posts: 25

Re: GPU pass-through (to VM) with one of two identical Graphics Cards?

Lone_Wolf wrote:

I think you have found a design flaw in vfio-pci / pci-stub modules.

The PCI ids they use are based on vendor:device , and as you discovered are not unique.
All cards from the same vendor with the same hardware share the same PCI id.

Easiest solution seems to be to replace one of the cards with another type, so host and guest card don't have the same card / pci id anymore.

Wow, I wish this flaw was mentioned somewhere before I tried this. Unless there is no other way to ID a PCI device, this is a pretty stupid flaw.

Offline

#4 2015-10-03 11:51:18

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,893

Re: GPU pass-through (to VM) with one of two identical Graphics Cards?

The only other way i know is using Bus ID , however they depend heavily on hardware configuation and can change between 1 boot and the next.
This does suggest that when vfio-pci / pci-stub were designed, no one considered the use case of having multiple devices with the same PCI IDs in one system.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2015-10-07 21:24:27

vivremetrique
Member
Registered: 2015-10-07
Posts: 5

Re: GPU pass-through (to VM) with one of two identical Graphics Cards?

Have either of you found a solution to this?
I tried using xen-pciback but I couldn't get it to work.

Offline

#6 2015-10-08 22:54:43

loqs
Member
Registered: 2014-03-06
Posts: 18,859

Re: GPU pass-through (to VM) with one of two identical Graphics Cards?

@vivremetrique have a look at http://vfio.blogspot.co.uk/2015/05/vfio … -host.html specifically the paragraph that starts "Another issue that users encounter when sequestering devices is what to do when there are multiple devices with the same vendor:device ID and some are intended to be used for the host."  Seems to document what you want to achieve.

Offline

#7 2015-10-19 18:57:52

vivremetrique
Member
Registered: 2015-10-07
Posts: 5

Re: GPU pass-through (to VM) with one of two identical Graphics Cards?

Hi. I ended up trying his script later and it worked! Thanks for your help anyway.

Offline

#8 2016-02-23 22:03:49

tanasis
Member
From: Delft
Registered: 2015-03-20
Posts: 6

Re: GPU pass-through (to VM) with one of two identical Graphics Cards?

@vivremetrique
Can you give details how you used that script? Thanks!

Offline

#9 2016-02-24 18:05:30

qKUqm3wtY4
Member
From: San Francisco
Registered: 2012-12-19
Posts: 60
Website

Re: GPU pass-through (to VM) with one of two identical Graphics Cards?

@vivremetrique I second that.  I'm trying to set this up as I type and I've got so many different options but all of the instructions are detailed enough. It would help the community to know what exactly to do.


I am a noob.  Ask me nothing.

Offline

#10 2016-02-29 23:54:28

tanasis
Member
From: Delft
Registered: 2015-03-20
Posts: 6

Re: GPU pass-through (to VM) with one of two identical Graphics Cards?

For those how are interested here is guide explaining how to do it: http://turlucode.com/qemu-kvm-on-arch-l … revfio-pci

Offline

Board footer

Powered by FluxBB