mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 05:12:27 +00:00
Remove modeset and add preserve memory
This commit is contained in:
parent
6f89bca8d1
commit
1fe1bffe1f
|
@ -32,8 +32,8 @@ promptUser() {
|
||||||
[ "$confirm" = "y" ] || [ "$confirm" = "Y" ]
|
[ "$confirm" = "y" ] || [ "$confirm" = "Y" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
enableNvidiaModeset() {
|
setKernelParam() {
|
||||||
PARAMETER="nvidia-drm.modeset=1"
|
PARAMETER="$1"
|
||||||
|
|
||||||
if grep -q "$PARAMETER" /etc/default/grub; then
|
if grep -q "$PARAMETER" /etc/default/grub; then
|
||||||
printf "%b\n" "${YELLOW}NVIDIA modesetting is already enabled in GRUB.${RC}"
|
printf "%b\n" "${YELLOW}NVIDIA modesetting is already enabled in GRUB.${RC}"
|
||||||
|
@ -50,12 +50,6 @@ setupHardwareAcceleration() {
|
||||||
return;
|
return;
|
||||||
fi
|
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
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libva-nvidia-driver
|
||||||
|
|
||||||
mkdir -p "$HOME/linuxtoolbox"
|
mkdir -p "$HOME/linuxtoolbox"
|
||||||
|
@ -98,6 +92,10 @@ installDriver() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm nvidia-dkms
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm nvidia-dkms
|
||||||
fi
|
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}"
|
printf "%b\n" "${GREEN}Driver installed successfully.${RC}"
|
||||||
if promptUser "setup Hardware Acceleration"; then
|
if promptUser "setup Hardware Acceleration"; then
|
||||||
setupHardwareAcceleration
|
setupHardwareAcceleration
|
||||||
|
|
|
@ -19,7 +19,7 @@ task_list = "SI D"
|
||||||
name = "Nvidia Drivers && Hardware Acceleration"
|
name = "Nvidia Drivers && Hardware Acceleration"
|
||||||
description = "This script installs and configures nvidia drivers with Hardware Acceleration."
|
description = "This script installs and configures nvidia drivers with Hardware Acceleration."
|
||||||
script = "arch/nvidia-drivers.sh"
|
script = "arch/nvidia-drivers.sh"
|
||||||
task_list = "I FM"
|
task_list = "I FM SS"
|
||||||
|
|
||||||
[[data.entries]]
|
[[data.entries]]
|
||||||
name = "Paru AUR Helper"
|
name = "Paru AUR Helper"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user