We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7010e59 commit e8d3e46Copy full SHA for e8d3e46
scripts/gpu_name.sh
@@ -15,10 +15,10 @@ print_gpu_name() {
15
echo "No GPU"
16
return
17
fi
18
- gpu_name=$(echo "$loads" | nvidia-smi | grep -Eo "NVIDIA\s+\w+\s+\w+\s[0-9]+")
19
- gpu_nums=$(nvidia-smi --query-gpu=count --format=csv,noheader)
20
- if [ ${gpu_nums} -eq 1 ]; then
21
- echo ${gpu_name}
+ gpu_name=$(nvidia-smi --query-gpu=gpu_name --format=csv,noheader | sort | uniq)
+ gpu_nums=$(nvidia-smi --query-gpu=count --format=csv,noheader | sort | uniq)
+ if [ "${gpu_nums}" -eq 1 ]; then
+ echo "${gpu_name}"
22
else
23
echo "${gpu_name}${gpu_nums}"
24
@@ -28,3 +28,4 @@ main() {
28
print_gpu_name
29
}
30
main "$@"
31
+
0 commit comments