From 3aa8c19b6e6cca03dd9f2cbdbe0a6b7f0dcb23aa Mon Sep 17 00:00:00 2001 From: Oleg Suchkov Date: Sun, 6 Jul 2025 15:19:47 +0300 Subject: [PATCH] fix(detect): Correctly assign gpu_info before use The script attempted to perform driver selection by echoing the `$gpu_info` variable, but the variable had not yet been populated with the output from the `lspci` command. This resulted in the `if` condition always failing and the driver package incorrectly defaulting to `nvidia-dkms` for all hardware. This commit moves the `gpu_info` assignment to before it is referenced, ensuring the detection and selection logic works as intended. --- install/nvidia.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/nvidia.sh b/install/nvidia.sh index 6666562..3f1feb0 100644 --- a/install/nvidia.sh +++ b/install/nvidia.sh @@ -9,7 +9,8 @@ # ============================================================================== # --- GPU Detection --- -if [ -n "$(lspci | grep -i 'nvidia')" ]; then +gpu_info=$(lspci | grep -i 'nvidia') +if [ -n "$gpu_info" ]; then # --- Driver Selection --- # Turing (16xx, 20xx), Ampere (30xx), Ada (40xx), and newer recommend the open-source kernel modules if echo "$gpu_info" | grep -q -E "RTX [2-9][0-9]|GTX 16"; then