Page 1 of 1

PCI Attach yielding unfavorable problems

Posted: 30. Oct 2016, 03:47
by GarbageSauce
Hello everybody. I installed Ubuntu 16.04 on my external hard drive for the sole purpose of being able to pass my GPU through to a VM running Windows XP Professional x64. I installed the expansion pack, changed the chipset to ICH9, etc etc. I found my GPU using the lspci command, referred to the virtualbox page on pci attaching extensively, used the command --pciattach appropriately and all I get is an error when I try to start the VM. I have the log attached.

Just for your info, I also tried creating a VM as root, attaching the PCI card as root, and running the VM as root. Nothing. Any ideas?

Re: PCI Attach yielding unfavorable problems

Posted: 30. Oct 2016, 04:15
by Perryg
Post the results of the following from the host terminal:

Code: Select all

cat /var/log/dmesg | grep iommu
Also do you have dual GPU in the host?

Re: PCI Attach yielding unfavorable problems

Posted: 30. Oct 2016, 07:03
by socratis
GarbageSauce wrote:I installed Ubuntu 16.04 on my external hard drive for the sole purpose of being able to pass my GPU through to a VM running Windows XP Professional x64.
Can you please explain to me the relationship of these two statements? How installing your OS in an external HD is going to make the PCI passthrough happen?

Re: PCI Attach yielding unfavorable problems

Posted: 30. Oct 2016, 18:10
by GarbageSauce
Perryg wrote:Post the results of the following from the host terminal:

Code: Select all

cat /var/log/dmesg | grep iommu
Also do you have dual GPU in the host?
I copied line of code into the terminal and nothing happened. Nothing appears in the log either. I even tried running it as root. And as for dual GPU, no. My CPU has a version of Intel's Integrated Graphics but my monitor is plugged directly into my GTX 970.
socratis wrote:
GarbageSauce wrote:I installed Ubuntu 16.04 on my external hard drive for the sole purpose of being able to pass my GPU through to a VM running Windows XP Professional x64.
Can you please explain to me the relationship of these two statements? How installing your OS in an external HD is going to make the PCI passthrough happen?
The VirtualBox documentation says that PCI Passthrough's only exist on Linux hosts. I have Windows on my internal HDD and I'd rather keep things organized so I installed Ubuntu on my external HDD.

Re: PCI Attach yielding unfavorable problems

Posted: 30. Oct 2016, 18:16
by Perryg
OK so the hosts CPU must support iommu and then you must manually turn that on in your boot loader because it is not by default. That said if you only have one GPU you are never going to get this to work because the host would have the GPU ripped from it when you try to use it on the guest.

Re: PCI Attach yielding unfavorable problems

Posted: 30. Oct 2016, 18:23
by GarbageSauce
I enabled IOMMU in the bootloader but I have no idea if my CPU supports it. But when it comes to dual GPU, are you sure that is a requirement? Should I plug my monitor into my mobo in stead of my PCI card and try that?

EDIT: I looked up my CPU model and it does appear to support IOMMU.

Re: PCI Attach yielding unfavorable problems

Posted: 30. Oct 2016, 18:32
by Perryg
are you sure that is a requirement?
Pretty sure as I have done this in the past and had the same results. PCI devices can not be shared at a low level. Look up your CPU and see if VT-d is supported. I might also add that very few have actually gotten this to work. Besides myself I can only remember two others, and it took me several days to figure it all out. Even after that I never figured out why I actually needed it. I do like a good challenge and justified my work load due to that. Maybe for playing games but I don't so there you have it.

Re: PCI Attach yielding unfavorable problems

Posted: 30. Oct 2016, 18:34
by Perryg
By the way this is what will show when you actually get iommu to work in the host.

Code: Select all

perry@perry-main ~ $ cat /var/log/dmesg | grep iommu
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-38-generic root=UUID=3b2389fb-b935-43c0-b365-d17297e57c90 ro quiet splash intel_iommu=on intremap=no_x2apic_optout vt.handoff=7
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-38-generic root=UUID=3b2389fb-b935-43c0-b365-d17297e57c90 ro quiet splash intel_iommu=on intremap=no_x2apic_optout vt.handoff=7
[    0.663353] iommu: Adding device 0000:ff:0b.0 to group 0
[    0.663363] iommu: Adding device 0000:ff:0b.1 to group 0
[    0.663372] iommu: Adding device 0000:ff:0b.2 to group 0
[    0.663420] iommu: Adding device 0000:ff:0c.0 to group 1
[    0.663430] iommu: Adding device 0000:ff:0c.1 to group 1
[    0.663439] iommu: Adding device 0000:ff:0c.2 to group 1
[    0.663449] iommu: Adding device 0000:ff:0c.3 to group 1
[    0.663459] iommu: Adding device 0000:ff:0c.4 to group 1
[    0.663468] iommu: Adding device 0000:ff:0c.5 to group 1
[    0.663509] iommu: Adding device 0000:ff:0f.0 to group 2
[    0.663519] iommu: Adding device 0000:ff:0f.1 to group 2
[    0.663555] iommu: Adding device 0000:ff:0f.4 to group 2
[    0.663565] iommu: Adding device 0000:ff:0f.5 to group 2
[    0.663575] iommu: Adding device 0000:ff:0f.6 to group 2
[    0.663617] iommu: Adding device 0000:ff:10.0 to group 3
[    0.663628] iommu: Adding device 0000:ff:10.1 to group 3
[    0.663638] iommu: Adding device 0000:ff:10.5 to group 3
[    0.663648] iommu: Adding device 0000:ff:10.6 to group 3
[    0.663658] iommu: Adding device 0000:ff:10.7 to group 3
[    0.663681] iommu: Adding device 0000:ff:12.0 to group 4
[    0.663692] iommu: Adding device 0000:ff:12.1 to group 4
[    0.663752] iommu: Adding device 0000:ff:13.0 to group 5
[    0.663762] iommu: Adding device 0000:ff:13.1 to group 5
[    0.663773] iommu: Adding device 0000:ff:13.2 to group 5
[    0.663784] iommu: Adding device 0000:ff:13.3 to group 5
[    0.663795] iommu: Adding device 0000:ff:13.4 to group 5
[    0.663806] iommu: Adding device 0000:ff:13.5 to group 5
[    0.663816] iommu: Adding device 0000:ff:13.6 to group 5
[    0.663827] iommu: Adding device 0000:ff:13.7 to group 5
[    0.663888] iommu: Adding device 0000:ff:14.0 to group 6
[    0.663899] iommu: Adding device 0000:ff:14.1 to group 6
[    0.663910] iommu: Adding device 0000:ff:14.2 to group 6
[    0.663922] iommu: Adding device 0000:ff:14.3 to group 6
[    0.663933] iommu: Adding device 0000:ff:14.4 to group 6
[    0.663944] iommu: Adding device 0000:ff:14.5 to group 6
[    0.663956] iommu: Adding device 0000:ff:14.6 to group 6
[    0.663968] iommu: Adding device 0000:ff:14.7 to group 6
[    0.664004] iommu: Adding device 0000:ff:15.0 to group 7
[    0.664016] iommu: Adding device 0000:ff:15.1 to group 7
[    0.664028] iommu: Adding device 0000:ff:15.2 to group 7
[    0.664041] iommu: Adding device 0000:ff:15.3 to group 7
[    0.664069] iommu: Adding device 0000:ff:16.0 to group 8
[    0.664081] iommu: Adding device 0000:ff:16.6 to group 8
[    0.664093] iommu: Adding device 0000:ff:16.7 to group 8
[    0.664134] iommu: Adding device 0000:ff:17.0 to group 9
[    0.664147] iommu: Adding device 0000:ff:17.4 to group 9
[    0.664160] iommu: Adding device 0000:ff:17.5 to group 9
[    0.664172] iommu: Adding device 0000:ff:17.6 to group 9
[    0.664184] iommu: Adding device 0000:ff:17.7 to group 9
[    0.664226] iommu: Adding device 0000:ff:1e.0 to group 10
[    0.664239] iommu: Adding device 0000:ff:1e.1 to group 10
[    0.664252] iommu: Adding device 0000:ff:1e.2 to group 10
[    0.664264] iommu: Adding device 0000:ff:1e.3 to group 10
[    0.664278] iommu: Adding device 0000:ff:1e.4 to group 10
[    0.664300] iommu: Adding device 0000:ff:1f.0 to group 11
[    0.664314] iommu: Adding device 0000:ff:1f.2 to group 11
[    0.664324] iommu: Adding device 0000:00:00.0 to group 12
[    0.664336] iommu: Adding device 0000:00:01.0 to group 13
[    0.664347] iommu: Adding device 0000:00:01.1 to group 14
[    0.664359] iommu: Adding device 0000:00:03.0 to group 15
[    0.664395] iommu: Adding device 0000:00:05.0 to group 16
[    0.664411] iommu: Adding device 0000:00:05.1 to group 16
[    0.664425] iommu: Adding device 0000:00:05.2 to group 16
[    0.664439] iommu: Adding device 0000:00:05.4 to group 16
[    0.664463] iommu: Adding device 0000:00:11.0 to group 17
[    0.664477] iommu: Adding device 0000:00:11.4 to group 17
[    0.664488] iommu: Adding device 0000:00:14.0 to group 18
[    0.664505] iommu: Adding device 0000:00:16.0 to group 19
[    0.664515] iommu: Adding device 0000:00:1a.0 to group 20
[    0.664525] iommu: Adding device 0000:00:1b.0 to group 21
[    0.664536] iommu: Adding device 0000:00:1c.0 to group 22
[    0.664546] iommu: Adding device 0000:00:1c.2 to group 23
[    0.664557] iommu: Adding device 0000:00:1c.3 to group 24
[    0.664568] iommu: Adding device 0000:00:1c.4 to group 25
[    0.664578] iommu: Adding device 0000:00:1d.0 to group 26
[    0.664607] iommu: Adding device 0000:00:1f.0 to group 27
[    0.664622] iommu: Adding device 0000:00:1f.2 to group 27
[    0.664637] iommu: Adding device 0000:00:1f.3 to group 27
[    0.664664] iommu: Adding device 0000:03:00.0 to group 28
[    0.664683] iommu: Adding device 0000:03:00.1 to group 28
[    0.664694] iommu: Adding device 0000:05:00.0 to group 29
[    0.664704] iommu: Adding device 0000:06:00.0 to group 30
[    0.664714] iommu: Adding device 0000:07:00.0 to group 31
perry@perry-main ~ $ 

Re: PCI Attach yielding unfavorable problems

Posted: 30. Oct 2016, 18:42
by GarbageSauce
I understand your concern. I would rather do this, be successful, brag, and play all my super old games that require an actual GPU than spend money on an entirely different computer. Just bear with me.

My mobo and CPU both support VT-d and IOMMU. However, I did not see anything for IOMMU in the bios. Is there a command for Linux I can use to enable it manually?

Re: PCI Attach yielding unfavorable problems

Posted: 30. Oct 2016, 18:57
by Perryg
I have no idea about your bios. I do know if the CPU supports it and the bios also does then adding "intel_iommu=on" to the boot line will turn it on. After that you would see something like I posted above. To find out about your bios you would need to contact your MB manufacture.

Note VT-d = iommu ( Intel ) or AMD IOV ( AMD ) so you would see VT-d or IOV in your bios

Re: PCI Attach yielding unfavorable problems

Posted: 30. Oct 2016, 19:26
by GarbageSauce
I don't get it. My bios says my CPU supports VT-d and I have it enabled. I added "intel_iommu=on" to the boot line and still no change.

Re: PCI Attach yielding unfavorable problems

Posted: 30. Oct 2016, 20:03
by Perryg
Not much else I can tell you about the hardware level or the host, other than what I have already said. Perhaps you should ask the OS distro for assistance if you are sure everything is satisfied in regards to the hardware. Since the log you provided does not show the actual CPU I can not tell you if it does or not. Perhaps if you run "cat /proc/cpuinfo" in the host you could tell more.

Re: PCI Attach yielding unfavorable problems

Posted: 2. Nov 2016, 11:37
by michaln
GarbageSauce wrote:I installed Ubuntu 16.04 on my external hard drive for the sole purpose of being able to pass my GPU through to a VM running Windows XP Professional x64.
It's not expected to work, so unfortunately you wasted your time.

Re: PCI Attach yielding unfavorable problems

Posted: 2. Nov 2016, 16:23
by GarbageSauce
michaln wrote:
GarbageSauce wrote:I installed Ubuntu 16.04 on my external hard drive for the sole purpose of being able to pass my GPU through to a VM running Windows XP Professional x64.
It's not expected to work, so unfortunately you wasted your time.
Wow you're not helpful. I will not rest until I get this to work. If it requires a different CPU or mobo, I will buy one. I have yet to ask for assistance from the distro. But for now, I think we are done here. Thanks for all of your help guys!

Re: PCI Attach yielding unfavorable problems

Posted: 2. Nov 2016, 16:45
by mpack
If giving you the truth is not helpful then I take it you would prefer if we lied, and wasted your time some more?

Even if you got PCI passthrough working, you can't pass through a device that the host is already using, and expect your PC to work afterwards. I assume that your host is using your GTX graphics card and that the onboard Intel graphics was automatically disabled when a graphics card was detected. In which case what you are attempting is not possible.