410f HOWTO: Install and configure NVIDIA drivers [Archive] - The FreeBSD Forums

PDA

View Full Version : HOWTO: Install and configure NVIDIA drivers


tangram
March 26th, 2009, 15:04
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. Do notice that there aren't any 64bit NVIDIA drivers for FreeBSD.

Bellow are the steps needed to install NVIDIA drivers on i386 FreeBSD:

% 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"

If your graphics card is AGP, 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

Finally:

# reboot

Additional ports of interest when configuring X with NVIDIA:
x11/nvidia-settings
x11/nvidia-xconfig

Possible workaround for crashes and blank screen problems:
# echo 'machdep.disable_mtrrs="1"' >> /boot/loader.conf

Further reading material can be found under:
http://www.freebsd.org/doc/en/books/handbook/x11.html
/usr/local/share/doc/NVDIA_GLX-1.0/

SirDice
March 26th, 2009, 15:08
If you don't use any linux programs you can compile the driver without linux support. Then you also don't need to add the linuxilator.

tangram
March 26th, 2009, 15:13
Yup.

The port's default option is off to LINUX. However gamers running stuff like Enemy Territory, RTCW and UT will appreciate the option and should enable it.

SirDice
March 26th, 2009, 15:17
Absolutely.. Also the linux-flashplugin needs it (which is currently the only reason why I have linux enabled).

DutchDaemon
March 26th, 2009, 15:23
Don't forget these very helpful ports:


x11/nvidia-settings Display Control Panel for X NVidia driver
x11/nvidia-xconfig Tool to manipulate X configuration files for the NVidia driver

tangram
March 26th, 2009, 15:37
Don't forget these very helpful ports:


x11/nvidia-settings Display Control Panel for X NVidia driver
x11/nvidia-xconfig Tool to manipulate X configuration files for the NVidia driver


Added them to the post ;)

jb_fvwm2
March 27th, 2009, 06:49
well, using NVIDIA I always got "agp detected, aborting setup!"
...........
Unfortunately,
using the guide above (I think), a blank screen, sometimes with a cursor.
one cntl-alt-del and other numerous keys-- to reboot and copy the old
xorg.conf back and comment device.hints, another cntl-alt-del to reboot
after the latter caused the blank screen to recur. Now back the
way it was. (3 ideas of what is wrong here but I can only guess)
...........
4 permutations of ways to install nvidia-drivers and 100 permutations
of ways to tweak xorg.conf, maybe in a decade there will be a way to
set it up in 20 minutes or so. Happy as long as I have the browser,
cursor, and window manager running...

SirDice
March 27th, 2009, 08:53
well, using NVIDIA I always got "agp detected, aborting setup!"
You can try removing device agp from your kernel config or add hint.agp.0.disabled="1" to /boot/device.hints.

jb_fvwm2
March 27th, 2009, 13:46
You can try removing device agp from your kernel config or add hint.agp.0.disabled="1" to /boot/device.hints.

The latter is one of the six or so modifications listed earlier
than my post, which when all are implemented, crash X on this
setup. Even if it is not nvidia-driver, the xorg.conf, or
the .hints, (guessing!) it may be an unknown overclock of the video
card, or CRT rather than LCD, or...

SirDice
March 27th, 2009, 14:03
To be honest, I can't make heads or tails of your posts.

tangram
March 27th, 2009, 14:22
The latter is one of the six or so modifications listed earlier
than my post, which when all are implemented, crash X on this
setup. Even if it is not nvidia-driver, the xorg.conf, or
the .hints, (guessing!) it may be an unknown overclock of the video
card, or CRT rather than LCD, or...

The purpose of this corner of the forum is presenting HowTos and FAQs. I think you'd more easily solve your problems/issues in the appropriate forum support section, in this case Desktop -> X.Org.

You need to be more verbose on what is the problem, the steps you've taken so far and post helpful stuff like error messages, logs and configuration files.

jb_fvwm2
March 27th, 2009, 20:25
Sorry. If you reread my post earlier, you can read
that I *maybe* could solve it, but am happy the way things are...
lack of time as always.

Carpetsmoker
March 28th, 2009, 22:11
Copy of my post at DF:

I checked what your configuration tweaks do, and they don't seem to be very useful:

Option "RenderAccel" "True"

According to the nVidia documentation:

Option "RenderAccel" "boolean"

Enable or disable hardware acceleration of the RENDER extension. Default:
hardware acceleration of the RENDER extension is enabled.


Option "NoRenderExtension" "boolean"

As I understand it, this option is not needed, and is useful mostly for disableing the RENDER extension, not for explicitly enabling it (It is always enabled if the X server supports it), from the nVidia documentation:

Option "NoRenderExtension" "boolean"
Disable the RENDER extension. Other than recompiling it, the X server does
not seem to have another way of disabling this. Fortunately, we can
control this from the driver so we export this option. This is useful in
depth 8 where RENDER would normally steal most of the default colormap.
Default: RENDER is offered when possible.


Option "NoFlip" "False"

Again, as I understand it this option is always enabled if supported, from the nVidia documentation:

Option "NoFlip" "boolean"

Disable OpenGL flipping; see Chapter 17 for a description. Default: OpenGL
will swap by flipping when possible.

[...]

o Flipping: When OpenGL flipping is enabled, OpenGL can perform buffer
swaps by changing which buffer the DAC scans out rather than copying the
back buffer contents to the front buffer; this is generally a much higher
performance mechanism and allows tearless swapping during the vertical
retrace (when __GL_SYNC_TO_VBLANK is set). The conditions under which
OpenGL can flip are slightly complicated, but in general: on GeForce or
newer hardware, OpenGL can flip when a single full screen unobscured
OpenGL application is running, and __GL_SYNC_TO_VBLANK is enabled.
Additionally, OpenGL can flip on Quadro hardware even when an OpenGL
window is partially obscured or not full screen or __GL_SYNC_TO_VBLANK is
not enabled.


Option "UseEdid" "True"

Enabled by default, no reason to set it, from the nVidia documentation:

Option "UseEDID" "boolean"

By default, the NVIDIA X driver makes use of a display device's EDID, when
available, during construction of its mode pool. The EDID is used as a
source for possible modes, for valid frequency ranges, and for collecting
data on the physical dimensions of the display device for computing the
DPI (see Appendix I). However, if you wish to disable the driver's use of
the EDID, you can set this option to False:

Option "UseEDID" "FALSE"

Note that, rather than globally disable all uses of the EDID, you can
individually disable each particular use of the EDID; e.g.,

Option "UseEDIDFreqs" "FALSE"
Option "UseEDIDDpi" "FALSE"
Option "ModeValidation" "NoEdidModes"

Default: True (use EDID).


Option "NvAGP" "1"

Again, this is the default, nVidia documentation:

When built with support for the FreeBSD AGP driver, 'nvidia.ko' will fall back
to using NvAGP when it doesn't detect 'agp.ko' (this will be the case when
'agp.ko' does not support your AGP chipset or was explicitly disabled with
device hints).

lillis
March 29th, 2009, 10:16
If anyone is having problems with a blank screen and computer hanging on startup, check this thread.
http://forums.freebsd.org/showthread.php?t=3065

tangram
March 30th, 2009, 13:33
If anyone is having problems with a blank screen and computer hanging on startup, check this thread.
http://forums.freebsd.org/showthread.php?t=3065

Glad you've solved your problem ;)

tangram
March 30th, 2009, 13:34
@ Carpetsmoker, thanks for the input.

Yeah those are default settings. I just figured they were important enough to have on xorg.conf as remainder not to change them.

gr1ml0ck
June 30th, 2009, 05:35
Possible workaround for crashes and blank screen problems:
# echo 'machdep.disable_mtrrs="1"' >> /etc/boot/loader.conf



Should this not be:

# echo 'machdep.disable_mtrrs=1' >> /etc/boot/loader.conf

without the quotes?

Didn't work for me until I removed them.

Just in case anyone else is still getting those mtrr errors ;)

tangram
June 30th, 2009, 09:40
If you want your loader.conf to contain
machdep.disable_mtrrx="1"

either edit the file and add it or use echo 'machdep.disable_mtrrs="1"' >> /boot/loader.conf.

If you echo 'machdep.disable_mtrrs=1' >> /boot/loader.conf then your /boot/loader.conf will contain:
machdep.disable_mtrrs=1

In the how to I suggested the quotes for consistency sake.

dennylin93
July 4th, 2009, 03:09
Possible workaround for crashes and blank screen problems:
# echo 'machdep.disable_mtrrs="1"' >> /etc/boot/loader.conf


Shouldn't it be /boot/loader.conf?

tangram
July 6th, 2009, 09:20
Yup. Fixed it.

ale
July 6th, 2009, 10:34
For nvidia-driver users who want to play linux-games with a linux_base > fc4, the solution is in this post.
The solution should be temporary as nvidia is aware of the problem and it should be fixed in future releases of the driver.

0