# Correct guide to install nvidia driver



## joplass (Jan 27, 2019)

Hello,

I have a brand new installation of 12.0-STABLE.  I want to install the nvidia driver for GeForce 8600 GT.  I am reading two methods:

FreeBSD Method
https://docs.freebsd.org/doc/7.3-RELEASE/usr/share/doc/en/articles/compiz-fusion/nvidia-setup.html
and nvidia Method
https://www.geforce.com/drivers/results/73224

Which one gives less troubles?  or is there a correct guide better than these that one can use?

Thank you,


----------



## scottro (Jan 27, 2019)

Short answer, the handbook's write up is incomplete but you would prefer to use packages and/or ports than use the driver from NVidia. 

That FreeBSD guide is from 7.3 and out of date.  I don't know if the latest version is up to date or not--the handbook tends to leave out things.
You should be able to do it by using the nvidia-driver package. If you have an older nvidia card, then you would use the nvidia-driver-340.

There is a package message that tells you what to add to /boot/loader.conf (you may be able to add to rc.conf instead, I'd have to google).  I don't 
think using the package gives you the message but it comes down to adding
nvidia-modeset_load="YES" to /boot/loader.conf unless you are using the 340 legacy driver. (You'll have to check your card to see if it uses a legacy driver or the current one). If using the legacy driver that changes to nvidia_load="YES".  

Also, using the package has a dependency on the Linux compatibility layer, so you will add linux_enable="YES" to /etc/rc.conf.

I find that it's often handy to install the pkg nvidia-xconfig and use it to 
create an /etc/X11/xorg.conf. Not sure what it puts in there that gets missed, and it seems to be a simple solution, rather than figuring what should go in in.  

If using multimonitors, I also find that the GUI nvidia-settings package can be useful in setting it  up.


----------



## Sevendogsbsd (Jan 27, 2019)

Try the set up without using nvidia-xconfig first. Normally, a configuration for xorg is not needed but if it is, it is better to create individual configuration files under /usr/local/etc/X11/xorg.conf.d/ if automatic configuration doesn't work.

You may also find that you receive an error about Linux emulation when you go to install the nvidia driver package so you may need to enable Linux emulation by adding 
	
	



```
linux_enable="YES"
```
 to /etc/rc.conf . You can then run `kldload linux` to load the module and proceed with the nvidia driver install.


----------



## drhowarddrfine (Jan 28, 2019)

How to set up nvidia and xorg

I thought there was more in the Handbook. Seems sparse at first glance or maybe I looked at the wrong chapter.


----------



## joplass (Jan 28, 2019)

Thank you kindly all for your replies.  

I tried the BSD way using nvidia-driver-340 but it seems I need to have kernel source file in /usr/src.  Looking around, sysinstall could have helped but no longer in service.  I then found another tool I can't remember the name of right now but that tool did not have "configuration" to lead me to kernel source files.  

Can someone please point me to another tool that lead to kernel source files?  I am using 12.0-STABLE.  

I hate to have to annoy you guys but I spent my Sunday afternoon trying to solve this issue.


----------



## Sevendogsbsd (Jan 28, 2019)

Never worked with STABLE before but looks like you can ftp the source down from here: Releases but that is (I think) for RELEASE and not STABLE, so you'll have to back up the dir tree until you find STABLE. You would need to untar the file at that point. Here is an article on this, but for an older release: Kernel Source Install

Not sure if you can use `bsdinstall` to do this, I have not tried.


----------



## SirDice (Jan 28, 2019)

joplass said:


> Can someone please point me to another tool that lead to kernel source files? I am using 12.0-STABLE.


The only way to get to any -STABLE version is by using the source. So you either already have them or you installed some sort of -SNAPSHOT version. 

As this is a new installation and you're not yet fluent in using FreeBSD I suggest you reinstall using 12.0-RELEASE and staying with a -RELEASE. Once you understand how things work and how each FreeBSD version relates to another you can try a -STABLE branch.

Handbook: 23.4. Tracking a Development Branch

The 'stable' in 12.0-STABLE (or 11-STABLE) refers to the stability of the API/ABI, not to its general fitness or its ability to run without issues.


----------



## joplass (Jan 28, 2019)

That's what I get for not reading.  I wrongly assumed that STABLE was the end product and RELEASE was a WIP.  

I will try Sevendogsbsd's suggestion.  If that does not work I will go with RELEASE.

Thanks.


----------



## Sevendogsbsd (Jan 28, 2019)

Personally, if this is your first venture into FreeBSD, I would take Sir Dice's suggestion and stick with RELEASE. Up to you...


----------



## joplass (Jan 28, 2019)

Sevendogsbsd said:


> Personally, if this is your first venture into FreeBSD, I would take Sir Dice's suggestion and stick with RELEASE. Up to you...


Will do!  Grrr I put so much work into the current installation. 

Thank you guys, lesson learned.


----------

