Skip to content

Instantly share code, notes, and snippets.

@chenxinlong
Forked from n1snt/iommu.sh
Created September 24, 2024 08:18
Show Gist options
  • Save chenxinlong/ff298cb3374b23d3e404b263969b8ff8 to your computer and use it in GitHub Desktop.
Save chenxinlong/ff298cb3374b23d3e404b263969b8ff8 to your computer and use it in GitHub Desktop.
A simple bash script to get the list of iommu groups & the devices in those iommu groups.
#!/bin/bash
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment