# Nvidia drivers



## balanga (Feb 21, 2016)

I've just installed FreeBSD 10.2 on a Thinkpad T61 which uses an Nvidia graphics chip. There seem to be a few different Nvidia drivers around. How do I tell if I have to correct one installed?
Is there any benchmarking I can do on the system? I'm using Xfce and it seems a little choppy.. Debian, on the same machine appears to be much smoother.


----------



## talsamon (Feb 21, 2016)

`sysctl dev.nvidia` and search for your type here http://www.nvidia.com/Download/index.aspx.


----------



## balanga (Feb 21, 2016)

```
sysctl dev.nvidia
sysctl: unknown oid 'dev.nvidia': No such file or directory
```


----------



## talsamon (Feb 21, 2016)

Try: `lspci -vvv|grep -i nvidia`.


----------



## balanga (Feb 21, 2016)

```
root@FreeBSD:/ # lspci -vvv | grep -i nvidia
lspci: Command not found.
root@FreeBSD:/ #
```


----------



## talsamon (Feb 21, 2016)

Install sysutils/pciutils.


----------



## balanga (Feb 21, 2016)

I downloaded NVIDIA-FreeBSD-x86-340.96.tar.gz for a Quadro NVS 140M which is what the Lenovo site suggests I have here

https://support.lenovo.com/gb/en/documents/migr-67883#vid

Not sure what I need to do with the tarball.... presumably run make?...


----------



## talsamon (Feb 21, 2016)

There is a port for this. The version is a little bit older 340.93 - x11/nvidia-driver-340.


----------



## talsamon (Feb 21, 2016)

Before you install the nvidia-driver make a directory /compat/linux/proc. Write in /etc/fstab

```
linprocfs  /compat/linux/proc linprocfs  rw  0  0
```
and run `kldload linux`.


----------



## talsamon (Feb 21, 2016)

Also add to /etc/rc.conf

```
linux_enable="YES"
linux_load="YES"
linprocfs_load="YES"
```
and to
/boot/loader.conf

```
lindev_load="YES"
```


----------



## tobik@ (Feb 21, 2016)

balanga: Also see Thread 52311 (just use x11/nvidia-driver-340 instead of x11/nvidia-driver).


----------



## balanga (Feb 21, 2016)

talsamon said:


> Install sysutils/pciutils.




```
01:00.0 VGA compatible controller: NVIDIA Corporation G86M [Quadro NVS 140M] (rev a1) (prog-if 00 [VGA controller])
```


----------



## balanga (Feb 21, 2016)

Thanks to everyone for their help, I would never have stumbled on how to get this working - I'll see if I've managed after rebooting. After the installation I got this info:


```
Message from nvidia-driver-340-340.93:
To use these drivers, make sure that you have loaded the NVidia kernel
module, by doing

    # kldload nvidia

or adding

    nvidia_load="YES"

to your /boot/loader.conf.

If you build this port with FreeBSD AGP GART driver, make sure you have
agp.ko kernel module installed and loaded, since nvidia.ko will depend
on it, or have your kernel compiled with "device agp".  Otherwise, the
NVidia kernel module will not load.  Also, please set correct value for
``Option "NvAGP"'' in ``Device'' section of your X11 configuration file.

When building with Linux compatibility support, make sure that linux.ko
module is available as well (or have it compiled in kernel).  It can be
loaded via /boot/loader.conf, or later in the boot process if you add

    linux_enable="YES"

to your /etc/rc.conf.

If X.org cannot start and reports

    (EE) NVIDIA(0): Failed to obtain a shared memory identifier.

in /var/log/Xorg.0.log while actually you have ``options SYSVSHM''
enabled in kernel, the sysctl ``kern.ipc.shmall'' should be increased.

See /usr/local/share/doc/NVIDIA_GLX-1.0/README for more information.
```


----------



## talsamon (Feb 21, 2016)

Yes, forgot you have to add

```
nvidia_load="YES"
```
to /boot/loader.conf.

If you don't want reboot, you have to run `kldload nvidia`.


----------



## protocelt (Feb 21, 2016)

talsamon said:


> Yes, forgor you have to add
> 
> ```
> nvidia_load="YES"
> ...


A better suggestion, noted in tobik's thread he added in his reply above, is to add kld_list+=nvidia to /etc/rc.conf instead by running `sysrc kld_list+=nvidia`. It's more reliable.


----------



## balanga (Feb 21, 2016)

I've just rebooted and things are much better now. Thanks to everyone who helped.

Also I am now able to run `vidcontrol` whereas I was unable to before...


----------

