Last updated: 2019-02-24
Resources
All the steps are below, but this could be so much easier if the installer did some of the work for you. This script does the install (save it and run it). Yes, I know it is less safe than installing manually. On a freshly installed system it should be fine.
echo 'linux_load="YES"' >> /boot/loader.conf
echo 'nvidia-modeset_load="YES"' >> /boot/loader.conf
echo 'nvidia_load="YES"' >> /boot/loader.conf
kldload linux
pkg install nvidia-driver
mkdir -p /usr/local/etc/X11/xorg.conf.d
printf 'Section "Device" \n Identifier "NVIDIA Card" \n VendorName "NVIDIA Corporation" \n Driver "nvidia" \n EndSection' > /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf
kldload nvidia-modeset
kldload nvidia
There are several steps necessary for setting up a nvidia graphics card, but it is not difficult. I install all my other packages at once before installing the nvidia driver.
Add to /boot/loader.conf (while here we'll add the nvidia stuff, too). Technically, these could be loaded in /etc/rc.conf, but I had issues of it not loading when I tried that.
linux_load="YES"
nvidia-modeset_load="YES"
nvidia_load="YES"
You can reboot or load the Linux module into the kernel (you can't install nvidia-driver without it):
kldload linux
Unless you have a very old card you can just use the standard package (I have a 670 and use this)
pkg install nvidia-driver
Create a file named /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf with these contents:
Section "Device"
Identifier "NVIDIA Card"
VendorName "NVIDIA Corporation"
Driver "nvidia"
EndSection
You can reboot or load the nvidia module into the kernel:
kldload nvidia-modeset
kldload nvidia
Something need fixing? Contact me: