{"id":16357989,"url":"https://github.com/andre-richter/vfio-pci-bind","last_synced_at":"2025-09-11T18:50:16.072Z","repository":{"id":46191712,"uuid":"42452957","full_name":"andre-richter/vfio-pci-bind","owner":"andre-richter","description":"Automatically bind a PCI device and all of it's IOMMU group members to vfio-pci","archived":false,"fork":false,"pushed_at":"2023-12-18T06:54:38.000Z","size":25,"stargazers_count":117,"open_issues_count":4,"forks_count":26,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-11T02:53:33.600Z","etag":null,"topics":["bind","iommu-group","pci","pcie","script","sr-iov","vfio","vfio-pci"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andre-richter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["andre-richter"]}},"created_at":"2015-09-14T14:15:55.000Z","updated_at":"2025-09-06T20:28:14.000Z","dependencies_parsed_at":"2024-10-27T10:58:18.524Z","dependency_job_id":"fa0c1818-68d3-422e-a21c-f5520d778dba","html_url":"https://github.com/andre-richter/vfio-pci-bind","commit_stats":{"total_commits":16,"total_committers":4,"mean_commits":4.0,"dds":0.5,"last_synced_commit":"b41e4545b21de434fc51a34a9bf1d72e3ac66cc8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andre-richter/vfio-pci-bind","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-richter%2Fvfio-pci-bind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-richter%2Fvfio-pci-bind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-richter%2Fvfio-pci-bind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-richter%2Fvfio-pci-bind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andre-richter","download_url":"https://codeload.github.com/andre-richter/vfio-pci-bind/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-richter%2Fvfio-pci-bind/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274690022,"owners_count":25331898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bind","iommu-group","pci","pcie","script","sr-iov","vfio","vfio-pci"],"created_at":"2024-10-11T02:04:37.122Z","updated_at":"2025-09-11T18:50:15.922Z","avatar_url":"https://github.com/andre-richter.png","language":"Shell","funding_links":["https://github.com/sponsors/andre-richter"],"categories":[],"sub_categories":[],"readme":"# vfio-pci-bind\n\nThis script takes one or two parameters in any order:\n\n- `Vendor:Device` i.e. `vvvv:dddd`\n- `Domain:Bus:Device.Function` i.e. `dddd:vv:dd.f`\n\nand then:\n\n1. If both `Vendor:Device` and `Domain:Bus:Device.Function` were provided, validate that the requested `Vendor:Device` exists at `Domain:Bus:Device.Function`\n\n   If only `Vendor:Device` was provided, determine the current `Domain:Bus:Device.Function` for that device.\n\n   If only `Domain:Bus:Device.Function` was provided, use it.\n\n2. Unbinds all devices that are in the same iommu group as the supplied device from their current driver (except PCIe bridges).\n\n3. Binds to vfio-pci:\n\n   1. The supplied device.\n   2. All devices that are in the same iommu group.\n\n4. Transfers ownership of the respective iommu group inside /dev/vfio to \\$SUDO_USER\n\nSuggestions:\n\n- If you have a single piece of hardware with a given `Vendor:Device`, you can call the script like this:\n\n  `vfio-pci-bind.sh Vendor:Device`\n\n  The script will target that device regardless of how the PCI address might change due to the addition or removal of other hardware.\n\n- If you have multiple pieces of hardware with the same `Vendor:Device` code, you need to pass the PCI address as well:\n\n  `vfio-pci-bind.sh Vendor:Device Domain:Bus:Device.Function`\n\n  This will ensure the correct instance of the hardware is bound to vfio-pci.\n\n  Note: If the PCI address for this device changes as a result of adding or removing hardware, you will need to update the PCI address in this call.\n\n- For backwards compatibility you can also specify just the PCI address:\n\n  `vfio-pci-bind.sh Domain:Bus:Device.Function`\n\n  Note: If you add or remove hardware, the device associated with that PCI address can change resulting in the wrong device being bound to vfio-pci. Consider passing the `Vendor:Device` as well.\n\n**Script must be executed via sudo!**\n\n## Automatically binding devices on boot\n\nDevices can be automatically bound to `vfio-pci` on boot using the supplied `25-vfio-pci-bind.rules` udev rules file.\n1. Copy `vfio-pci-bind.sh` to `/lib/udev/` and ensure it is marked executable.\n2. Copy `25-vfio-pci-bind.rules` to `/etc/udev/rules.d/`\n3. Edit `/etc/udev/rules.d/25-vfio-pci-bind.rules` and add PCI device matching rules following the examples in the file.\n4. Reboot.\n\n## License\n\nSee supplied LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandre-richter%2Fvfio-pci-bind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandre-richter%2Fvfio-pci-bind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandre-richter%2Fvfio-pci-bind/lists"}