PortValhalla/scripts/Common/Config/nvidia-dkms/install.sh

27 lines
812 B
Bash
Executable file

#!/bin/bash
# According to installation guide on Arch Wiki:
# https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting
{
echo "options nvidia_drm modeset=1";
# echo "options nvidia_drm fbdev=1";
} | sudo tee /etc/modprobe.d/nvidia.conf > /dev/null;
sudo sed -i \
-e "/^HOOKS=(.* kms /{" \
-e "h; s/^/#/; p;" \
-e "g; s/ kms / /" \
-e "}" \
/etc/mkinitcpio.conf;
sudo mkinitcpio -P;
# According to: https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks
{
echo "options nvidia NVreg_PreserveVideoMemoryAllocations=1";
echo "options nvidia NVreg_TemporaryFilePath=/var/tmp";
} | sudo tee /etc/modprobe.d/nvidia-power-management.conf > /dev/null;
sudo systemctl enable \
nvidia-suspend.service \
nvidia-hibernate.service \
nvidia-resume.service;