Although its possible to download NVIDIA drivers for freeBSD the easiest would be to install it from freshports with
pkg install -y nvidia-driver
Then setup NVIDIA. Note that these instructions are outdated.
This is done by adding below to vi /etc/rc.conf
kld_list="nvidia-modeset"
NEVER put nvidia_load="YES" in /boot/loader.conf
Create the /xorg.conf.d directory as follows
mkdir -p /usr/local/etc/X11/xorg.conf.d
then, add below into vi /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf
Section "Device"
Identifier "NVIDIA Card"
VendorName "NVIDIA Corporation"
Driver "nvidia"
EndSection
Although not required it is handy to install some NVIDIA tools.
pkg install -y nvidia-settings
pkg install -y nvidia-xconfig
Read these comments for discussions on installing NVIDIA drivers in FreeBSD.
Because x11/nvidia-driver port no longer installs Linux programs and libraries if you plan to use linuxulator you will want to install these libraries.
But before installing these you must configure linux binary compatibility.
kldload linux
kldload linux64
You can use kldstat to verify. Load them before attempting to build/install (next step).
pkg install -y linux-nvidia-libs
Some programs require mounting linprocfs (in /compat/linux/proc), some others require mounting linsysfsf (in /compat/linux/sys), and others require tmpfs (in /compat/linux/dev/shm). Add below to vi /etc/fstab
linprocfs /compat/linux/proc linprocfs rw 0 0
linsysfs /compat/linux/sys linsysfs rw 0 0
tmpfs /compat/linux/dev/shm tmpfs rw,mode=1777 0 0
Then to mount them one has to, say to mount tmpfs, mount /compat/linux/dev/shm.
In vi /etc/rc.conf add
linux_enable="YES"