Added ask GPU

This commit is contained in:
2025-03-25 13:52:24 +01:00
parent 1dd9229bae
commit 1d073c0554

View File

@@ -123,60 +123,62 @@ setup_pacman() {
# Function name: GPU setup # Function name: GPU setup
# Description: Setup GPU depending on the available devices # Description: Setup GPU depending on the available devices
gpu_setup() { gpu_setup() {
detected_gpu=$(lspci | grep -Ei "vga|3d|display") if whiptail --title "Setup GPU" --yesno "Would you like to setup GPU?" 10 60; then
case "$detected_gpu" in detected_gpu=$(lspci | grep -Ei "vga|3d|display")
*NVIDIA*) case "$detected_gpu" in
options=( *NVIDIA*)
"nvidia" "Official NVIDIA Drivers" ON options=(
"nouveau" "Open Source nouveau drivers" OFF "nvidia" "Official NVIDIA Drivers" ON
) "nouveau" "Open Source nouveau drivers" OFF
selected_driver=$(whiptail --title "Select NVIDIA Drivers" --radiolist \ )
"Choose the NVIDIA driver you want to install:" 15 60 2 \ selected_driver=$(whiptail --title "Select NVIDIA Drivers" --radiolist \
"${options[@]}" 3>&1 1>&2 2>&3) "Choose the NVIDIA driver you want to install:" 15 60 2 \
"${options[@]}" 3>&1 1>&2 2>&3)
if pacman -Qs nvidia > /dev/null; then
sudo pacman -R --noconfirm nvidia if pacman -Qs nvidia > /dev/null; then
elif pacman -Qs nvidia-dkms > /dev/null; then sudo pacman -R --noconfirm nvidia
sudo pacman -R --noconfirm nvidia-dkms elif pacman -Qs nvidia-dkms > /dev/null; then
elif pacman -Qs xf86-video-nouveau > /dev/null; then sudo pacman -R --noconfirm nvidia-dkms
sudo pacman -R --noconfirm xf86-video-nouveau elif pacman -Qs xf86-video-nouveau > /dev/null; then
fi sudo pacman -R --noconfirm xf86-video-nouveau
case $selected_driver in
"\"nvidia\"")
if pacman -Qs linux > /dev/null; then
sudo pacman -S --needed --noconfirm nvidia-open
fi
if pacman -Qs linux-lts > /dev/null; then
sudo pacman -S --needed --noconfirm nvidia-open-lts
fi
if pacman -Qs linux-cachyos > /dev/null; then
sudo pacman -S --needed --noconfirm linux-cachyos-nvidia-open
fi
if pacman -Qs linux-zen > /dev/null || pacman -Qs linux-hardened > /dev/null; then
sudo pacman -S --needed --noconfirm nvidia-open-dkms
fi fi
case $selected_driver in
"\"nvidia\"")
if pacman -Qs linux > /dev/null; then
sudo pacman -S --needed --noconfirm nvidia-open
fi
if pacman -Qs linux-lts > /dev/null; then
sudo pacman -S --needed --noconfirm nvidia-open-lts
fi
if pacman -Qs linux-cachyos > /dev/null; then
sudo pacman -S --needed --noconfirm linux-cachyos-nvidia-open
fi
if pacman -Qs linux-zen > /dev/null || pacman -Qs linux-hardened > /dev/null; then
sudo pacman -S --needed --noconfirm nvidia-open-dkms
fi
if ! lspci | grep -Ei "amd|intel" > /dev/null; then if ! lspci | grep -Ei "amd|intel" > /dev/null; then
sudo pacman -S --needed --noconfirm libva-nvidia-driver sudo pacman -S --needed --noconfirm libva-nvidia-driver
fi fi
if (whiptail --title "Install Cuda" --yesno "Would you like to install Cuda?" 10 60) then if (whiptail --title "Install Cuda" --yesno "Would you like to install Cuda?" 10 60); then
sudo pacman -S --needed --noconfirm cuda sudo pacman -S --needed --noconfirm cuda
fi fi
;;
"\"nouveau\"")
sudo pacman -S --needed --noconfirm mesa vulkan-nouveau
;;
esac
;; ;;
"\"nouveau\"") *AMD*)
sudo pacman -S --needed --noconfirm mesa vulkan-nouveau sudo pacman -S --needed --noconfirm mesa vulkan-radeon
;; ;;
esac *Intel*)
;; sudo pacman -S --needed --noconfirm intel-media-driver vulkan-intel
*AMD*) ;;
sudo pacman -S --needed --noconfirm mesa vulkan-radeon esac
;; fi
*Intel*)
sudo pacman -S --needed --noconfirm intel-media-driver vulkan-intel
;;
esac
} }