Skitals Posted January 15, 2020 Share Posted January 15, 2020 (edited) 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 Edited January 16, 2020 by Skitals Now displays USB devices 3 4 Quote Link to comment
Skitals Posted January 15, 2020 Author Share Posted January 15, 2020 Now available in Community Applications! Search for "VFIO-PCI Config" Quote Link to comment
Skitals Posted January 16, 2020 Author Share Posted January 16, 2020 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! Quote Link to comment
burkasaurusrex Posted January 16, 2020 Share Posted January 16, 2020 Awesome, will definitely give this a try. It would be cool to be able to unbind devices / rebind them to vfio-pci without rebooting. Maybe something like this would help? https://github.com/PassthroughPOST/VFIO-Tools/blob/master/vfioselect/vfioselect Quote Link to comment
Skitals Posted January 16, 2020 Author Share Posted January 16, 2020 It now shows USB devices attached to each controller. If a USB controller is bound to vfio, the USB devices will not be visible. 1 Quote Link to comment
dhstsw Posted January 17, 2020 Share Posted January 17, 2020 (edited) Hi, tried to bind the built-in audio controller: But, at reboot, this is what i find as bindable devices: 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 January 17, 2020 by dhstsw Quote Link to comment
dhstsw Posted January 17, 2020 Share Posted January 17, 2020 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 Quote Link to comment
Skitals Posted January 17, 2020 Author Share Posted January 17, 2020 6 hours ago, dhstsw said: Hi, tried to bind the built-in audio controller: But, at reboot, this is what i find as bindable devices: 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 😄 Quote Link to comment
Skitals Posted January 17, 2020 Author Share Posted January 17, 2020 (edited) 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 January 17, 2020 by Skitals Quote Link to comment
dhstsw Posted January 17, 2020 Share Posted January 17, 2020 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! Quote Link to comment
JWMutant Posted January 17, 2020 Share Posted January 17, 2020 I currently have the below setup for my passthrough. 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 Quote Link to comment
saarg Posted January 17, 2020 Share Posted January 17, 2020 2 hours ago, JWMutant said: I currently have the below setup for my passthrough. 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. Quote Link to comment
saarg Posted January 17, 2020 Share Posted January 17, 2020 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. Quote Link to comment
Skitals Posted January 18, 2020 Author Share Posted January 18, 2020 15 hours ago, JWMutant said: I currently have the below setup for my passthrough. 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. Quote Link to comment
saarg Posted January 18, 2020 Share Posted January 18, 2020 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. 1 Quote Link to comment
Skitals Posted January 20, 2020 Author Share Posted January 20, 2020 (edited) 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) Edited January 20, 2020 by Skitals Screenshot 1 Quote Link to comment
ingux16 Posted February 2, 2020 Share Posted February 2, 2020 (edited) This plugin screwed up my raid 0 cache disks due plugin binding only by hardware address. Problem with this plugin is do binding only by hardware address , everything could be fine and it works. But.. if you for example like me use cache disks as nvme drives, so drives uses pciexpress slots, so it uses hardware addresses. And if you for example remove some pci express devices then often motherboard change hardware addreses for all other pci devices. In my case i removed gpu from one slot and then my cache drive hardware address changed to another one binded by this plugin from another device. Obviously after restart cache drive was corupted because being binded by plugin. I sugest could you upgrade plugin and do binding by hardware address with device ids as well so it will eliminate wrong device rebinding if you add/remove some pci express device. Justr sugestion, but it might affect functionality P.S. Read comments before, so i just explained real situation and problem after Edited February 2, 2020 by ingux16 Quote Link to comment
saarg Posted February 2, 2020 Share Posted February 2, 2020 29 minutes ago, ingux16 said: This plugin screwed up my raid 0 cache disks due plugin binding only by hardware address. Problem with this plugin is do binding only by hardware address , everything could be fine and it works. But.. if you for example like me use cache disks as nvme drives, so drives uses pciexpress slots, so it uses hardware addresses. And if you for example remove some pci express devices then often motherboard change hardware addreses for all other pci devices. In my case i removed gpu from one slot and then my cache drive hardware address changed to another one binded by this plugin from another device. Obviously after restart cache drive was corupted because being binded by plugin. I sugest could you upgrade plugin and do binding by hardware address with device ids as well so it will eliminate wrong device rebinding if you add/remove some pci express device. Justr sugestion, but it might affect functionality P.S. Read comments before, so i just explained real situation and problem after I'm sorry, but this is not the fault of the plugin. The plugin is just a frontend to the new bind method added to unraid. If you would have edited the config file yourself, the same would happen. This method uses the PCI number and will most likely change if you rearrange hardware. You can't use both the PCI number and the device ID with this method. I don't see how binding the cache drive to vfio corrupted your cache drive either. It's simply just binding the device to a dummy driver so it's not used by anything else. Quote Link to comment
bastl Posted February 2, 2020 Share Posted February 2, 2020 I think this plugin can be really dangerous for some users which don't know what they are doing. As explained above it's easy to bind a controller for your storage and after next server restart you have a big problem. It's easy to tick a couple check boxes and hit apply, maybe it's to easy for some people to screw up their setups. Maybe as an idea change the plugin so it shows on default only let's say VGA, SOUND and USB controllers, even if the last one if the Unraid usb stick is connected to, can be a problem if the controller is bound to vfio and hide all other devices in an advanced section with some big warnings. The [RESET] feature of a device is also really important for users to understand. If a let's say USB controller isn't able to be reset, after a restart of the VM using the controller, it will stop working until you restart the whole server. Quote Link to comment
Overlandr Posted April 3, 2020 Share Posted April 3, 2020 (edited) I was using this plugin for passing through one of my graphics cards and it has been rebooting for significantly longer than normal, is there a reason for this. Its over 1100s now. Edit: I did get a backup of the USB just before I did this, just in case. Edited April 3, 2020 by Matt Dumbrill Add for edit Quote Link to comment
Overlandr Posted April 3, 2020 Share Posted April 3, 2020 47 minutes ago, Matt Dumbrill said: I was using this plugin for passing through one of my graphics cards and it has been rebooting for significantly longer than normal, is there a reason for this. Its over 1100s now. Edit: I did get a backup of the USB just before I did this, just in case. I got it up and running again by removing the GPU which I changed the config for. Going to look for an alternative method for passthrough due to the previous as I'm not exactly sure what I'm doing and don't want to completely break my NAS. Quote Link to comment
ljm42 Posted April 4, 2020 Share Posted April 4, 2020 On 4/3/2020 at 12:10 PM, Matt Dumbrill said: I was using this plugin for passing through one of my graphics cards and it has been rebooting for significantly longer than normal, is there a reason for this. Its over 1100s now. If the system won't boot you need to plug in a monitor and look at the errors on screen. But it sounds like the device you are trying to bind is needed by Unraid and won't be available for passthru. Quote Link to comment
Overlandr Posted April 5, 2020 Share Posted April 5, 2020 17 hours ago, ljm42 said: If the system won't boot you need to plug in a monitor and look at the errors on screen. But it sounds like the device you are trying to bind is needed by Unraid and won't be available for passthru. Still trying to get some sort of passthough to work, but there is no error screen as there is no output from either gpu. Is there a way of deleting this config, so I can I can try another way as it doent allow me to even look at the UI with both GPUs in. Quote Link to comment
ljm42 Posted April 5, 2020 Share Posted April 5, 2020 55 minutes ago, Matt Dumbrill said: Still trying to get some sort of passthough to work, but there is no error screen as there is no output from either gpu. Is there a way of deleting this config, so I can I can try another way as it doent allow me to even look at the UI with both GPUs in. Sure, on the flash drive delete the file /config/vfio-pci.cfg Note that this plugin is just a front-end that writes the config file for you. More details about the config file here: Quote Link to comment
L0rdRaiden Posted April 10, 2020 Share Posted April 10, 2020 (edited) I have this right now in my syslinux file Quote kernel /bzimage append isolcpus=0-1,4-5 amd_iommu=pt kvm_amd.avic=1 kvm_amd.npt=1 kvm_amd.nested=0 pcie_acs_override=downstream,multifunction vfio-pci.ids=8086:1521 pcie_aspm=off initrd=/bzroot If I want to use this new method what do I need to remove from here? just this (vfio-pci.ids=8086:1521) or something else? I'm doing passthrough of a pcie network card with 2 nics. If I do the passthrough using this method (vfio-pci.cfg) all the other options of my syslinux config file still applies? Thanks in advance. Edited April 10, 2020 by L0rdRaiden Quote Link to comment
Recommended Posts
Posted by Squid,
2 reactions
Go to this 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.