Skip to content

Instantly share code, notes, and snippets.

@inscapist
Last active September 22, 2024 18:35
Show Gist options
  • Select an option

  • Save inscapist/83fd43b49c17e46059eb4fe0c1ae8bea to your computer and use it in GitHub Desktop.

Select an option

Save inscapist/83fd43b49c17e46059eb4fe0c1ae8bea to your computer and use it in GitHub Desktop.
Nvidia and Xorg on Void Linux

Xorg

Don't install xorg, but install xorg-minimal to prevent installing unrelated and potentially conflicting video drivers

Installation

Use chroot method to install void. or add nomodeset in the installer screen (press "e" in grub menu)

Drivers

Install nvidia-dkms nvidia-libs nvidia-gtklibs

Kernel parameters

Set nvidia-drm.modeset=1 to kernel parameters in /etc/default/grub. Then run update-grub

Initramfs

Void uses dracut instead of mkinitcpio. Create a file at /etc/dracut.conf.d/nvidia.conf with the content:

add_drivers+=" nvidia nvidia_modeset nvidia_uvm nvidia_drm "

Note: surrounding space is important

Then run dracut --force or dracut -f

@inscapist
Copy link
Author

inscapist commented Apr 7, 2024

Brightness

Make sure there's a folder /sys/class/backlight/nvidia_0. If its not (eg. acpi_video_0), it means nvidia driver isn't working properly.

Then, do the following test (change to 50%):

echo 50 | sudo tee /sys/class/backlight/nvidia_0/brightness

Install xbacklight package and bind keys to the xbacklight commands, for eg on I3:

bindsym XF86MonBrightnessUp exec xbacklight +10
bindsym XF86MonBrightnessDown exec xbacklight -10

@inscapist
Copy link
Author

inscapist commented Apr 7, 2024

Hopefully i can get a laptop with AMD gpu soon :/

@inscapist
Copy link
Author

inscapist commented Apr 7, 2024

DPI settings

To change DPI, add this in ~/.Xresources.

Xft.dpi: 144

and then xrdb -merge ~/.Xresources. This is because xorg is a server, and resources are stored in server. See https://wiki.archlinux.org/title/X_resources.


Try the following values. Should be multiples of 96

96, 120 (25% higher), 144 (50% higher), 168 (75% higher), 192 (100% higher)


For best result, pair Xft.dpi: 144 with export GDK_DPI_SCALE=1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment