# nvidia-driver installation hanged due to kern.mk error



## MrRoberts (Sep 24, 2013)

```
"/usr/src/sys/conf/kern.mk"
```
 
This happened after I attempted to install nvidia-driver*.*


----------



## fonz (Sep 24, 2013)

Please post the actual error message(s), using [CODE] tags.


----------



## DutchDaemon (Sep 24, 2013)

Nine out of ten times, the kernel sources are not installed. Search the forums for close to a million similar cases.


----------



## MrRoberts (Sep 24, 2013)

I showed my step-by-step what I did, which got removed by the admin. For what reason, I don't know.

@DutchDaemon, if you're talking about Subversion as building the kernel sources this is what I did. I may have missed a step or two. I installed Subversion and did the `svn checkout`. I updated it (lwcdir and /usr/src).

I ran the `portsnap extract` and `portsnap update`. I added

```
nvidia_load="YES"
```
 into the loader.conf file. I attempted to install nvidia-driver via `make install clean`. Sorry, I'm on another computer and the errors I see kept referring to:

```
/usr/src/sys/conf/kern.mk
/usr/src/sys/conf/kmod.mk
fatal errors encountered -- cannot continue
*** [do-build] Error Code 1
*** [install] Error code 1
```


----------



## SirDice (Sep 24, 2013)

MrRoberts said:
			
		

> I showed my step-by-step what I did, which got removed by the admin. For what reason, I don't know.


Because it was filled to the rim with [font] tags and it took too much effort to remove it all.



> I installed Subversion and did the `svn checkout`. I updated it (lwcdir and /usr/src).


What source did you checkout and what version do you have?


----------



## wblock@ (Sep 24, 2013)

lwcdir is not a directory, it's meant to be the name of the source directory.  For example:
`svn up /usr/src`
or
`cd /usr/src && svn up`


----------



## MrRoberts (Sep 24, 2013)

FreeBSD 9.1 amd64. `svn checkout [url=http://svn0.eu.freebsd.org/base/head]http://svn0.eu.freebsd.org/base/head[/url] /usr/src` is what I used. I did update via `cd /usr/src && svn up`.


----------



## DutchDaemon (Sep 24, 2013)

You pulled down HEAD (-CURRENT, FreeBSD 10) instead of the 9.1 source tree that Nvidia was looking for. You need to have the same source tree version as is in your `uname -a`. So it's either http://svn0.eu.freebsd.org/base/release/9.1.0/ (a standard 9.1-RELEASE without patches), http://svn0.eu.freebsd.org/base/releng/9.1/ (a patched 9.1-RELEASE) or http://svn0.eu.freebsd.org/base/stable/9/ (but that should show a 9.2-PRERELEASE in `uname`).


----------



## MrRoberts (Sep 24, 2013)

Dutch, what you suggested got my Nvidia working. I assumed that 9.1-RELEASE is the current one? Version 10 isn't out yet? Thank you again.


----------



## DutchDaemon (Sep 24, 2013)

9.1-RELEASE is the most current production release of FreeBSD 9 (there's also a productive FreeBSD 8 branch). Version 9.2 is in the offing (now in beta stage). Version 10 is to be released later (now in alpha stage). The only relevant thing here is that ports or modules that need kernel sources expect to find the kernel sources that correspond with the currently running version (as shown in `uname -a`). In your case that was 9.1-RELEASE (either 9.1.0 (the CD/DVD version) or 9.1 patched (the CD/DVD version updated with security patches, showing up as -p_n_ in `uname`)).


----------

