22c0e HOWTO: Install and configure NVIDIA drivers - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Miscellaneous > Howtos & FAQs (Moderated)

Howtos & FAQs (Moderated) Would you like to share some of your solutions for certain problems? Tips or tricks? Post here. All new topics are automatically moderated.

Reply
 
Thread Tools Display Modes
  #1  
Old March 26th, 2009, 15:04
tangram's Avatar
tangram tangram is offline
Member
 
Join Date: Nov 2008
Location: Portugal
Posts: 524
Thanks: 13
Thanked 65 Times in 56 Posts
Default HOWTO: Install and configure NVIDIA drivers

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:

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

Code:
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:

Code:
# echo "hw.nvidia.registry.EnableAGPSBA=1" >> /etc/sysctl.conf
# echo "hw.nvidia.registry.EnableAGPFW=1" >> /etc/sysctl.conf
Finally:

Code:
# reboot
Additional ports of interest when configuring X with NVIDIA:
Code:
x11/nvidia-settings
x11/nvidia-xconfig
Possible workaround for crashes and blank screen problems:
Code:
# 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/

Last edited by tangram; July 6th, 2009 at 09:21. Reason: Fixed loader.conf.
Reply With Quote
The Following User Says Thank You to tangram For This Useful Post:
douglasfim (February 5th, 2010)
  #2  
Old March 26th, 2009, 15:08
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,852
Thanks: 48
Thanked 2,061 Times in 1,890 Posts
Default

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.
Reply With Quote
  #3  
Old March 26th, 2009, 15:13
tangram's Avatar
tangram tangram is offline
Member
 
Join Date: Nov 2008
Location: Portugal
Posts: 524
Thanks: 13
Thanked 65 Times in 56 Posts
Default

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.

Last edited by tangram; March 26th, 2009 at 15:14. Reason: Fixed typo.
Reply With Quote
  #4  
Old March 26th, 2009, 15:17
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,852
Thanks: 48
Thanked 2,061 Times in 1,890 Posts
Default

Absolutely.. Also the linux-flashplugin needs it (which is currently the only reason why I have linux enabled).
Reply With Quote
  #5  
Old March 26th, 2009, 15:23
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,935
Thanks: 30
Thanked 1,932 Times in 1,351 Posts
Default

Don't forget these very helpful ports:

Code:
x11/nvidia-settings       Display Control Panel for X NVidia driver
x11/nvidia-xconfig        Tool to manipulate X configuration files for the NVidia driver
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #6  
Old March 26th, 2009, 15:37
tangram's Avatar
tangram tangram is offline
Member
 
Join Date: Nov 2008
Location: Portugal
Posts: 524
Thanks: 13
Thanked 65 Times in 56 Posts
Default

Quote:
Originally Posted by DutchDaemon View Post
Don't forget these very helpful ports:

Code:
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
Reply With Quote
  #7  
Old March 27th, 2009, 06:49
jb_fvwm2 jb_fvwm2 is offline
Senior Member
 
Join Date: Nov 2008
Posts: 1,399
Thanks: 61
Thanked 147 Times in 131 Posts
Default

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...
Reply With Quote
  #8  
Old March 27th, 2009, 08:53
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,852
Thanks: 48
Thanked 2,061 Times in 1,890 Posts
Default

Quote:
Originally Posted by jb_fvwm2 View Post
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.
Reply With Quote
  #9  
Old March 27th, 2009, 13:46
jb_fvwm2 jb_fvwm2 is offline
Senior Member
 
Join Date: Nov 2008
Posts: 1,399
Thanks: 61
Thanked 147 Times in 131 Posts
Default

Quote:
Originally Posted by SirDice View Post
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...
Reply With Quote
  #10  
Old March 27th, 2009, 14:03
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,852
Thanks: 48
Thanked 2,061 Times in 1,890 Posts
Default

To be honest, I can't make heads or tails of your posts.
Reply With Quote
  #11  
Old March 27th, 2009, 14:22
tangram's Avatar
tangram tangram is offline
Member
 
Join Date: Nov 2008
Location: Portugal
Posts: 524
Thanks: 13
Thanked 65 Times in 56 Posts
Default

Quote:
Originally Posted by jb_fvwm2 View Post
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.
Reply With Quote
  #12  
Old March 27th, 2009, 20:25
jb_fvwm2 jb_fvwm2 is offline
Senior Member
 
Join Date: Nov 2008
Posts: 1,399
Thanks: 61
Thanked 147 Times in 131 Posts
Default

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.
Reply With Quote
  #13  
Old March 28th, 2009, 22:11
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Member
 
Join Date: Nov 2008
Location: Eindhoven, Netherlands
Posts: 797
Thanks: 19
Thanked 124 Times in 94 Posts
Default

Copy of my post at DF:

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

Quote:
Originally Posted by tangram
Option "RenderAccel" "True"
According to the nVidia documentation:

Code:
Option "RenderAccel" "boolean"

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

Quote:
Originally Posted by tangram
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:

Code:
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.

Quote:
Originally Posted by tangram
Option "NoFlip" "False"
Again, as I understand it this option is always enabled if supported, from the nVidia documentation:

Code:
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.

Quote:
Originally Posted by tangram
Option "UseEdid" "True"
Enabled by default, no reason to set it, from the nVidia documentation:

Code:
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).

Quote:
Originally Posted by tangram
Option "NvAGP" "1"
Again, this is the default, nVidia documentation:

Code:
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).
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #14  
Old March 29th, 2009, 10:16
lillis lillis is offline
Junior Member
 
Join Date: Mar 2009
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #15  
Old March 30th, 2009, 13:33
tangram's Avatar
tangram tangram is offline
Member
 
Join Date: Nov 2008
Location: Portugal
Posts: 524
Thanks: 13
Thanked 65 Times in 56 Posts
Default

Quote:
Originally Posted by lillis View Post
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
Reply With Quote
  #16  
Old March 30th, 2009, 13:34
tangram's Avatar
tangram tangram is offline
Member
 
Join Date: Nov 2008
Location: Portugal
Posts: 524
Thanks: 13
Thanked 65 Times in 56 Posts
Default

@ 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.
Reply With Quote
  #17  
Old June 30th, 2009, 05:35
gr1ml0ck's Avatar
gr1ml0ck gr1ml0ck is offline
Junior Member
 
Join Date: Jun 2009
Posts: 32
Thanks: 8
Thanked 37 Times in 3 Posts
Default I'm a bit of a noob but....

Quote:
Originally Posted by tangram View Post

Possible workaround for crashes and blank screen problems:
Code:
# echo 'machdep.disable_mtrrs="1"' >> /etc/boot/loader.conf
Should this not be:

Code:
# 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
__________________
"Do or Do Not.... there is no try."
Reply With Quote
  #18  
Old June 30th, 2009, 09:40
tangram's Avatar
tangram tangram is offline
Member
 
Join Date: Nov 2008
Location: Portugal
Posts: 524
Thanks: 13
Thanked 65 Times in 56 Posts
Default

If you want your loader.conf to contain
Code:
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:
Code:
machdep.disable_mtrrs=1
In the how to I suggested the quotes for consistency sake.

Last edited by tangram; July 6th, 2009 at 09:20. Reason: tags...
Reply With Quote
  #19  
Old July 4th, 2009, 03:09
dennylin93 dennylin93 is offline
Member
 
Join Date: Dec 2008
Posts: 784
Thanks: 34
Thanked 103 Times in 71 Posts
Default

Quote:
Originally Posted by tangram View Post
Possible workaround for crashes and blank screen problems:
Code:
# echo 'machdep.disable_mtrrs="1"' >> /etc/boot/loader.conf
Shouldn't it be /boot/loader.conf?
Reply With Quote
  #20  
Old July 6th, 2009, 09:20
tangram's Avatar
tangram tangram is offline
Member
 
Join Date: Nov 2008
Location: Portugal
Posts: 524
Thanks: 13
Thanked 65 Times in 56 Posts
Default

Yup. Fixed it.
Reply With Quote
  #21  
Old July 6th, 2009, 10:34
ale's Avatar
ale ale is offline
Senior Member
 
Join Date: Nov 2008
Location: Roma
Posts: 1,064
Thanks: 0
Thanked 160 Times in 146 Posts
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Minimal install of Xorg - howto? cpcnw X.Org 26 April 22nd, 2012 06:23
KDE4.1.4 Install/Configure Question Trebuchet KDE 16 February 4th, 2009 02:21
How to configure pf for three ISPs? wellwet Firewalls 2 January 5th, 2009 14:17
video drivers hirohitosan Installing & Upgrading 2 December 9th, 2008 15:16
HOWTO: Install and setup MLDonkey on FreeBSD tangram Howtos & FAQs (Moderated) 0 November 17th, 2008 11:30


All times are GMT +1. The time now is 07:03.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0