You are not logged in.

#1 2016-02-16 01:41:57

Bordermick
Member
Registered: 2016-02-16
Posts: 2

Both GPU's have same PCI ID

So I have been attempting to pass through one of my 760's to use in a VM in Arch GNU/Linux using the guide found in this reddit post . Everything has gone smoothly so far except for the fact that when I run:

lspci -nnk

I get this:

01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK104 [GeForce GTX 760] [10de:1187] (rev a1)
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:360b]
	Kernel driver in use: nvidia
	Kernel modules: nouveau, nvidia
01:00.1 Audio device [0403]: NVIDIA Corporation GK104 HDMI Audio Controller [10de:0e0a] (rev a1)
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:360b]
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel
02:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK104 [GeForce GTX 760] [10de:1187] (rev a1)
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:360b]
	Kernel driver in use: nvidia
	Kernel modules: nouveau, nvidia
02:00.1 Audio device [0403]: NVIDIA Corporation GK104 HDMI Audio Controller [10de:0e0a] (rev a1)
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:360b]
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel

The issue is that both GPU's have the same PCI ID (10de:1187, 10de:0e0a). This is stopping me from binding only the second card to pci-stub so the nvidia driver wont use it, and I can then pass it through to a VM. When I try binding the two given id's to pci-stub it stops nvidia from using both cards, and when I run "startx" it errors. I also compiled the linux-vfio kernel and I am currently using that.
Does anyone know a way to get the GPU's to have different PCI ID's? Any help would be appreciated, thanks in advance.

Offline

#2 2016-02-16 09:17:09

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Both GPU's have same PCI ID

To change PCI IDs on NVIDIA cards persistently, you'd need to modify strap resistors - something people are doing to turn  GeForces into Quadros smile

A somewhat simpler solution is to unbind the nvidia driver at runtime:

echo -n 0000:02:00.0 > /sys/bus/pci/drivers/nvidia/unbind
echo -n 0000:02:00.1 > /sys/bus/pci/drivers/nvidia/unbind

You can then repeat the same with drivers/pci-stub/bind to bind pci-stub instead, but I'm not even sure if this is required.

Offline

#3 2016-02-17 03:31:06

Bordermick
Member
Registered: 2016-02-16
Posts: 2

Re: Both GPU's have same PCI ID

mich41 wrote:

To change PCI IDs on NVIDIA cards persistently, you'd need to modify strap resistors - something people are doing to turn  GeForces into Quadros smile

A somewhat simpler solution is to unbind the nvidia driver at runtime:

echo -n 0000:02:00.0 > /sys/bus/pci/drivers/nvidia/unbind
echo -n 0000:02:00.1 > /sys/bus/pci/drivers/nvidia/unbind

You can then repeat the same with drivers/pci-stub/bind to bind pci-stub instead, but I'm not even sure if this is required.

Thanks for the response! (Sorry for the late one tongue)

I tried putting these commands in ~/.xinitrc and when I run the lspci -nnk command (after running startx), it says the card is still in use by the nvidia driver. Should I be putting them elsewhere?

Edit: Im also pretty sure I have to be unbinding the audio (0000:02:00.1) using

echo -n 0000:02:00.1 > /sys/bus/pci/drivers/snd_hda_intel/unbind

instead because the audio doesn't use the nvidia driver.

Last edited by Bordermick (2016-02-17 03:36:05)

Offline

#4 2016-02-17 09:05:48

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Both GPU's have same PCI ID

You have to run this as root, there should be some way to have systemd execute this during bootup. And yes, you are right about this snd_hda_intel thing.

Offline

#5 2016-02-17 16:20:27

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

Re: Both GPU's have same PCI ID

vfio-gpu-how-to-series-part-3-host
covers a different method to achieve this using a script file called by modprobe's install option.

Offline

Board footer

Powered by FluxBB