Skip to content

Commit

Permalink
Intel & Matrox integrated do not work
Browse files Browse the repository at this point in the history
  • Loading branch information
shawarden committed Oct 24, 2024
1 parent 5beacea commit 49d73f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion scripts/gpu_power.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ get_gpu()

elif [[ "$gpu" == apple ]]; then
usage="$(sudo powermetrics --samplers gpu_power -i500 -n 1 | grep 'GPU Power' | sed 's/GPU Power: \(.*\) \(.*\)/\1\2/g')"
else
elif [[ "$gpu" == Advanced ]]; then
usage=$(
for card in /sys/class/drm/card?
do
echo "$(($(cat "$card"/device/hwmon/hwmon?/power1_average) / 1000 / 1000))/$(($(cat "$card"/device/hwmon/hwmon?/power1_cap_max) / 1000 / 1000))W"
done | \
sed -z -e 's/\n/|/g' -e 's/|$//g'
)
else # "Intel" "Matrox", etc
usage="unknown"
fi
echo $usage
}
Expand Down
4 changes: 3 additions & 1 deletion scripts/gpu_ram_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ get_gpu()
total_accuracy=$(get_tmux_option "@dracula-gpu-vram-total-accuracy" "d")
usage=$(nvidia-smi --query-gpu=memory.used,memory.total --format=csv,noheader,nounits | awk "{ used += \$0; total +=\$2 } END { printf(\"%${used_accuracy}GB/%${total_accuracy}GB\n\", used / 1024, total / 1024) }")
fi
else
elif [[ "$gpu" == Advanced ]]; then
usage="$(
for card in /sys/class/drm/card?
do
Expand All @@ -60,6 +60,8 @@ get_gpu()
echo "$use/$max"
done | sed -z -e 's/\n/|/g' -e 's/|$//g'
)"
else # "Intel" "Matrox", etc
usage="unknown"
fi
echo $usage
}
Expand Down
4 changes: 3 additions & 1 deletion scripts/gpu_usage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ get_gpu()
usage=$(nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits | awk '{ sum += $0 } END { printf("%d%%\n", sum / NR) }')
elif [[ "$gpu" == apple ]]; then
usage="$(sudo powermetrics --samplers gpu_power -i500 -n 1 | grep 'active residency' | sed 's/[^0-9.%]//g' | sed 's/[%].*$//g')%"
else
elif [[ "$gpu" == Advanced ]]; then
usage="$(cat /sys/class/drm/card?/device/gpu_busy_percent | sed -z -e 's/\n/%|/g' -e 's/|$//g')"
else # "Intel" "Matrox", etc
usage="unknown"
fi
normalize_percent_len $usage
}
Expand Down

0 comments on commit 49d73f9

Please sign in to comment.