Browse Source

get gpu name for linux systems without pcie gpus

allows for detection of the nvidia jetson and similar other gpus which have no pcie connection
theofficialgman 3 năm trước cách đây
mục cha
commit
49725192b4
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      neofetch

+ 7 - 0
neofetch

@@ -2499,6 +2499,12 @@ get_gpu() {
                                       print a[i]
                                   }
                               }}')"
+
+            if [[ "$gpu_cmd" == "" ]]; then
+                gpu_cmd="$(glxinfo -B | grep -F 'OpenGL renderer string')"
+                gpu_cmd="${gpu_cmd/OpenGL renderer string: }"
+            fi
+
             IFS=$'\n' read -d "" -ra gpus <<< "$gpu_cmd"
 
             # Remove duplicate Intel Graphics outputs.
@@ -2532,6 +2538,7 @@ get_gpu() {
                     ;;
 
                     *"NVIDIA"*)
+                        gpu="${gpu/*NVIDIA}"
                         gpu="${gpu/*\[}"
                         gpu="${gpu/\]*}"
                         gpu="NVIDIA $gpu"