fix gpu memory

This commit is contained in:
Guido Kraemer 2023-04-26 13:44:09 +02:00
parent 49a1c3f6c3
commit a588a9d517
Failed to extract signature
2 changed files with 3 additions and 3 deletions

View file

@ -142,7 +142,7 @@ main()
script="#($current_dir/gpu_usage.sh)" script="#($current_dir/gpu_usage.sh)"
elif [ $plugin = "gpu-ram-usage" ]; then elif [ $plugin = "gpu-ram-usage" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-gpu-ram-usage-colors" "pink dark_gray") IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-gpu-ram-usage-colors" "cyan dark_gray")
script="#($current_dir/gpu_ram_info.sh)" script="#($current_dir/gpu_ram_info.sh)"
elif [ $plugin = "cpu-usage" ]; then elif [ $plugin = "cpu-usage" ]; then

View file

@ -27,7 +27,7 @@ get_gpu()
{ {
gpu=$(get_platform) gpu=$(get_platform)
if [[ "$gpu" == NVIDIA ]]; then if [[ "$gpu" == NVIDIA ]]; then
usage=$(nvidia-smi --query-gpu=memory.used,memory.total --format=csv,noheader,nounits | awk '{ used += $0; total +=$2 } END { printf("%dGB / %dGB\n", used / 1024, total / 1024) }') usage=$(nvidia-smi --query-gpu=memory.used,memory.total --format=csv,noheader,nounits | awk '{ used += $0; total +=$2 } END { printf("%dGB/%dGB\n", used / 1024, total / 1024) }')
else else
usage='unknown' usage='unknown'
fi fi
@ -38,7 +38,7 @@ main()
{ {
# storing the refresh rate in the variable RATE, default is 5 # storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5) RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
gpu_label=$(get_tmux_option "@dracula-gpu-usage-label" "GPU RAM") gpu_label=$(get_tmux_option "@dracula-gpu-usage-label" "VRAM")
gpu_usage=$(get_gpu) gpu_usage=$(get_gpu)
echo "$gpu_label $gpu_usage" echo "$gpu_label $gpu_usage"
sleep $RATE sleep $RATE