Proprietary Video Drivers
To install the proprietary NVIDIA driver firstly you should enable the void-repo-nonfree repository:
# xbps-install -Sy void-repo-nonfree
and then install the nvidia package:
# xbps-install -Sy nvidia
If you use GeForce 8/9, ION and 100-300 series cards you should install the nvidia340 package.
If you own a somewhat older GPU card (Geforce 6/7/8) you should install the nvidia304 package instead.
Some drivers may require running nvidia-xconfig as superuser or using sudo.
Once it is installed you should reboot and then the `nvidia` kernel module should be already working. If it does not work, you can always blacklist the `nvidia` kernel module and then boot from `single user` (selecting it in the GRUB menu).
If you have a laptop or netbook, your Nvidia card's model ends with an M like "GeForce GTX 680M", and you also have an Intel card, then you almost certainly have a card than uses the Optimus technology. This requires a little manual set up.
First, you need to find your card's BusID:
# lspci | grep VGA
The PCI address is the first 7 characters of the line that mentions NVIDIA. It will look something like 01:00.0. In xorg.conf, you will need to format it as #:#:#; e.g. 01:00.0 would be formatted as 1:0:0.
Then you need to create a custom /etc/X11/xorg.conf file. Since Void Linux is a rolling distribution, you're likely using a version of xorg higher than 1.17.2. You can check what version you're running with:
# Xorg -version
For xorg versions 1.17.2 or higher, create your custom /etc/X11/xorg.conf file with these directives:
Section "Module" Load "modesetting" EndSection Section "Device" Identifier "nvidia" Driver "nvidia" BusID "PCI:PCI address determined earlier" # e.g. BusID "PCI:1:0:0" Option "AllowEmptyInitialConfiguration" EndSection
For versions of xorg 1.17.1 or lower, this should work:
Section "ServerLayout" Identifier "layout" Screen 0 "nvidia" Inactive "intel" EndSection Section "Device" Identifier "nvidia" Driver "nvidia" BusID "PCI:PCI address determined earlier" # e.g. BusID "PCI:1:0:0" EndSection Section "Screen" Identifier "nvidia" Device "nvidia" Option "AllowEmptyInitialConfiguration" EndSection Section "Device" Identifier "intel" Driver "modesetting" EndSection Section "Screen" Identifier "intel" Device "intel" EndSection
In either case, you'll need to add a couple of lines to your ~/.xinitrc file:
xrandr --setprovideroutputsource modesetting NVIDIA-0 xrandr --auto
If you're using a display manager, the xrandr lines above should be called by the display manager versus .xinitrc. How/where is dependent upon the particular display manager.
Switching back to the open source drivers
Remove the nvidia package:
# xbps-remove -RyvF nvidia
Reinstall the libGL package:
# xbps-install -Sy libGL
On some systems it may be necessary to install the libEGL package as well:
# xbps-install -Sy libEGL
and then reboot your system.
If removing nvidia-libs fails, try
# xbps-remove -F nvidia-libs
# xbps-install -Sy libGL libEGL libGLES