Skip to content

Commit

Permalink
allow user to force getting gpu info without asking lspci
Browse files Browse the repository at this point in the history
i myself and other people have had issues with lspci not being available
or not returning the right values for data to be displayed, despite
there being an nvidia gpu and functioning nvidia-smi.
this commit adds an optional flag that allows to tell tmux that there is
an nvidia gpu, without any checks.
  • Loading branch information
Theoreticallyhugo committed Jul 18, 2024
1 parent c2b1d67 commit 65bdd9e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
10 changes: 8 additions & 2 deletions scripts/gpu_power.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ get_platform()
{
case $(uname -s) in
Linux)
gpu=$(lspci -v | grep VGA | head -n 1 | awk '{print $5}')
echo $gpu
# use this option for when you know that there is an NVIDIA gpu, but you cant use lspci to determine
ignore_lspci=$(get_tmux_option "@dracula-ignore-lspci" false)
if [[ "$ignore_lspci" = true ]]; then
echo "NVIDIA"
else
gpu=$(lspci -v | grep VGA | head -n 1 | awk '{print $5}')
echo $gpu
fi
;;

Darwin)
Expand Down
10 changes: 8 additions & 2 deletions scripts/gpu_ram_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ get_platform()
{
case $(uname -s) in
Linux)
gpu=$(lspci -v | grep VGA | head -n 1 | awk '{print $5}')
echo $gpu
# use this option for when you know that there is an NVIDIA gpu, but you cant use lspci to determine
ignore_lspci=$(get_tmux_option "@dracula-ignore-lspci" false)
if [[ "$ignore_lspci" = true ]]; then
echo "NVIDIA"
else
gpu=$(lspci -v | grep VGA | head -n 1 | awk '{print $5}')
echo $gpu
fi
;;

Darwin)
Expand Down
10 changes: 8 additions & 2 deletions scripts/gpu_usage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ get_platform()
{
case $(uname -s) in
Linux)
gpu=$(lspci -v | grep VGA | head -n 1 | awk '{print $5}')
echo $gpu
# use this option for when you know that there is an NVIDIA gpu, but you cant use lspci to determine
ignore_lspci=$(get_tmux_option "@dracula-ignore-lspci" false)
if [[ "$ignore_lspci" = true ]]; then
echo "NVIDIA"
else
gpu=$(lspci -v | grep VGA | head -n 1 | awk '{print $5}')
echo $gpu
fi
;;

Darwin)
Expand Down

0 comments on commit 65bdd9e

Please sign in to comment.