quickpassthrough/old_bash_version/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 "#------------------------------------------#"
"$SCRIPTDIR/utils/ls-iommu" -g -F name,device_id,optional_revision
2022-02-26 18:10:21 -05:00
echo "#------------------------------------------#"
printf "
Press q to quit
"
2022-03-12 09:34:40 -05:00
read -r -p "Which group number do you want to check?: " IOMMU_GROUP
2022-02-26 18:10:21 -05:00
case "${IOMMU_GROUP}" in
[1-9]*)
2022-03-12 09:34:40 -05:00
exec "$SCRIPTDIR/lib/get_GPU_GROUP.sh" "$IOMMU_GROUP"
2022-02-26 18:10:21 -05:00
;;
[Qq]*)
2022-03-12 09:34:40 -05:00
echo "Aborted, your setup is incomplete!
2022-02-28 14:30:44 -05:00
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 () {
2022-03-12 09:34:40 -05:00
SCRIPTDIR=$(dirname "$(realpath "$0")" | perl -pe "s/\/\.\.\/lib//" | perl -pe "s/\/lib$//")
2022-03-03 21:08:10 -05:00
2022-02-26 18:10:21 -05:00
get_GPU
}
main