Jump to content
Skitals

[Plugin] VFIO-PCI Config

16 posts in this topic Last Reply

Recommended Posts

A plugin to create and modify vfio-pci.cfg from the unRAID webGui. Allows you to bind PCI devices by address to the vfio-pci driver. Also displays IOMMU groupings and which devices support reset. Unbound USB controllers display USB devices connected to them.

 

Bound devices will be available to pass through to your VMs under "Other PCI Devices" in the Edit VM Form View.

 

Please see the release notes for 6.7.0-rc1 for more information on this binding method.

 

 

Search for "VFIO-PCI Config" in Community Applications

 

Github repository: https://github.com/Skitals/unraid-vfio-pci/

URL for manual plugin install:

https://raw.githubusercontent.com/Skitals/unraid-vfio-pci/master/plugins/vfio.pci.plg

 

 

screenshot.png

Edited by Skitals
Now displays USB devices
  • Like 3
  • Thanks 3

Share this post


Link to post

The next version of the plugin I'm planning to list the usb devices connected to each usb controller to assist in selection of a usb controller for passthrough.

 

I would appreciate any other suggestions or feedback!

Share this post


Link to post

It now shows USB devices attached to each controller. If a USB controller is bound to vfio, the USB devices will not be visible.

screenshot.png

Share this post


Link to post

Hi,

tried to bind the built-in audio controller:
image.thumb.png.fe25c4156980267d938e77420b6b21af.png
 

But, at reboot, this is what i find as bindable devices:
image.png.10de59ea34b89234bb0d5739eb373a73.png

 

Any hints?
Thanks!

Edit: of course it previously showed up in the avaiable soundcards, but unusable.
Selecting it now (again, under the "Sound Card" section of configuration) the built in audio is now avaiable to the VM!!
THANKS!!!

When i'll have time i'll try to pass through the iGPU too, wich has been impossible with Ryzen APU so far.
I'll let you know.


Thanks again!

Edited by dhstsw

Share this post


Link to post
3 hours ago, dhstsw said:

When i'll have time i'll try to pass through the iGPU too, wich has been impossible with Ryzen APU so far.
I'll let you know.

 

Ok, this was a bad idea.

Windows VM started, didn't show anything and in the while parity disk and cache got corrupted.

I guess i forced things a bit too much :)

Share this post


Link to post
6 hours ago, dhstsw said:

Hi,

tried to bind the built-in audio controller:
image.thumb.png.fe25c4156980267d938e77420b6b21af.png
 

But, at reboot, this is what i find as bindable devices:
image.png.10de59ea34b89234bb0d5739eb373a73.png

 

Any hints?
Thanks!

Edit: of course it previously showed up in the avaiable soundcards, but unusable.
Selecting it now (again, under the "Sound Card" section of configuration) the built in audio is now avaiable to the VM!!
THANKS!!!

When i'll have time i'll try to pass through the iGPU too, wich has been impossible with Ryzen APU so far.
I'll let you know.


Thanks again!

Thanks for figuring that out, I guess my instructions are inaccurate. The plug-in only creates the vfio-pci.cfg for you, the rest is handled by unraid. Makes sense that "Other PCI Devices" would literally mean other than the device categories listed above 😄

Share this post


Link to post
3 hours ago, dhstsw said:

Ok, this was a bad idea.

Windows VM started, didn't show anything and in the while parity disk and cache got corrupted.

I guess i forced things a bit too much :)

Also note that according to the documentation, when you bind to vfio using this method, ALL the devices in the IOMMU group get bound. So in your case, even though you only selected one item, everything in group 3 will be available exclusively to vfio. That means the USB controllers in that group won't work in unraid. That is why those other devices appear under Other PCI Devices. You should be able to pass them to your VM. I would pass them all together since they are all functions of the same PCI device. If you experience problems with onboard audio in your VM, that's probably why. You should pass all 5 devices to the VM.

Edited by Skitals

Share this post


Link to post

Thanks for the clarification, i thought so.
Anyway, i just wanted to see if it was working.
I won't pass all those devices mainly because i don't know what they are (beside the USB controller).
Anyway, i'm waiting for a cheap USB audiocard from china, i'll use that.

Thanks again!

Share this post


Link to post

I currently have the below setup for my passthrough.

image.thumb.png.8198dc60c1d2af73f30c098384fac980.png

 

So my question is two fold.

If I use this plugin I can only assume I will not need to have them included in this line. Would that be correct?

Second question would be beside it being easier to use this plugin what other advantages does it have?

 

Cheers

Share this post


Link to post
2 hours ago, JWMutant said:

I currently have the below setup for my passthrough.

image.thumb.png.8198dc60c1d2af73f30c098384fac980.png

 

So my question is two fold.

If I use this plugin I can only assume I will not need to have them included in this line. Would that be correct?

Second question would be beside it being easier to use this plugin what other advantages does it have?

 

Cheers

If you have it working now, there is no reason to change it.

It's different methods and using the new method binds all devices in the group to vfio.

What the new method is good at is to only pass through one device vs all devices with the same vendor:id using the old method.

Share this post


Link to post
4 hours ago, dhstsw said:

Thanks for the clarification, i thought so.
Anyway, i just wanted to see if it was working.
I won't pass all those devices mainly because i don't know what they are (beside the USB controller).
Anyway, i'm waiting for a cheap USB audiocard from china, i'll use that.

Thanks again!

Just be aware that not all devices works well with pass through. So buying cheap from China might not be the best thing to do.

Share this post


Link to post
15 hours ago, JWMutant said:

I currently have the below setup for my passthrough.

image.thumb.png.8198dc60c1d2af73f30c098384fac980.png

 

So my question is two fold.

If I use this plugin I can only assume I will not need to have them included in this line. Would that be correct?

Second question would be beside it being easier to use this plugin what other advantages does it have?

 

Cheers

Basically what saarg said. Binding by id is perfect if it fits your use case. One downside of binding by address (this method) is it needs to be updated every time you change your pci hardware. A lot of boards these days have multiple devices with the same id, so binding by address is the only option. For example, every x570 board I've seen has 3 usb controllers with the same pci id. If you stub by id it stubs all 3, including the usb controller unraid needs.

 

I would like to think this plugin is still useful if you use vfio-pci.ids since it shows reset functionality and which usb devices are on which usb controllers--info otherwise not available in the webgui.

Share this post


Link to post
2 hours ago, Skitals said:

Basically what saarg said. Binding by id is perfect if it fits your use case. One downside of binding by address (this method) is it needs to be updated every time you change your pci hardware. A lot of boards these days have multiple devices with the same id, so binding by address is the only option. For example, every x570 board I've seen has 3 usb controllers with the same pci id. If you stub by id it stubs all 3, including the usb controller unraid needs.

 

I would like to think this plugin is still useful if you use vfio-pci.ids since it shows reset functionality and which usb devices are on which usb controllers--info otherwise not available in the webgui.

Showing reset and info about the usb devices/controllers is very good.

Share this post


Link to post

Just pushed out an update, it now shows if a device is currently bound to the vfio-pci driver.

 

(Green orb indicates vfio-pci driver is in use)

 

usb-screenshot.thumb.png.b68657bbcbe438124c14a2317b5a897f.png

 

 

Edited by Skitals
Screenshot

Share this post


Link to post

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.