This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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) ) |