GPU: Correctly filter out duplicate GPU names.

This commit is contained in:
Dylan Araps 2017-04-26 08:12:35 +10:00
parent 04cf863f78
commit 74e8facfe2
1 changed files with 1 additions and 1 deletions

View File

@ -1071,7 +1071,7 @@ get_gpu() {
"Linux")
# Read GPUs into array.
IFS=$'\n'
gpus=($(lspci -mm | awk -F '\\"|\\" \\"' '!a[$0]++ && /"Display|"3D|"VGA/ {print $3 " " $4}'))
gpus=($(lspci -mm | awk -F '\\"|\\" \\"' '/"Display|"3D|"VGA/ {print $3 " " $4}' | sort -u))
IFS="$old_ifs"
# Number the GPUs if more than one exists.