- If you are following the handbook on configuring Xorg, ignore what the handbook says about running
- Don't run
- If you already followed the handbook and created an xorg.conf make sure to remove /etc/X11/xorg.conf or /usr/local/etc/X11/xorg.conf before proceeding:
rm -f /etc/X11/xorg.conf /usr/local/etc/X11/xorg.conf
- Install x11/nvidia-driver:
pkg install nvidia-driver
For some older cards you need to use x11/nvidia-driver-340 or x11/nvidia-driver-304 instead. Consult NVIDIA's download page to see which driver version you need. Note that there is no need (and it's even counterproductive) to download the driver from that page.
sysrc kld_list+="nvidia-modeset"to add an entry to /etc/rc.conf to load the kernel modules at boot. sysrc(8) is a nice utility that safely edits /etc/rc.conf for you.
nvidia-modeset is only available for driver versions >= 358.009, if you to use an older version use
- Either reboot with
shutdown -r nowor load the required kernel modules now with
- Create the /usr/local/etc/X11/xorg.conf.d directory:
mkdir -p /usr/local/etc/X11/xorg.conf.d
- Use your favourite editor to create /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf with the following contents:
Section "Device" Identifier "NVIDIA Card" VendorName "NVIDIA Corporation" Driver "nvidia" EndSection
- At this point you can continue following the rest of the handbook on setting up a display manager and desktop environment.