Inspect and control PCI device-driver binding in Linux
Project description
devbind
devbind is a small CLI for binding and unbinding PCI devices to a
chosen kernel driver via sysfs. The typical use is moving a device
between its native driver (e.g. nvme) and a user space driver
framework (vfio-pci, uio_pci_generic) for DPDK/SPDK and xNVMe/uPCIe
workloads. devbind --list also reports the process RLIMIT_MEMLOCK
and warns when the soft limit is below the 64 MiB threshold those
frameworks inherit.
Install
pipx install devbind
Or standalone (single-file, stdlib only, no pip needed):
curl -fsSL https://raw.githubusercontent.com/xnvme/devbind/main/src/devbind/devbind.py \
-o ~/.local/bin/devbind && chmod +x ~/.local/bin/devbind
Shell completion
devbind --print-completion bash > ~/.local/share/bash-completion/completions/devbind
Open a new shell (or source the file) and tab-completion is live: devbind --bind <TAB> lists nvme vfio-pci vfio-noiommu uio_pci_generic.
Usage
$ devbind --help
usage: devbind [-h] [--version] [--classcode CLASSCODE] [--device DEVICE]
[--list] [--unbind] [--bind BIND] [--verbose]
[--print-completion SHELL]
Inspect and control PCI device-driver binding in Linux
options:
-h, --help show this help message and exit
--version show program's version number and exit
--classcode CLASSCODE
The class of PCIe devices to scan for
--device DEVICE Instead of all; then only the given PCI address.
--list Print PCIe device(s); such as their 'bdf' and driver-
association.
--unbind Unbind if bound.
--bind BIND Unbind if bound; then bind to the given driver-name
[nvme, vfio-pci, uio_pci_generic] or to a .ko driver
file (path)
--verbose Enable verbose logging
--print-completion SHELL
Print shell completion script to stdout and exit
A few common invocations:
devbind --list # list NVMe devices and their drivers
sudo devbind --bind vfio-pci --device 0000:01:00.0 # bind one device to vfio-pci
sudo devbind --bind nvme --device 0000:01:00.0 # rebind to the native driver
sudo devbind --unbind --device 0000:01:00.0 # unbind without rebinding
devbind --list sample output (stock WSL host, no NVMe devices visible):
system:
drivers:
- uio_pci_generic: {'available': False}
- vfio-noiommu: {'available': False}
- vfio-pci: {'available': False}
- nvme: {'available': True}
limits:
memlock_soft: 64 MB
memlock_hard: 64 MB
On a host with NVMe devices visible, a props: block is also printed per device with bdf, vendor, device, classcode, driver, iommugroup, handles, and is_used.
Related
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file devbind-0.3.9.tar.gz.
File metadata
- Download URL: devbind-0.3.9.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c791bf1540cbd786dadbf742f86b49b0a26a530a1216e84d63e115d116f4c65
|
|
| MD5 |
e5b53a82ef6290fb8902a1edce5953c8
|
|
| BLAKE2b-256 |
3dd64ed05030b2d70a17af3aaf4d1581ec6816b2accb9cb45c6189f980abd52e
|
Provenance
The following attestation bundles were made for devbind-0.3.9.tar.gz:
Publisher:
publish.yml on xnvme/devbind
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devbind-0.3.9.tar.gz -
Subject digest:
0c791bf1540cbd786dadbf742f86b49b0a26a530a1216e84d63e115d116f4c65 - Sigstore transparency entry: 1535341202
- Sigstore integration time:
-
Permalink:
xnvme/devbind@00815b8a451b1b8daf62fdaf703dae57cd0200fd -
Branch / Tag:
refs/tags/v0.3.9 - Owner: https://github.com/xnvme
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@00815b8a451b1b8daf62fdaf703dae57cd0200fd -
Trigger Event:
push
-
Statement type:
File details
Details for the file devbind-0.3.9-py3-none-any.whl.
File metadata
- Download URL: devbind-0.3.9-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3eccffd6c0357bea301ca9cc351e935b97ff8280b273a253d646b15f9a69ee7
|
|
| MD5 |
80fd17c44539a5195e9b4180eb113f65
|
|
| BLAKE2b-256 |
e612eb11aa0908b15f0e9665a7a999baf20e2467e788c57381d195d700dc3ba8
|
Provenance
The following attestation bundles were made for devbind-0.3.9-py3-none-any.whl:
Publisher:
publish.yml on xnvme/devbind
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devbind-0.3.9-py3-none-any.whl -
Subject digest:
b3eccffd6c0357bea301ca9cc351e935b97ff8280b273a253d646b15f9a69ee7 - Sigstore transparency entry: 1535341478
- Sigstore integration time:
-
Permalink:
xnvme/devbind@00815b8a451b1b8daf62fdaf703dae57cd0200fd -
Branch / Tag:
refs/tags/v0.3.9 - Owner: https://github.com/xnvme
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@00815b8a451b1b8daf62fdaf703dae57cd0200fd -
Trigger Event:
push
-
Statement type: