This is a quick tutorial on how you can install proprietary NVIDIA drivers for Arch Linux. Please note if you are using anything other than the regular linux kernel, such as linux-lts, you need to make changes accordingly. All the commands marked like this
are meant to be run on the terminal. Do not reboot before you have finished all the steps below!
- Update the system:
sudo pacman -Syu
- Install required packages:
sudo pacman -S base-devel linux-headers git nano --needed
- Install the AUR helper, yay
cd ~
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
- Enable multilib repository
sudo nano /etc/pacman.conf
- Uncomment the following lines by removing the # -character at the start them
- [multilib]
- Include = /etc/pacman.d/mirrorlist
- Save the file with CTRL+S and close nano with CTRL+X
- Run
yay -Syu
, to update the system package database
- First find your NVIDIA card from this list here. Alternatively you can take a look at the Gentoo wiki.
- Check what driver packages you need to install from the table below
Driver name | Kernel | Base driver | OpenGL | OpenGL (multilib) |
---|---|---|---|---|
Maxwell (NV110) series and newer | linux or linux-lts | nvidia | nvidia-utils | lib32-nvidia-utils |
Maxwell (NV110) series and newer | not linux and not linux-lts | nvidia-dkms | nvidia-utils | lib32-nvidia-utils |
Kepler (NVE0) series | any | nvidia-470xx-dkms | nvidia-470xx-utils | lib32-nvidia-470xx-utils |
GeForce 400/500/600 series cards [NVCx and NVDx] | any | nvidia-390xx-dkms | nvidia-390xx-utils | lib32-nvidia-390xx-utils |
Tesla (NV50/G80-90-GT2XX) | any | nvidia-340xx-dkms | nvidia-340xx-utils | lib32-nvidia-340xx-utils |
- Install the correct Base driver, OpenGL, and OpenGL (multilib) packages
- Example:
yay -S nvidia-470xx-dkms nvidia-470xx-utils lib32-nvidia-470xx-utils
- Example:
- Install nvidia-settings with
yay -S nvidia-settings
In this step please complete all the parts: Setting the Kernel Parameter, Add Early Loading of NVIDIA Modules, and Adding the Pacman Hook.
Setting the kernel parameter depends on what bootloader you are using. Complete only one of the options below (A or B). After that, continue to Add Early Loading of NVIDIA Modules.
- Edit the GRUB configuration file:
sudo nano /etc/default/grub
- Find the line with GRUB_CMDLINE_LINUX_DEFAULT
- Append the words inside the quotes with nvidia-drm.modeset=1
- Example: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=1"
- Save the file with CTRL+S and close nano with CTRL+X
- Update the GRUB configuration:
sudo grub-mkconfig -o /boot/grub/grub.cfg
- Navigate to the bootloader entries directory:
cd /boot/loader/entries/
- Edit the appropriate .conf file for your Arch Linux boot entry
sudo nano <filename>.conf
- Append nvidia-drm.modeset=1 to the options line
- Save the file with CTRL+S and close nano with CTRL+X
- Edit the mkinitcpio configuration file:
sudo nano /etc/mkinitcpio.conf
- Find the line that says MODULES=()
- Update the line to: MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)
- Find the line that says HOOKS=()
- On the HOOKS=() line, find the word kms inside the parenthesis and remove it
- Save the file with CTRL+S and close nano with CTRL+X
- Regenerate the initramfs with
sudo mkinitcpio -P
- Get the nvidia.hook -file from this repository
cd ~
wget https://raw.githubusercontent.com/korvahannu/arch-nvidia-drivers-installation-guide/main/nvidia.hook
- Open the file with your preferred editor.
nano nvidia.hook
- Find the line that says Target=nvidia.
- Replace the word nvidia with the base driver you installed, e.g., nvidia-470xx-dkms
- The edited line should look something like this: Target=nvidia-470xx-dkms
- Save the file with CTRL+S and close nano with CTRL+X
- Move the file to /etc/pacman.d/hooks/ with:
sudo mkdir -p /etc/pacman.d/hooks/ && sudo mv ./nvidia.hook /etc/pacman.d/hooks/
You can now safely reboot and enjoy the proprietary NVIDIA drivers. If you have any problems check the Arch Linux Wiki or the forums for common pitfalls and questions.