diff --git a/core/tabs/system-setup/arch/nvidia-drivers.sh b/core/tabs/system-setup/arch/nvidia-drivers.sh index 595c905b..52cc6fe5 100755 --- a/core/tabs/system-setup/arch/nvidia-drivers.sh +++ b/core/tabs/system-setup/arch/nvidia-drivers.sh @@ -32,8 +32,8 @@ promptUser() { [ "$confirm" = "y" ] || [ "$confirm" = "Y" ] } -enableNvidiaModeset() { - PARAMETER="nvidia-drm.modeset=1" +setKernelParam() { + PARAMETER="$1" if grep -q "$PARAMETER" /etc/default/grub; then printf "%b\n" "${YELLOW}NVIDIA modesetting is already enabled in GRUB.${RC}" @@ -50,12 +50,6 @@ setupHardwareAcceleration() { return; fi - modeset=$("$ESCALATION_TOOL" cat /sys/module/nvidia_drm/parameters/modeset) - - if [ ! "$modeset" = "Y" ]; then - enableNvidiaModeset - fi - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libva-nvidia-driver mkdir -p "$HOME/linuxtoolbox" @@ -98,6 +92,10 @@ installDriver() { "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm nvidia-dkms fi + # Refer https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Preserve_video_memory_after_suspend + setKernelParam "nvidia.NVreg_PreserveVideoMemoryAllocations=1" + "$ESCALATION_TOOL" systemctl enable nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service + printf "%b\n" "${GREEN}Driver installed successfully.${RC}" if promptUser "setup Hardware Acceleration"; then setupHardwareAcceleration diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index b237bbf4..88a79a17 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -19,7 +19,7 @@ task_list = "SI D" name = "Nvidia Drivers && Hardware Acceleration" description = "This script installs and configures nvidia drivers with Hardware Acceleration." script = "arch/nvidia-drivers.sh" -task_list = "I FM" +task_list = "I FM SS" [[data.entries]] name = "Paru AUR Helper"