Unverified Commit 4b91c943 authored by gitfib's avatar gitfib Committed by GitHub

Improve GPU Reading on Linux (#1916)

GPUs that have subsystem name but no revision number can be processed correctly by using $(NF-1) instead of $7 in the awk
parent 429499e9
...@@ -2491,7 +2491,7 @@ get_gpu() { ...@@ -2491,7 +2491,7 @@ get_gpu() {
gpu_cmd="$(lspci -mm | gpu_cmd="$(lspci -mm |
awk -F '\"|\" \"|\\(' \ awk -F '\"|\" \"|\\(' \
'/"Display|"3D|"VGA/ { '/"Display|"3D|"VGA/ {
a[$0] = $1 " " $3 " " ($7 ~ /^$|^Device [[:xdigit:]]+$/ ? $4 : $7) a[$0] = $1 " " $3 " " ($(NF-1) ~ /^$|^Device [[:xdigit:]]+$/ ? $4 : $(NF-1))
} }
END { for (i in a) { END { for (i in a) {
if (!seen[a[i]]++) { if (!seen[a[i]]++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment