Tuesday, March 24, 2009

HowTo: Install and configure NVIDIA drivers on FreeBSD

FreeBSD's Ports collection contains the official NVIDIA binary drivers for hardware OpenGL rendering in X, using the GLX extensions.The x11/nvidia-driver points to NVIDIA's latest stable driver set.

If you are using a legacy card check NVIDIA's site to see which driver set supports your card and browse the Ports tree for the suitable driver version and install that instead.

Bellow are the steps needed to install NVIDIA drivers on i386 FreeBSD 7.1:
  • % su
  • # portsnap fetch update
  • # cd /usr/ports/x11/nvidia-drivers
  • # make config
  • # make install clean
  • # echo 'nvidia_load="YES"' >> /boot/loader.conf
  • # echo 'linux_enable="YES"' >> /etc/rc.conf
  • # echo 'hint.agp.0.disabled="1"' >> boot/device.hints
Basically start by updating your ports tree, installing the driver and preparing FreeBSD to load the NVIDIA kernel module it at boot time. Consider selecting ACPI (enable support for ACPI Power Management) and LINUX (build with support for Linux compatibility) port options.

Now let's proceed by editing /etc/X11/xorg.conf to have it use the NVIDIA driver and add some options to increase performance:
  • edit /etc/X11/xorg.conf and change the driver value from "nv" to "nvidia":
Driver "nvidia"
  • under the Device section of xorg.conf add the following option:
Option "NvAGP" "1"
Additional performance options can be enabled, however these might affect stability. To enable Side Band Addressing and Fast Writes add the following sysctls to /etc/sysctl.conf:
  • # echo "hw.nvidia.registry.EnableAGPSBA=1" >> /etc/sysctl.conf
  • # echo "hw.nvidia.registry.EnableAGPFW=1" >> /etc/sysctl.conf
  • # reboot
Further reading material can be found at:

No comments: