back to the beginning

FreeBSD 12.0 NVIDIA Graphics

Last updated: 2019-02-24


Install script

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

Manually setup NVIDIA card

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.

  1. Activate Linux compatibility
  2. 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.


    You can reboot or load the Linux module into the kernel (you can't install nvidia-driver without it):

    kldload linux

  3. Install the nvidia-driver package
  4. 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

  5. Create an X11 profile for the driver.
  6. 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"

    You can reboot or load the nvidia module into the kernel:

    kldload nvidia-modeset
    kldload nvidia

back to the beginning

Something need fixing? Contact me: