Skip to content

Instantly share code, notes, and snippets.

View frankiejol's full-sized avatar

Francesc Guasch frankiejol

View GitHub Profile
#!/usr/bin/env bash
# This script will list virtual GPUs on a "Linux with KVM Hypervisor that Uses a Vendor-Specific VFIO Framework",
# as nVidia calls them.
# It has been tested only under Ubuntu 24.04 with nVidia GRID.
# Other vendors might work provided that they use a similar structure
#
# Guillermo Miranda, November 2024
# Read lines into an array. See https://stackoverflow.com/a/11426834
IFS=$'\n' pcidevices=( $(lspci -Dnn) )