Yes I know there are packaged nvidia drivers in the FreeBSD repo.
But they are old and do not support current Nvidia cards.
So I had to find out how manual installation of the driver is done.
As I didn't find solutions in the forums, I like to contribute my solution:
1. Download the driver from nvidia.com, unpack the file.
2. Make will croak first where the OS version is checked, complaining about an #ifdef that you need to change. Modify the version check so that it compiles.
3. Do a grep and find the about a dozen occurrences of "d_thread_t" in 4 files. These are deprecated now and have to be changed to "struct thread". After that compiling and installing will succeed.
4. Finally some configuration file editing:
As nvidia-settings will croak due to a missing library you can either use the version from the old package or just ignore this and take a standard template nvidia xorg.conf.
(A temporary solution could be packaging the old nvidia-settings version together with the new drivers, btw)
There is only one thing that apparently *must* be configured additionally.
You may have to explicitly add a modeline with your preferred resolution as DPMS seems to fail for some reason and the Xserver hangs in 640x480 else. Like this:
Modes "1920x1200"
In /etc/rc.conf linux_enable="YES" must be set.
Finally, in addition to the usual nvidia_load in /boot/loader.conf with the new drivers an additional modeset module must be loaded:
nvidia_load="YES"
nvidia-modeset_load="YES"
If you use the console and X concurrently, you might want to use sc, as vt still has a few nasty bugs.
After all these steps, the nvidia driver should probably run smoothly.
Hope this helps!
But they are old and do not support current Nvidia cards.
So I had to find out how manual installation of the driver is done.
As I didn't find solutions in the forums, I like to contribute my solution:
1. Download the driver from nvidia.com, unpack the file.
2. Make will croak first where the OS version is checked, complaining about an #ifdef that you need to change. Modify the version check so that it compiles.
3. Do a grep and find the about a dozen occurrences of "d_thread_t" in 4 files. These are deprecated now and have to be changed to "struct thread". After that compiling and installing will succeed.
4. Finally some configuration file editing:
As nvidia-settings will croak due to a missing library you can either use the version from the old package or just ignore this and take a standard template nvidia xorg.conf.
(A temporary solution could be packaging the old nvidia-settings version together with the new drivers, btw)
There is only one thing that apparently *must* be configured additionally.
You may have to explicitly add a modeline with your preferred resolution as DPMS seems to fail for some reason and the Xserver hangs in 640x480 else. Like this:
Modes "1920x1200"
In /etc/rc.conf linux_enable="YES" must be set.
Finally, in addition to the usual nvidia_load in /boot/loader.conf with the new drivers an additional modeset module must be loaded:
nvidia_load="YES"
nvidia-modeset_load="YES"
If you use the console and X concurrently, you might want to use sc, as vt still has a few nasty bugs.
After all these steps, the nvidia driver should probably run smoothly.
Hope this helps!