quickpassthrough/lib/get_GPU.sh

40 lines
943 B
Bash
Raw Normal View History

2022-02-26 18:10:21 -05:00
#!/bin/bash
function get_GPU () {
2022-02-27 11:19:59 -05:00
clear
2022-02-26 18:10:21 -05:00
printf "These are your graphic cards, they have to be in separate groups.
The graphic card you want to passthrough cannot be in a group with other devices that
2022-02-27 11:19:59 -05:00
does not belong to itself. Both cards must also have unique hardware ids [xxxx:yyyy]!:
2022-02-26 18:10:21 -05:00
"
echo "#------------------------------------------#"
exec "$SCRIPTDIR/utils/ls-iommu" | grep -i "vga" | cut -d " " -f 1-4,9-
echo "#------------------------------------------#"
printf "
Press q to quit
"
read -p "Which group number do you want to check?: " IOMMU_GROUP
case "${IOMMU_GROUP}" in
[1-9]*)
exec "$SCRIPTDIR/lib/get_GPU_GROUP.sh" $IOMMU_GROUP
;;
[Qq]*)
echo ""
;;
*)
echo ""
;;
esac
}
function main () {
2022-02-27 11:19:59 -05:00
SCRIPTDIR=$(dirname `which $0` | perl -pe "s/\/\.\.\/lib//")
2022-02-26 18:10:21 -05:00
SCRIPTDIR="$SCRIPTDIR/.."
2022-02-27 11:19:59 -05:00
2022-02-26 18:10:21 -05:00
get_GPU
}
main