Skip to content

Commit

Permalink
fix(setup.sh): More reliable nvidia detection
Browse files Browse the repository at this point in the history
glxinfo only detects nvidia cards in hybrid GPUs laptops when executed prefixed of switcherooctl (which basically sets the env vars), or using `lshw -c video` (which lists all video devices, regardless of env vars)
  • Loading branch information
Zeglius committed Jul 9, 2024
1 parent 921b578 commit c39a68d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ set_container_type () {
}

get_gpu_type () {
if command -v glxinfo &> /dev/null; then
if [[ -n $(glxinfo -B | grep -i nvidia) ]]; then
if command -v lshw &> /dev/null; then
if lshw -c video 2>/dev/null | grep -qi nvidia; then
echo "Nvidia GPU detected."
nvidia_gpu=true
fi
Expand Down

0 comments on commit c39a68d

Please sign in to comment.