|
|
|
@ -660,10 +660,47 @@ getcpu () { |
|
|
|
|
|
|
|
|
|
|
|
getgpu () { |
|
|
|
getgpu () { |
|
|
|
case "$os" in |
|
|
|
case "$os" in |
|
|
|
"Linux") |
|
|
|
"Linux" | "OpenBSD") |
|
|
|
gpu=$(lspci | grep "VGA" | grep -o '\[.*\]') |
|
|
|
if type -p nvidia-smi >/dev/null 2>&1; then |
|
|
|
gpu=${gpu//[} |
|
|
|
gpu="$(nvidia-smi | awk -F':' '/Product Name/ {printf $2}')" |
|
|
|
gpu=${gpu//]} |
|
|
|
else |
|
|
|
|
|
|
|
gpu="$(lspci | grep "VGA")" |
|
|
|
|
|
|
|
gpu=${gpu/* VGA compatible controller: } |
|
|
|
|
|
|
|
gpu=${gpu/(rev*)} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
shopt -s nocasematch |
|
|
|
|
|
|
|
case "$gpu" in |
|
|
|
|
|
|
|
intel*) |
|
|
|
|
|
|
|
gpu=${gpu/'Intel Corporation' } |
|
|
|
|
|
|
|
gpu=${gpu/'Haswell-'??? } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
brand="Intel" |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
advanced*) |
|
|
|
|
|
|
|
gpu=${gpu/'Advanced Micro Devices, Inc.' } |
|
|
|
|
|
|
|
gpu=${gpu/'[AMD/ATI]' } |
|
|
|
|
|
|
|
gpu=${gpu/'Tahiti PRO'} |
|
|
|
|
|
|
|
gpu=${gpu/'Mars'} |
|
|
|
|
|
|
|
gpu=${gpu/' ['} |
|
|
|
|
|
|
|
gpu=${gpu/']'} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
brand="AMD" |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nvidia*) |
|
|
|
|
|
|
|
gpu=${gpu/'NVIDIA Corporation' } |
|
|
|
|
|
|
|
gpu=${gpu/'nVidia Corporation' } |
|
|
|
|
|
|
|
gpu=${gpu/G???? } |
|
|
|
|
|
|
|
gpu=${gpu/'['} |
|
|
|
|
|
|
|
gpu=${gpu/']'} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
brand="Nvidia" |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
esac |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gpu="$brand $gpu" |
|
|
|
|
|
|
|
fi |
|
|
|
;; |
|
|
|
;; |
|
|
|
|
|
|
|
|
|
|
|
"Mac OS X") |
|
|
|
"Mac OS X") |
|
|
|
|