q35 Nvida Bus Slot Allocation


Recommended Posts

It is suggested to edit it manually in the xml view, so to be able to set the gpu correctly as multifunction.

As far as the code, take as an example these blocks, referring to my 6900 xt:

    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0' multifunction='on'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x06' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x1'/>
    </hostdev>

 

This includes 2 hostdev blocks, one for the video and one for the digital audio.

As far as buses/slots/functions: each hostdev block has 2 lines with "address"; the address line inside <source></source> is the address of the gpu in the host, the address unraid sees, in this case video is at source address 06:00.0 (video), audio is at 06:00.1 (audio). This address depends only the physical slot (it's the output of the lspci command).

The address line outside <source></source> is the address of the gpu you set in the vm: so you can change this as you want; in this case I set it to be at address 03:00.0 (video) and 03:00.1 (audio).

 

In the vm, for a q35 machine type you attach devices usually to pcie-root-port(s), this means that in this example to attach the gpu in the vm at address 03:00.0/1 you need a pcie-root-port defined with index 3 (same number as the target bus number):

    <controller type='pci' index='3' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='3' port='0xc' hotplug='off'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.