Skip to content

Instantly share code, notes, and snippets.

@n1snt
Created February 26, 2021 19:58
Show Gist options
  • Save n1snt/b0bd972af8adc73240cdb0abff71cf7b to your computer and use it in GitHub Desktop.
Save n1snt/b0bd972af8adc73240cdb0abff71cf7b 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