Skip to content

A tool to list devices in iommu groups, useful for setting up VFIO

License

Notifications You must be signed in to change notification settings

HikariKnight/ls-iommu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ls-iommu

A tool to list devices in iommu groups, useful for setting up VFIO and is a dependency for quickpassthrough

This tool is a go implementation and extension to the small bash script provided by Wendell from Level1Techs. It's purpose was to just list every device and their associated IOMMU group.

This project does the same thing, but extends the functionality by implementing arguments to list the output in different ways or provide just the details needed without having to hop through grep, sed, awk or perl pipe hoops.

You can download the latest release from the releases page

Features

Currently the program supports the same behavior as Wendell's ls-iommu script but can also be told to display:

  • Output sorted properly by IOMMU group
  • Only devices in selected IOMMU groups
  • Only specific devices (ex: GPUs, USB controllers, SATA controllers, etc)
  • Tailor the output to show only what you care about
  • Locate relative devices sharing the same IOMMU group
  • Display currently used kernel driver for listed devices
  • Display only device IDs for queried devices
  • Display only PCI addresses queried devices
  • Display rom path for GPUs (or the selected GPU using -i to only show devices in a specific IOMMU group)

More functionality can be added if it is deemed useful, just open an issue with the request.
Note: arm64 builds are generated but not tested as I lack the relevant hardware.

helptext gpu output getting info from specific devices display specific info

Build instructions

Prerequisites:

  • Go 1.20+
  • git

This will build the latest ls-iommu and set the version to the latest commit hash.

git clone https://github.com/HikariKnight/ls-iommu.git
cd ls-iommu
go mod download
CGO_ENABLED=0 go build -ldflags="-X github.com/HikariKnight/ls-iommu/internal/version.Version=$(git rev-parse --short HEAD)" -o ls-iommu cmd/main.go

NOTE: you can build with newer dependencies (can break things) by running go get -u ./cmd after go mod download

The binary ls-iommu will now be located the root of the project directory.