Skip to main content

devbind: inspect and control PCI device-driver binding in Linux

devbind

PyPI Python Test

devbind is a small CLI for binding and unbinding PCI devices to a chosen kernel driver. The typical use is moving a device between its native driver (e.g. nvme) and a user space driver framework 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.

Both Linux and FreeBSD are supported; the platform-specific operations are handled by a platform implementation selected at runtime:

Linux FreeBSD
enumerate / inspect lspci, sysfs pciconf -l, camcontrol
user space framework vfio-pci, uio_pci_generic nic_uio
unbind sysfs driver/unbind devctl detach
bind (kernel driver) sysfs drivers/<drv>/bind devctl set driver
bind (user space framework) sysfs driver_override + bind hw.nic_uio.bdfs + kldload

(The Linux-only iommugroup is reported as None on FreeBSD.)

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 nic_uio.

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 on Linux and FreeBSD

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, nic_uio] or to a
                        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

On FreeBSD, bind to nic_uio instead of vfio-pci/uio_pci_generic (--device always takes the domain:bus:device.function form 0000:01:00.0 on both platforms):

sudo devbind --bind nic_uio --device 0000:01:00.0    # hand device to DPDK/SPDK
sudo devbind --bind nvme --device 0000:01:00.0       # rebind to the native driver

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

  • iommu: inspect and configure the IOMMU in Linux.
  • hugepages: inspect and manage Linux hugepages.

Metadata

Release files for devbind 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for devbind 0.4.0
File Size Uploaded
devbind-0.4.0.tar.gz 17.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for devbind 0.4.0
File Interpreter ABI Platform
devbind-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.0 kB

Release files / devbind-0.4.0.tar.gz

Download URL devbind-0.4.0.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
09375b54f9621e32691cc1ff846ec57453e54393c35718972f9a5334145e7055
BLAKE2b-256 checksum
How to use checksums
80fa8f2a1eef7d21ba3c5e9b525c33fd1178004056d238b69057261ac6217d34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Release files / devbind-0.4.0-py3-none-any.whl

Download URL devbind-0.4.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48c6933421f4ab9f16c969e875d7df5894b306d0488f1500d452f418bb8c9671
BLAKE2b-256 checksum
How to use checksums
630df14d7a2b41608c23fa8ff911dbae50177822b31ed68e3f34ca77fab6b9f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page