Bash script to parse, sort, and display hardware devices by IOMMU group, and return the device drivers and hardware IDs as output.
- 1. Why?
- 2. Related Projects
- 3. Documentation
- 4. Host Requirements
- 5. Download
- 6. Usage
- 7. Contact
- 8. References
If you wish to determine if your current machine's hardware specifications are able to support VFIO, then this script is for you. The script allows one to query exactly what hardware you wish to allocate for a VFIO setup, and returns the relevant output to deploy a VFIO setup.
This script must be run on a system without VFIO setup already. If not, the
script output will not show a complete list of valid device drivers.
This is due to the fact that a VFIO setup involves replacing the device drivers
(example: NVIDIA GPUs use nouveau
or nvidia
) with the VFIO driver
(vfio-pci
).
Other outputs such as lists for IOMMU group IDs and hardware IDs are not affected by this.
Project | Codeberg | GitHub |
---|---|---|
Deploy VFIO | link | link |
Auto X.Org | link | link |
Generate Evdev | link | link |
Guest Machine Guide | link | link |
Libvirt Hooks | link | link |
Parse IOMMU Devices | link | link |
Power State Virtual Machine Manager | link | link |
- What is VFIO?
- VFIO Discussion and Support
- Hardware-Passthrough Guide
- Virtual Machine XML Format Guide
Linux.
-
Download the
.zip
file:- Viewing from the top of the repository's (current) webpage, click the
drop-down icon:
···
on Codeberg.<> Code
on GitHub.
- Click
Download ZIP
and save. - Open the
.zip
file, then extract its contents.
- Viewing from the top of the repository's (current) webpage, click the
drop-down icon:
-
Clone the repository:
- Open a Command Line Interface (CLI).
- Open a console emulator (for Debian systems: Konsole).
- Open a existing console: press
CTRL
+ALT
+F2
,F3
,F4
,F5
, orF6
.- To return to the desktop, press
CTRL
+ALT
+F7
. F1
is reserved for debug output of the Linux kernel.F7
is reserved for video output of the desktop environment.F8
and above are unused.
- To return to the desktop, press
- Change your directory to your home folder or anywhere safe:
cd ~
- Clone the repository:
git clone https://www.codeberg.org/portellam/parse-iommu-devices
git clone https://www.github.com/portellam/parse-iommu-devices
- Open a Command Line Interface (CLI).
Installer will copy required files to /usr/bin/local/
.
sudo bash installer.sh
- From anywhere, execute:
parse-iommu-devices
-h, --help Print this help and exit.
-q, --quiet Quiet all output except for comma delimited lists
of device drivers and hardware IDs.
-e, --external Match IOMMU groups without only internal devices.
-g, --group [OPTION] Match IOMMU group ID(s). Comma delimited.
-i, --internal Match IOMMU groups without only external devices.
-n, --name [OPTION] Match IOMMU group(s) with device name.
Comma delimited.
--reverse-name [OPTION] Match IOMMU group(s) without device name.
Comma delimited.
-v, --vga-index [OPTION] Match all IOMMU groups without VGA, and any with
VGA which match the index value(s)
(not an IOMMU group ID). Comma delimited.
Examples:
parse-iommu-devices -eq -v 2 Quiet output except for drivers and hardware IDs
(of IOMMU groups with external devices) and
exclude IOMMU groups with VGA device(s) before and
after the second matched group.
Did you encounter a bug? Do you need help? Please visit the Issues page (Codeberg, GitHub).
PCI passthrough via OVMF. ArchWiki. Accessed June 14, 2024. https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF.
VFIO - ‘Virtual Function I/O’ - The Linux Kernel Documentation. The linux kernel. Accessed June 14, 2024. https://www.kernel.org/doc/html/latest/driver-api/vfio.html.
VFIO Discussion and Support. Reddit. Accessed June 14, 2024. https://www.reddit.com/r/VFIO/.
XML Design Format GitHub - libvirt/libvirt. Accessed June 18, 2024. https://github.com/libvirt/libvirt/blob/master/docs/formatdomain.rst.
- reference and query database for original device drivers.
- Query manifest of hardware IDs and drivers. If any devices or groups are ever binded to the VFIO driver, the feature should be able to grab the original drivers (should the system's hardware configuration not change).
- use XML file? This will work
- use Internet database? Not sure if this is possible, but
lspci
mentions something to this effect.