Graphics support - Sawangg/dotfiles GitHub Wiki

In the base installation, we didn't install any graphical drivers for our GPU. In this section, we're going to see the different configurations we need depending on our GPU manufacturer.

Nvidia

We're going to install the nvidia-dkms drivers. Those are the propretary Nvidia drivers that works well on my machine. Because we installed the hardened kernel, we need to use the dkms version, even if we choose the open drivers.

doas pacman -S nvidia-dkms

Next edit your /etc/environment with the following values

GBM_BACKEND=nvidia-drm
__GLX_VENDOR_LIBRARY_NAME=nvidia
ENABLE_VKBASALT=1
LIBVA_DRIVER_NAME=nvidia
WLR_BACKEND=vulkan

Keep in mind that environments variable in this file work across your entire machine so if you want to use X11 for some reason you'll have to edit this

Now that we have set our environment values, we need to add the nvidia mkinitcpio modules. Edit /etc/mkinitcpio.conf and add

MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)

Save and run the next command to generate a new image.

doas mkinitcpio -P

Finally, we need to edit our default GRUB config to add a kernel flag. Open /etc/default/grub and add at the end of GRUB_CMDLINE_LINUX_DEFAULT the following

GRUB_CMDLINE_LINUX_DEFAULT="nvidia_drm.modeset=1"

Save and run to update your config

doas update-grub

Reboot your pc and you should have your Nvidia graphicial drivers installed properly on your machine.

AMD

TODO when I get my hands on an AMD GPU