pciattach Intel HD Iris

Discussions related to using VirtualBox on Linux hosts.
Post Reply
GrayBoltWolf
Posts: 3
Joined: 14. Sep 2015, 02:24

pciattach Intel HD Iris

Post by GrayBoltWolf »

So I am trying to attach my Intel iGPU to a windows 8.1 VM. I have a GTX 970 as my primary GPU, so I would like to pass the iGPU to a windows VM for hardware acceleration. I have IOMMU enabled and working, and I am at the stage of attaching the iGPU to the VM. When I enter the command

Code: Select all

VBoxManage modifyvm "win8" --pciattach 00:02.0@01:05.0 
It doesn't return anything like a success or failure. Nothing changes on the VM when I boot it and nothing has changed in the settings. If I detach it with

Code: Select all

VBoxManage modifyvm "win8" --pcidetach 00:02.0@01:05.0
Then it returns :

Code: Select all

gray@Rava-Xubuntu:~$ VBoxManage modifyvm "win8" --pcidetach 00:02.0@01:05.0
VBoxManage: error: No host PCI device 00000010 attached
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "DetachHostPCIDevice(iHostAddr)" at line 2981 of file VBoxManageModifyVM.cpp
Any help would be much appreciated. This is version 5.0.4 from the official oracle download page, and the host OS is Xubuntu 14.04.3.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: pciattach Intel HD Iris

Post by noteirak »

This is not an answer but merely a disclaimer: keep in mind that PCI pass-through is very experimental and only a handful of feedbacks were ever given.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
GrayBoltWolf
Posts: 3
Joined: 14. Sep 2015, 02:24

Re: pciattach Intel HD Iris

Post by GrayBoltWolf »

noteirak wrote:This is not an answer but merely a disclaimer: keep in mind that PCI pass-through is very experimental and only a handful of feedbacks were ever given.
I am quite aware that this is a relatively unsupported thing. Just looking for any help at all.

Seems strange that VBoxManager doesn't really return anything in the way of errors.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: pciattach Intel HD Iris

Post by noteirak »

Trying to reproduce on my machine, this is what I get:

List of PCI devices, let's use 01:00.0 being my 3D card:

Code: Select all

noteirak@Max-Laptop-Linux ~ $ lspci
[...]
01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 860M] (rev ff)
[...]
Let's create a VM for the occasion and set chipset type to ICH9 (required for PCI attach)

Code: Select all

noteirak@Max-Laptop-Linux ~ $ vboxmanage unregistervm test --delete
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
noteirak@Max-Laptop-Linux ~ $ vboxmanage createvm --name test --register
Virtual machine 'test' is created and registered.
UUID: b77218bd-1b50-46a2-b357-87320aad1338
Settings file: '/home/noteirak/VMs/test/test.vbox'
noteirak@Max-Laptop-Linux ~ $ vboxmanage modifyvm test --chipset ich9
*** I/O APIC must be enabled for ICH9, enabling. ***
Let's try to attach & detach the PCI device:

Code: Select all

noteirak@Max-Laptop-Linux ~ $ vboxmanage modifyvm test --pciattach 01:00.0
noteirak@Max-Laptop-Linux ~ $ vboxmanage modifyvm test --pcidetach 01:00.0
VBoxManage: error: No host PCI device 00000100 attached
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "DetachHostPCIDevice(iHostAddr)" at line 2981 of file VBoxManageModifyVM.cpp
So indeed, it doesn't seem to find it, and interesting that the report host PCI device is "00000100" in the error message, while the adress 01:00.0 is used. At this point I start suspecting a bug.

Let's check the VM config to see if it was added in any way:

Code: Select all

noteirak@Max-Laptop-Linux ~ $ grep -iF -A 5 "<hostpci>" /home/noteirak/VMs/test/test.vbox
      <HostPci>
        <Devices>
          <Device host="256" guest="256" name="host01:00.0"/>
        </Devices>
      </HostPci>
      <EmulatedUSB>
So we do have a configuration entry for the PCI device.

Finally, let's see if we have a PCI entry in the VM config with the --machinereadable options so we get the raw output:

Code: Select all

noteirak@Max-Laptop-Linux ~ $ vboxmanage showvminfo test --machinereadable | grep -i pci
AttachedHostPCI=ff:1f.7,ff:1f.7
Indeed we do.

The address seems to be changed by internal mechanism (the numbers 256 seem to play a role in this). Let's use that address instead and see if we can detach:

Code: Select all

noteirak@Max-Laptop-Linux ~ $ vboxmanage modifyvm test --pcidetach ff:1f.7
VBoxManage: error: No host PCI device 0000ffff attached
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "DetachHostPCIDevice(iHostAddr)" at line 2981 of file VBoxManageModifyVM.cpp
No dice. so something is definitly fishy here. One last test to confirm a bug:

Code: Select all

noteirak@Max-Laptop-Linux ~ $ vboxmanage modifyvm test --pciattach 01:00.0
noteirak@Max-Laptop-Linux ~ $ 
so I am able to add the same device twice which should not be possible - a check exists in the source code but seems broken then.

Let's recheck the VM config:

Code: Select all

noteirak@Max-Laptop-Linux ~ $ grep -iF -A 5 "<hostpci>" /home/noteirak/VMs/test/test.vbox
      <HostPci>
        <Devices>
          <Device host="256" guest="256" name="host01:00.0"/>
          <Device host="256" guest="256" name="host01:00.0"/>
        </Devices>
      </HostPci>
I will open a ticket on the Bugtracker about this and report back the ticket number.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
GrayBoltWolf
Posts: 3
Joined: 14. Sep 2015, 02:24

Re: pciattach Intel HD Iris

Post by GrayBoltWolf »

noteirak wrote:Trying to reproduce on my machine, this is what I get:

....

I will open a ticket on the Bugtracker about this and report back the ticket number.
Do you know if this used to work on a previous version?

Also, thanks for trying to reproduce it. I really appreciate the help.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: pciattach Intel HD Iris

Post by noteirak »

GrayBoltWolf wrote:Do you know if this used to work on a previous version?
Yes it used to work before, but it has been a while since someone posted about this with something that can be called "working".
I'm in the process of trying other versions and see when it broke.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: pciattach Intel HD Iris

Post by noteirak »

So it works in 4.3.30 and never worked in 5.0.x
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: pciattach Intel HD Iris

Post by noteirak »

Reported in ticket #14584
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply