-
Notifications
You must be signed in to change notification settings - Fork 0
/
nvidia.sh
20 lines (18 loc) · 852 Bytes
/
nvidia.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
sudo pacman -Syu && sudo pacman -S --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si && cd .. && rm -rf yay
yay -Syu --devel
# Install NVIDIA Beta drivers.
yay -S --noconfirm linux-headers
yay -S --noconfirm nvidia-beta-dkms libva-nvidia-driver-git
function config_kernel() {
printf "Config kernel..."
sudo sed -Ei 's/^(MODULES=\([^\)]*)\)/\1nvidia nvidia_modeset nvidia_uvm nvidia_drm)/' /etc/mkinitcpio.conf
sudo echo -e "options nvidia_drm modeset=1 fbdev=1" | sudo tee -a /etc/modprobe.d/nvidia.conf
sudo mkinitcpio -P
if [ -f /etc/default/grub ]; then
sudo sed -i 's/\(GRUB_CMDLINE_LINUX_DEFAULT=".*\)"/\1 nvidia_drm.modeset=1 nvidia_drm.fbdev=1"/' /etc/default/grub
sudo grub-mkconfig -o /boot/grub/grub.cfg
fi
printf "Done"
}
config_kernel