Skip to content

Commit

Permalink
Remove modeset and add preserve memory
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevithakannan2 committed Oct 12, 2024
1 parent 6f89bca commit 1fe1bff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions core/tabs/system-setup/arch/nvidia-drivers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/system-setup/tab_data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1fe1bff

Please sign in to comment.