quickpassthrough/lib/get_GPU.sh

41 lines
1 KiB
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]*)
2022-02-28 14:30:44 -05:00
printf "Aborted, your setup is incomplete!
DO NOT use any of the files from $SCRIPTDIR/config !
"
2022-02-26 18:10:21 -05:00
;;
*)
2022-02-28 14:30:44 -05:00
exec "$SCRIPTDIR/lib/get_GPU.sh"
2022-02-26 18:10:21 -05:00
;;
esac
}
function main () {
SCRIPTDIR=$(dirname `which $0` | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//")
2022-02-27 11:19:59 -05:00
2022-02-26 18:10:21 -05:00
get_GPU
}
main