# HOWTO: Setup Xorg with NVIDIA's driver



## tobik@ (Jul 11, 2015)

If you are following the handbook on configuring Xorg, ignore what the handbook says about running `Xorg -configure`.
 Don't run `Xorg -configure`
 If you already followed the handbook and created an xorg.conf make sure to remove /etc/X11/xorg.conf or /usr/local/etc/X11/xorg.conf before proceeding: `rm -f /etc/X11/xorg.conf /usr/local/etc/X11/xorg.conf`
 Install x11/nvidia-driver: `pkg install nvidia-driver`

For some older cards you need to use x11/nvidia-driver-340 or x11/nvidia-driver-304 instead.  Consult NVIDIA's download page to see which driver version you need.  Note that there is no need (and it's even counterproductive) to download the driver from that page.

 Run `sysrc kld_list+="nvidia-modeset"` to add an entry to /etc/rc.conf to load the kernel modules at boot. sysrc(8) is a nice utility that safely edits /etc/rc.conf for you.

nvidia-modeset is only available for driver versions >= 358.009, if you to use an older version use `sysrc kld_list+="nvidia"` instead.
 Either reboot with `shutdown -r now` or load the required kernel modules now with `kldload nvidia-modeset` or `kldload nvidia`
 Create the /usr/local/etc/X11/xorg.conf.d directory:
`mkdir -p /usr/local/etc/X11/xorg.conf.d`
 Use your favourite editor to create /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf with the following contents:

```
Section "Device"
        Identifier "NVIDIA Card"
        VendorName "NVIDIA Corporation"
        Driver "nvidia"
EndSection
```

 At this point you can continue following the rest of the handbook on setting up a display manager and desktop environment.


----------



## protocelt (Jul 12, 2015)

Thanks for this! Just want to add that the Linux compatibility option is on by default in the port so the linux(4) kernel module needs to be loaded by adding linux_load="YES" to /boot/loader.conf. I'm not sure however if this is loaded at boot automatically as a dependent module when the Nvidia kernel driver is loaded or not. I always set up my environment before installing ports when installing FreeBSD. 

Edit: Just checked and linux.ko is loaded automatically as a dependent module at boot but if installing x11/nvidia-driver from ports it will need to be loaded as a prerequisite to installing the port unless the Linux compatibility option is turned off.


----------



## protocelt (Feb 24, 2016)

For users having tearing problems when using compositing with Nvidia Kepler and newer based cards:

From what I understand, starting with Nvidia's Kepler based GPUs, Nvidia removed the hardware support for tearing/Vsync in the GPU and added additions to control this in the driver instead. For many users of FreeBSD, Linux and even Windows in some cases, this does not prevent tearing very well if at all. Nvidia's answer to this is it's newer G-Sync technology built into some monitors and supported by _some_ cards. If you do not have a card and monitor that supports G-Sync and have tearing issues, there is a workaround.

Enabling the options "ForceFullCompositionPipeline" and "TripleBuffer" in the /usr/local/etc/X11/xorg.conf/10-nvidia.conf file referenced above should fix the tearing issues. The drawback is a slight penalty in performance but for every day desktop use, this shouldn't really be noticed at all. It may be noticed more when playing games under FreeBSD, though YMMV. I didn't notice much of a difference at all myself in my limited testing.

If you are following tobik's instructions above, your 10-nvidia.conf file would look similar to the following with these changes included:


```
Section "Device"
        Identifier     "NVIDIA Card"
        VendorName     "NVIDIA Corporation"
        Driver         "nvidia"
        Option         "AccelMethod" "none"
        Option         "TripleBuffer" "True"
        Option         "MetaModes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
EndSection
```

I tested this using both compositing under KDE as well as x11-wm/compton.


----------



## Deleted member 45312 (Feb 25, 2016)

protocelt said:


> For users having tearing problems when using compositing with Nvidia Kepler and newer based cards:
> 
> From what I understand, starting with Nvidia's Kepler based GPUs, Nvidia removed the hardware support for tearing/Vsync in the GPU and added additions to control this in the driver instead. For many users of FreeBSD, Linux and even Windows in some cases, this does not prevent tearing very well if at all. Nvidia's answer to this is it's newer G-Sync technology built into some monitors and supported by _some_ cards. If you do not have a card and monitor that supports G-Sync and have tearing issues, there is a workaround.
> 
> ...


Hi,

Thank you very much, I was looking for that trick for a long time !

My video adapter is an Nvidia GT610 and tearing disappears with your instructions. But another problem appears : my mouse cursor disappears when it approach the top of the screen.
I am using FreeBSD 10.2-RELEASE-p9 and xorg-7.7_2 with fvwm-2.6.5_7.


----------



## protocelt (Feb 25, 2016)

dlegrand said:


> But another problem appears : my mouse cursor disappears when it approach the top of the screen.
> I am using FreeBSD 10.2-RELEASE-p9 and xorg-7.7_2 with fvwm-2.6.5_7.


This issue is fixed in newer versions of the Nvidia driver which have not been pulled into the ports tree yet.


----------



## Deleted member 45312 (Feb 25, 2016)

protocelt said:


> This issue is fixed in newer versions of the Nvidia driver which have not been pulled into the ports tree yet.


Nice !


----------



## bald_bohemian (Feb 28, 2016)

tobik said:


> If you are following the handbook on configuring Xorg, ignore what the handbook says about running `Xorg -configure`.
> Don't run `Xorg -configure`
> If you already followed the handbook and created an xorg.conf make sure to remove /etc/X11/xorg.conf or /usr/local/etc/X11/xorg.conf before proceeding: `rm -f /etc/X11/xorg.conf /usr/local/etc/X11/xorg.conf`
> Install x11/nvidia-driver: `pkg install x11/nvidia-driver`
> ...



I tried going to this page to find out which version of the driver I should use.  The only information I was able to find is that I would need version 361.28. Is there a way to translate this version number to whether I need the 330, 304 or regular nvidia-driver?  Thank you


----------



## tobik@ (Feb 28, 2016)

bald_bohemian said:


> I tried going to this page to find out which version of the driver I should use.  The only information I was able to find is that I would need version 361.28. Is there a way to translate this version number to whether I need the 330, 304 or regular nvidia-driver?  Thank you


There's no port for that version yet AFAICT  The version numbers should correspond with the port versions.

What GPU do you have?


----------



## bald_bohemian (Feb 28, 2016)

I have the Nvidia GF108 [GeForce GT 430]


----------



## tobik@ (Feb 28, 2016)

bald_bohemian said:


> I have the Nvidia GF108 [GeForce GT 430]


In that case you should be fine with just using x11/nvidia-driver (see http://us.download.nvidia.com/XFree86/FreeBSD-x86_64/346.96/README/supportedchips.html)


----------



## bald_bohemian (Feb 28, 2016)

tobik said:


> In that case you should be fine with just using x11/nvidia-driver (see http://us.download.nvidia.com/XFree86/FreeBSD-x86_64/346.96/README/supportedchips.html)


Thank you!


----------



## protocelt (Mar 13, 2016)

For users that are having problems or have questions about Xorg and Nvidia GPUs, please create a new thread for your question in a support forum that would be more appropriate.

If you have a question directly related to this Howto/FAQ, or have something to add to it, you are always still welcome to post it to this thread. 

Thanks!


----------



## tobik@ (Apr 27, 2016)

A quick note for those who want to build x11/nvidia-driver or related ports themselves.
Make sure you have the correct source tree in /usr/src. Errors like

```
make[2]: "/usr/share/mk/bsd.kmod.mk" line 12: Unable to locate the kernel source tree. Set SYSDIR to override
*** Error code 1
```
 during building or 
	
	



```
KLD nvidia:ko: depends on kernel - not available or version mismatch
linker_load_file: Unsupported file type
```
 when loading the driver are strong hints that you have either no sources or the wrong sources installed.

For FreeBSD 10.3-RELEASE you can fetch the correct tree via *one* of these two methods:

 `svnlite checkout https://svn.freebsd.org/base/releng/10.3 /usr/src`
 Or grab and extract the src.txz tarball (it's the one you can select in the installer as well):

```
fetch https://download.freebsd.org/ftp/releases/amd64/10.3-RELEASE/src.txz
tar -C / -xf src.txz
```
 Starting an update with `freebsd-update fetch` and `freebsd-update install` is recommend even if you've already updated previously. `freebsd-update` will make sure that the sources match the most recent patch level.


----------



## Deleted member 48958 (Aug 6, 2016)

protocelt said:


> For users having tearing problems when using compositing with Nvidia Kepler and newer based cards:
> 
> ```
> Option  "MetaModes" "nvidia-auto-select +0+0 { [b]ForceFullCompositionPipeline[/b] = On }"
> ```


"ForceCompositionPipeline" works better for me (GeForce 9 Series).

```
Option         "metamodes" "1280x1024 +0+0 { [b]ForceCompositionPipeline[/b] = On }"
```
I'm using it in "Screen" section in /etc/X11/xorg.conf

```
Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "metamodes" "1280x1024 +0+0 { ForceCompositionPipeline = On }"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
```



			
				http://http.download.nvidia.com/XFree86/FreeBSD-x86_64/340.96/README/configtwinview.html said:
			
		

> "ForceCompositionPipeline": possible values are "On" or "Off". The NVIDIA X driver can use a composition pipeline to apply X screen transformations and rotations. "ForceCompositionPipeline" can be used to force the use of this pipeline, even when no transformations or rotations are applied to the screen.
> 
> "ForceFullCompositionPipeline": possible values are "On" or "Off". This option implicitly enables "ForceCompositionPipeline" and additionally makes use of the composition pipeline to apply ViewPortOut scaling.



Also it is possible to start your WM (window manager) with right resolution with this fix via ~/.xinitrc:

```
#!/bin/sh
[u]nvidia-settings --assign CurrentMetaMode="1280x1024 +0+0 { ForceCompositionPipeline = On }"[/u]
exec /usr/local/bin/wmaker
```
(x11/nvidia-settings should be installed).


----------



## free-and-bsd (Aug 8, 2016)

Interesting!
I have two computers with (older) NVIDIA cards, both run 11.0-CURRENT, and neither ever needed ANY /usr/local/etc/X11/xorg.conf.d/*.conf file to explicitly inform my system to use NVIDIA driver.

However, what I _did_ need was to instruct Xorg how to handle my dual monitors the way I needed it. The problem was, while using one screen for 2 monitors it would always put them in the "wrong" order -- and me not being able to physically swap them for certain reasons. So, instead of physically swapping them I figured out the far more gracious  way to do that.

DON'T use any nvidia-settings or nvidia-xconfig or any such stuff. They are WAY too complicated for this simple task! Both will create huge and overly complicated xorg.conf file stuffed with specific nvidia-related options and settings you don't really need for a simple task of using 2 monitors with default driver-decided settings in the _needed_ order.

It just took me to put a simple twin.conf file into /usr/local/etc/X11/xorg.conf.d:

```
Section "ServerLayout"
  Identifier "myLayout"
  Screen 0   "myScreen" 0 0
EndSection

Section "Device"
  Identifier   "Card0"
  Driver   "nvidia"
  VendorName   "NVIDIA Corporation"
EndSection

Section "Screen"
Identifier  "myScreen"
  Device  "Card0"
  Option   "MetaModes"   "DFP-1:nvidia-auto-select,DFP-0:nvidia-auto-select"
  Option   "MetaModeOrientation"   "DFP-1 LeftOf DFP-0"
EndSection
```
I've taken the exact data (DFP-1 and such) from /var/log/Xorg.0.log, BTW. It clearly reports there whether it is using configuration from /usr/local/etc/X11/xorg.conf.d or not, and why not. So it wouldn't use anything defined in "Screen" section alone unless a "Device" section be present as well. But with monitors and input devices it seems quite safe to stay with defaults.

I'm putting this here partly because this is just as simple as they come, while whatever I've found on the web was far more complicated (even at the very helpful Arch Wiki page).


----------



## beans10001 (Nov 29, 2016)

I was struggling to get Xorg working on a late-2013 iMac and this thread did the trick. Many thanks!!


----------



## free-and-bsd (Nov 30, 2016)

free-and-bsd said:


> ...and neither ever needed ANY /usr/local/etc/X11/xorg.conf.d/*.conf file to explicitly inform my system to use NVIDIA driver...


Well, with the latest nvidia-driver I actually _had_ to as it doesn't seem to work without one.


----------



## Lucky (Oct 29, 2017)

Hey guys! Thank you everyone for your input here as it's been a great help so far. (3 days at this so far... and yes... losing my mind) Could I please ask for a little assistance though... I get a black screen with the cursor frozen in the center and have to force it to exit.
Can anyone see where my problem is.
System. freebsd 11.1 with a nvidia 1050 card attached to an external Monitor via HDMI

rc.conf

```
hald_enable="YES"
dbus_enable="YES"
```

/boot/loader.conf

```
linux_load="YES" # have tried with this loaded from rc.conf as well
nvidia_load="YES"  # have tried with and without this included
nvidia_name="nvidia"  # have tried with and without this included
nvidia_modeset_load="YES"
nvidia_modeset_name="nvidia-modeset"
```

Via latest updated ports
xorg
nvidia-driver
nvidia-xconfig
nvidia-settings


Script I'm now using # have tried everything on this page and every other page on every search engine result (even minimal as well as free-and-bsd's examples)


```
Section "ServerLayout"
  Identifier "Default Layout"
  Screen 0 "HDMI1"
EndSection
Section "Module"
  Load "glx"
EndSection
Section "Monitor"
  Identifier "HDMI"
EndSection
Section "Device"
  Identifier "NVIDIA"
  Driver "nvidia"
  BusID "PCI:1:0:0"
  VendorName "NVIDIA Corporation"
EndSection
Section "Screen"
  Identifier "HDMI1"
  Device "NVIDIA"
  Monitor "HDMI"
  DefaultDepth 24
  Option "IgnoreEDID" "True"
  Option "ConnectedMonitor" "DFP-1"
  Option "UseDisplayDevice" "DFP-1"
  SubSection "Display"
    Depth 24
    Modes "1024x768_60"
  EndSubSection
EndSection
```

And this is what's going on in the background before I exit the black screen... I feel like I have a mouse problem that's causing it to hang as it always seems to end the log file on the mouse...

Thank you to anyone that's kind enough to help me out here. Much appreciated...


```
X.Org X Server 1.18.4
Release Date: 2016-07-19
[    37.423] X Protocol Version 11, Revision 0
[    37.423] Build Operating System: FreeBSD 11.1-RELEASE amd64
[    37.423] Current Operating System: FreeBSD bsd 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
[    37.423] Build Date: 29 October 2017  04:22:44PM
[    37.423]
[    37.423] Current version of pixman: 0.34.0
[    37.423]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[    37.423] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    37.423] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Oct 29 16:53:16 2017
[    37.488] (==) Using config file: "/etc/X11/xorg.conf"
[    37.527] (==) ServerLayout "Default Layout"
[    37.527] (**) |-->Screen "HDMI1" (0)
[    37.527] (**) |   |-->Monitor "HDMI"
[    37.528] (**) |   |-->Device "NVIDIA"
[    37.528] (==) Automatically adding devices
[    37.528] (==) Automatically enabling devices
[    37.528] (==) Not automatically adding GPU devices
[    37.549] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    37.656] (==) FontPath set to:
    /usr/local/share/fonts/misc/,
    /usr/local/share/fonts/TTF/,
    /usr/local/share/fonts/OTF/,
    /usr/local/share/fonts/Type1/,
    /usr/local/share/fonts/100dpi/,
    /usr/local/share/fonts/75dpi/
[    37.656] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[    37.656] (II) The server relies on devd to provide the list of input devices.
    If no devices become available, reconfigure devd or disable AutoAddDevices.
[    37.662] (II) Loader magic: 0x80cc10
[    37.663] (II) Module ABI versions:
[    37.663]     X.Org ANSI C Emulation: 0.4
[    37.663]     X.Org Video Driver: 20.0
[    37.663]     X.Org XInput driver : 22.1
[    37.663]     X.Org Server Extension : 9.0
[    37.663] (--) PCI:*(0:0:2:0) 8086:591b:1558:850a rev 4, Mem @ 0xdd000000/16777216, 0xa0000000/536870912, I/O @ 0x0000f000/64, BIOS @ 0x????????/65536
[    37.663] (--) PCI: (0:1:0:0) 10de:1c8d:1558:850a rev 161, Mem @ 0xde000000/16777216, 0xc0000000/268435456, 0xd0000000/33554432, I/O @ 0x0000e000/128
[    37.663] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[    37.663] (II) LoadModule: "glx"
[    37.677] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[    38.327] (II) Module glx: vendor="NVIDIA Corporation"
[    38.327]     compiled for 4.0.2, module version = 1.0.0
[    38.327]     Module class: X.Org Server Extension
[    38.328] (II) NVIDIA GLX Module  384.90  Tue Sep 19 17:25:09 PDT 2017
[    38.342] (II) LoadModule: "nvidia"
[    38.342] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[    38.420] (II) Module nvidia: vendor="NVIDIA Corporation"
[    38.420]     compiled for 4.0.2, module version = 1.0.0
[    38.420]     Module class: X.Org Video Driver
[    38.429] (II) NVIDIA dlloader X Driver  384.90  Tue Sep 19 17:02:53 PDT 2017
[    38.429] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[    38.431] (--) Using syscons driver with X support (version 2.0)
[    38.431] (--) using VT number 9

[    38.443] (II) Loading sub module "fb"
[    38.443] (II) LoadModule: "fb"
[    38.443] (II) Loading /usr/local/lib/xorg/modules/libfb.so
[    38.449] (II) Module fb: vendor="X.Org Foundation"
[    38.449]     compiled for 1.18.4, module version = 1.0.0
[    38.449]     ABI class: X.Org ANSI C Emulation, version 0.4
[    38.449] (II) Loading sub module "wfb"
[    38.449] (II) LoadModule: "wfb"
[    38.450] (II) Loading /usr/local/lib/xorg/modules/libwfb.so
[    38.458] (II) Module wfb: vendor="X.Org Foundation"
[    38.458]     compiled for 1.18.4, module version = 1.0.0
[    38.458]     ABI class: X.Org ANSI C Emulation, version 0.4
[    38.458] (II) Loading sub module "ramdac"
[    38.458] (II) LoadModule: "ramdac"
[    38.458] (II) Module "ramdac" already built-in
[    38.479] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    38.479] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
[    38.479] (==) NVIDIA(0): RGB weight 888
[    38.479] (==) NVIDIA(0): Default visual is TrueColor
[    38.479] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[    38.495] (**) NVIDIA(0): Option "ConnectedMonitor" "DFP-1"
[    38.495] (**) NVIDIA(0): Option "UseDisplayDevice" "DFP-1"
[    38.495] (**) NVIDIA(0): Enabling 2D acceleration
[    38.495] (**) NVIDIA(0): ConnectedMonitor string: "DFP-1"
[    38.904] (--) NVIDIA(0): Valid display device(s) on GPU-0 at PCI:1:0:0
[    38.904] (--) NVIDIA(0):     DFP-0
[    38.904] (--) NVIDIA(0):     DFP-1
[    38.904] (**) NVIDIA(0): Using ConnectedMonitor string "DFP-1".
[    38.905] (II) NVIDIA(0): NVIDIA GPU GeForce GTX 1050 (GP107-A) at PCI:1:0:0 (GPU-0)
[    38.905] (--) NVIDIA(0): Memory: 2097152 kBytes
[    38.905] (--) NVIDIA(0): VideoBIOS: 86.07.2a.00.47
[    38.905] (II) NVIDIA(0): Detected PCI Express Link width: 16X
[    38.905] (--) NVIDIA(GPU-0): DFP-0: disconnected
[    38.905] (--) NVIDIA(GPU-0): DFP-0: Internal DisplayPort
[    38.905] (--) NVIDIA(GPU-0): DFP-0: 1440.0 MHz maximum pixel clock
[    38.905] (--) NVIDIA(GPU-0):
[    38.905] (--) NVIDIA(GPU-0): DFP-1: connected
[    38.905] (--) NVIDIA(GPU-0): DFP-1: Internal TMDS
[    38.905] (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock
[    38.905] (--) NVIDIA(GPU-0):
[    38.993] (WW) NVIDIA(0): No valid modes for "DFP-1:1280x720_60"; removing.
[    38.993] (WW) NVIDIA(0):
[    38.993] (WW) NVIDIA(0): Unable to validate any modes; falling back to the default mode
[    38.993] (WW) NVIDIA(0):     "nvidia-auto-select".
[    38.993] (WW) NVIDIA(0):
[    38.994] (II) NVIDIA(0): Validated MetaModes:
[    38.994] (II) NVIDIA(0):     "DFP-1:nvidia-auto-select"
[    38.994] (II) NVIDIA(0): Virtual screen size determined to be 1024 x 768
[    38.997] (WW) NVIDIA(0): DFP-1 does not have an EDID, or its EDID does not contain a
[    38.997] (WW) NVIDIA(0):     maximum image size; cannot compute DPI from DFP-1's EDID.
[    38.997] (==) NVIDIA(0): DPI set to (75, 75); computed from built-in default
[    38.997] (--) Depth 24 pixmap format is 32 bpp
[    38.998] (II) NVIDIA: Reserving 24576.00 MB of virtual memory for indirect memory
[    38.998] (II) NVIDIA:     access.
[    39.056] (II) NVIDIA(0): Setting mode "DFP-1:nvidia-auto-select"
[    39.142] (==) NVIDIA(0): Disabling shared memory pixmaps
[    39.142] (==) NVIDIA(0): Backing store enabled
[    39.142] (==) NVIDIA(0): Silken mouse enabled
[    39.143] (==) NVIDIA(0): DPMS enabled
[    39.143] (WW) NVIDIA(0): Option "IgnoreEDID" is not used
[    39.143] (II) Loading sub module "dri2"
[    39.143] (II) LoadModule: "dri2"
[    39.143] (II) Module "dri2" already built-in
[    39.143] (II) NVIDIA(0): [DRI2] Setup complete
[    39.143] (II) NVIDIA(0): [DRI2]   VDPAU driver: nvidia
[    39.144] (--) RandR disabled
[    39.150] (II) Initializing extension GLX
[    39.150] (II) Indirect GLX disabled.
[    39.738] (II) config/devd: probing input devices...
[    39.738] (II) config/devd: adding input device (null) (/dev/kbdmux)
[    39.738] (II) LoadModule: "kbd"
[    39.747] (II) Loading /usr/local/lib/xorg/modules/input/kbd_drv.so
[    39.748] (II) Module kbd: vendor="X.Org Foundation"
[    39.748]     compiled for 1.18.4, module version = 1.9.0
[    39.748]     Module class: X.Org XInput Driver
[    39.748]     ABI class: X.Org XInput driver, version 22.1
[    39.748] (II) Using input driver 'kbd' for 'kbdmux'
[    39.748] (**) kbdmux: always reports core events
[    39.748] (**) kbdmux: always reports core events
[    39.748] (**) Option "Protocol" "standard"
[    39.748] (**) Option "XkbRules" "base"
[    39.748] (**) Option "XkbModel" "pc105"
[    39.748] (**) Option "XkbLayout" "us"
[    39.748] (**) Option "config_info" "devd:kbdmux"
[    39.748] (II) XINPUT: Adding extended input device "kbdmux" (type: KEYBOARD, id 6)
[    39.751] (II) config/devd: kbdmux is enabled, ignoring device ukbd0
[    39.751] (II) config/devd: kbdmux is enabled, ignoring device atkbd0
[    39.751] (II) config/devd: adding input device (null) (/dev/sysmouse)
[    39.751] (II) LoadModule: "mouse"
[    39.751] (II) Loading /usr/local/lib/xorg/modules/input/mouse_drv.so
[    39.763] (II) Module mouse: vendor="X.Org Foundation"
[    39.763]     compiled for 1.18.4, module version = 1.9.2
[    39.763]     Module class: X.Org XInput Driver
[    39.763]     ABI class: X.Org XInput driver, version 22.1
[    39.763] (II) Using input driver 'mouse' for 'sysmouse'
[    39.763] (**) sysmouse: always reports core events
[    39.763] (**) Option "Device" "/dev/sysmouse"
[    39.763] (==) sysmouse: Protocol: "Auto"
[    39.763] (**) sysmouse: always reports core events
[    39.763] (==) sysmouse: Emulate3Buttons, Emulate3Timeout: 50
[    39.763] (**) sysmouse: ZAxisMapping: buttons 4 and 5
[    39.763] (**) sysmouse: Buttons: 5
[    39.763] (**) Option "config_info" "devd:sysmouse"
[    39.763] (II) XINPUT: Adding extended input device "sysmouse" (type: MOUSE, id 7)
[    39.763] (**) sysmouse: (accel) keeping acceleration scheme 1
[    39.763] (**) sysmouse: (accel) acceleration profile 0
[    39.763] (**) sysmouse: (accel) acceleration factor: 2.000
[    39.763] (**) sysmouse: (accel) acceleration threshold: 4
[    39.763] (II) sysmouse: SetupAuto: hw.iftype is 4, hw.model is 0
[    39.763] (II) sysmouse: SetupAuto: protocol is SysMouse
[    39.763] (II) config/devd: device /dev/ums0 already opened
[    39.821] (II) config/devd: adding input device Mouse (/dev/psm0)
[    39.821] (II) Using input driver 'mouse' for 'Mouse'
[    39.821] (**) Mouse: always reports core events
[    39.821] (**) Option "Device" "/dev/psm0"
[    39.821] (==) Mouse: Protocol: "Auto"
[    39.821] (**) Mouse: always reports core events
[    39.880] (==) Mouse: Emulate3Buttons, Emulate3Timeout: 50
[    39.880] (**) Mouse: ZAxisMapping: buttons 4 and 5
[    39.880] (**) Mouse: Buttons: 5
[    39.880] (**) Option "config_info" "devd:psm0"
[    39.880] (II) XINPUT: Adding extended input device "Mouse" (type: MOUSE, id 8)
[    39.880] (**) Mouse: (accel) keeping acceleration scheme 1
[    39.880] (**) Mouse: (accel) acceleration profile 0
[    39.880] (**) Mouse: (accel) acceleration factor: 2.000
[    39.880] (**) Mouse: (accel) acceleration threshold: 4
[    39.898] (II) Mouse: SetupAuto: hw.iftype is 3, hw.model is 0
[    39.898] (II) Mouse: SetupAuto: protocol is PS/2
[    40.348] (II) Mouse: ps2EnableDataReporting: succeeded
[    61.077] Failed to switch from vt09 to vt02: Device busy
[    69.107] (II) config/devd: terminating backend...
[    69.107] (II) UnloadModule: "mouse"
[    69.107] (II) UnloadModule: "mouse"
[    69.107] (II) UnloadModule: "kbd"
[    69.360] (II) NVIDIA(GPU-0): Deleting GPU-0
[    69.361] (II) Server terminated successfully (0). Closing log file.
```


----------



## free-and-bsd (Oct 29, 2017)

IMPORTANT: HALD is DISABLED in default builds of X. DEVD is now used for keyboard | mouse automatic configuration, and it JUST works.
It seems, you need these in your rc.conf (I've had them all this while, without them the frozen mouse problem):

```
moused_enable="YES"
mouse_type="auto"
devd_enable="YES"
```



Lucky said:


> Script I'm now using


 Do you place that "script" of yours in /etc/X11/xorg.conf? With the new nvidia-driver it uses /usr/local/etc/X11/xorg.conf.d directory for configuration files.For example, I have a monitor.conf containing sections "Monitor" and "Device", and driver.conf having only "Device" section.
It seems also, that all the stuff about "connected monitors" and such is silently ignored by nvidia-driver, as well as this line: 





> ```
> Modes "1024x768_60"
> ```


 (see below in your log). This type of string seems to work with nvidia-driver, like others have posted above:

```
Option      "MetaModes" "CRT-0:1280x1024+0+0"
```
 (you put DFP-1 instead of CRT-0 and your resolution).
So now you can analyze your log file





> :
> [    37.488] (==) *Using config file: "/etc/X11/xorg.conf"*
> ... blablabla...
> [    38.905] (--) NVIDIA(GPU-0): DFP-0: disconnected
> ...


1) You see it IS using configuration file at /etc/X11/xorg.conf — this way you can make sure whether or not your conf is used.
2) Your connected monitor is indeed DFP-1, but it doesn't seem to supply EDID, and the driver seems to be unable to determine the valid modes without it. And option "IgnoreEDID" is _not_ used by the driver.
I had that problem with one of my monitors (it suddenly stopped supplying EDID!), so I found EDID file for my particular monitor model by googling and supplied it via xorg.conf, and it worked. There is a config option to supply EDID from file.
3) Per this log your mouse/keyboard must be all right... So your frozen mouse may  result from enabling HALD and not enabling DEVD, which by default must be the other way around. Or maybe both are enabled? Need to fix that.

Don't know that thing about *switching from vt09 to vt02*. You should know better what you're doing on your computer.


----------



## Lucky (Oct 30, 2017)

free-and-bsd said:


> IMPORTANT: HALD is DISABLED in default builds of X. DEVD is now used for keyboard | mouse automatic configuration, and it JUST works.
> It seems, you need these in your rc.conf (I've had them all this while, without them the frozen mouse problem):
> 
> ```
> ...







I forgot how incredibly kind and helpful freebsd people are! Thank you free-and-bsd! Still not much luck. Trying with the xorg.conf file from a linux install to get a base. Still won't load though. Lots of trail and error...


----------



## free-and-bsd (Oct 30, 2017)

Well it seems from your X log that devd _is_ working. Does your mouse work in console mode before you start X?


----------



## Lucky (Oct 30, 2017)

free-and-bsd said:


> Well it seems from your X log that devd _is_ working. Does your mouse work in console mode before you start X?


On the system, I am getting some "acpi-warning-argument-4-type-mismatch"
ACPI Warning: \_SB_.PCI0.RP01.PXSX._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package]

Day 4 and I really am losing it. I've tried so many combos and read so much on the subject, but just can't get it. Was just hoping I could get a desktop like kde or gnome running on the lappy under bsd and use it as the main os... The only option that's worked is running scfb driver @ 800x600
Can you see if I'm missing anything? Here's the system and files I've been working with. I'm SO grateful for your help as I feel as though I'm not alone on this, but not sure my options anymore. I've tried to the conf files from a nvdia driven kubuntu install, but still wasn't able to get it working on bsd. All I get is a black screen with a mouse cursor in the middle when I startx and the desktop just runs behind the scenes... Don't care about the external monitor. Just the lappy monitor, but even unplugged, (only lappy screen), still same results...

If you can see something I'm missing, could you 'PLEASE" let me know.
And... free-and-bsd for all your help so far, I have to say, thank you so much!



RC.CONF

```
hostname="bsd"
keymap="jp.106.kbd"
ifconfig_re0="DHCP"
sshd_enable="YES"
dumpdev="AUTO"
dbus_enable="YES"
hald_enable="YES"
linux_enable="YES"
lpd_enable="NO"
cupsd_enable="YES"
apache24_enable="YES"
kld_list="nvidia-modeset"
```


LOADER.CONF

```
kern.ipc.shmseg=1024
kern.ipc.shmmni=1024
kern.maxproc=10000
mmc_load="YES"
mmcsd_load="YES"
sdhci_load="YES"
fuse_load="YES"
coretemp_load="YES"
tmpfs_load="YES"
aio_load="YES"
libiconv_load="YES"
libmchain_load="YES"
cd9660_iconv_load="YES"
msdosfs_iconv_load="YES"
nvidia_modeset_load="YES"
kern.vty=vt
```

XORG.CONF

```
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 384.59  (root@bsd)  Mon Oct 30 11:28:46 AEDT 2017

Section "ServerLayout"
    Identifier     "Default Layout"
    Screen      0  "HDMI SCREEN" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Module"
    Load           "glx"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "keyboard"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "Monitor"

    # Horizsync    30-71
    # Vertrefresh    50-160
    Identifier     "HDMI"
    VendorName     "Samsung"
    ModelName      "Samsung SyncMaster 793S/793V/CM173G"
    HorizSync       24.0 - 94.0
    VertRefresh     24.0 - 87.0
    Gamma           1
    ModeLine       "640x480@60" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
    ModeLine       "640x480@72" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync
    ModeLine       "640x480@75" 31.5 640 656 720 840 480 481 484 500 -hsync -vsync
    ModeLine       "640x480@85" 36.0 640 696 752 832 480 481 484 509 -hsync -vsync
    ModeLine       "800x600@56" 36.0 800 824 896 1024 600 601 603 625 +hsync +vsync
    ModeLine       "800x600@72" 50.0 800 856 976 1040 600 637 643 666 +hsync +vsync
    ModeLine       "800x600@75" 49.5 800 816 896 1056 600 601 604 625 +hsync +vsync
    ModeLine       "800x600@85" 56.3 800 832 896 1048 600 601 604 631 +hsync +vsync
    ModeLine       "800x600@60" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync
    ModeLine       "832x624@75" 57.284 832 864 928 1152 624 625 628 667 -hsync -vsync
    ModeLine       "1024x768@85" 94.5 1024 1072 1168 1376 768 769 772 808 +hsync +vsync
    ModeLine       "1024x768@75" 78.8 1024 1040 1136 1312 768 769 772 800 +hsync +vsync
    ModeLine       "1024x768@70" 75.0 1024 1048 1184 1328 768 771 777 806 -hsync -vsync
    ModeLine       "1024x768@60" 65.0 1024 1048 1184 1344 768 771 777 806 -hsync -vsync
    ModeLine       "1024x768@43" 44.9 1024 1032 1208 1264 768 768 776 817 +hsync +vsync interlace
    ModeLine       "1152x864@75" 108.0 1152 1216 1344 1600 864 865 868 900 +hsync +vsync
    ModeLine       "1280x960@60" 102.1 1280 1360 1496 1712 960 961 964 994 -hsync +vsync
    ModeLine       "1280x1024@60" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
    ModeLine       "1400x1050@60" 122.61 1400 1488 1640 1880 1050 1051 1054 1087 -hsync +vsync
EndSection

Section "Device"
    Identifier     "intel"
    Driver         "modesetting"
    Option         "AccelMethod" "None"
    BusID          "PCI:0:2:0"
EndSection

Section "Device"
    Identifier     "NVIDIA 1050"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA [GeForce GTX 1050]"
    BusID          "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier     "intel"
    Device         "intel"
    Monitor        "HDMI"
EndSection

Section "Screen"
    Identifier     "HDMI SCREEN"
    Device         "NVIDIA 1050"
    Monitor        "HDMI"
    DefaultDepth    24
    Option         "DFP-0" "96 x 96"
    Option         "ModeValidation" "AllowNonEdidModes"
    Option         "IgnoreEDIDChecksum" "DFP-0"
 # Option "AllowEmptyInitialConfiguration" "on"
    Option         "ConnectedMonitor" "DFP-0"
    Option         "UseDisplayDevice" "DFP-0"
    Option         "MetaModes" "DFP-0:nvidia-auto-select,DFP-1:nvidia-auto-select"
 # Option   "MetaModeOrientation"   "DFP-0 LeftOf DFP-1"
    Option         "ConstrainCursor" "off"
    Option         "UseEDID" "false"
    SubSection     "Display"
        Depth       24
        Modes      "1024x768@70" "1024x768@60" "1024x768@75" "1024x768@43" "1024x768@85" "1152x864@75" "832x624@75" "1280x960@60" "800x600@60" "1280x1024@60" "800x600@85" "1400x1050@60" "800x600@75" "800x600@72" "800x600@56" "640x480@85" "640x480@75" "640x480@72" "640x480@60"
    EndSubSection
EndSection
```

XORG.0.LOG


```
[  1579.733]
X.Org X Server 1.18.4
Release Date: 2016-07-19
[  1579.733] X Protocol Version 11, Revision 0
[  1579.734] Build Operating System: FreeBSD 11.0-RELEASE-p13 amd64
[  1579.734] Current Operating System: FreeBSD bsd 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
[  1579.734] Build Date: 19 October 2017  09:03:10AM
[  1579.734]
[  1579.734] Current version of pixman: 0.34.0
[  1579.734]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[  1579.734] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  1579.734] (==) Log file: "/var/log/Xorg.0.log", Time: Mon Oct 30 12:00:44 2017
[  1579.734] (==) Using config file: "/etc/X11/xorg.conf"
[  1579.734] (==) ServerLayout "Default Layout"
[  1579.734] (**) |-->Screen "HDMI SCREEN" (0)
[  1579.734] (**) |   |-->Monitor "HDMI"
[  1579.734] (**) |   |-->Device "NVIDIA 1050"
[  1579.734] (**) |   |-->GPUDevice "NVIDIA 1050"
[  1579.734] (**) |-->Input Device "Keyboard0"
[  1579.734] (**) |-->Input Device "Mouse0"
[  1579.734] (==) Automatically adding devices
[  1579.734] (==) Automatically enabling devices
[  1579.734] (==) Not automatically adding GPU devices
[  1579.734] (==) Max clients allowed: 256, resource mask: 0x1fffff
[  1579.734] (==) FontPath set to:
    /usr/local/share/fonts/misc/,
    /usr/local/share/fonts/TTF/,
    /usr/local/share/fonts/OTF/,
    /usr/local/share/fonts/Type1/,
    /usr/local/share/fonts/100dpi/,
    /usr/local/share/fonts/75dpi/
[  1579.734] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[  1579.734] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[  1579.734] (WW) Disabling Keyboard0
[  1579.734] (WW) Disabling Mouse0
[  1579.734] (II) Loader magic: 0x813b70
[  1579.734] (II) Module ABI versions:
[  1579.734]     X.Org ANSI C Emulation: 0.4
[  1579.734]     X.Org Video Driver: 20.0
[  1579.734]     X.Org XInput driver : 22.1
[  1579.734]     X.Org Server Extension : 9.0
[  1579.734] (--) PCI:*(0:0:2:0) 8086:591b:1558:850a rev 4, Mem @ 0xdd000000/16777216, 0xa0000000/536870912, I/O @ 0x0000f000/64, BIOS @ 0x????????/65536
[  1579.734] (--) PCI: (0:1:0:0) 10de:1c8d:1558:850a rev 161, Mem @ 0xde000000/16777216, 0xc0000000/268435456, 0xd0000000/33554432, I/O @ 0x0000e000/128
[  1579.734] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[  1579.734] (II) LoadModule: "glx"
[  1579.734] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[  1579.738] (II) Module glx: vendor="NVIDIA Corporation"
[  1579.738]     compiled for 4.0.2, module version = 1.0.0
[  1579.738]     Module class: X.Org Server Extension
[  1579.738] (II) NVIDIA GLX Module  384.90  Tue Sep 19 17:25:09 PDT 2017
[  1579.738] (II) LoadModule: "nvidia"
[  1579.738] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[  1579.738] (II) Module nvidia: vendor="NVIDIA Corporation"
[  1579.738]     compiled for 4.0.2, module version = 1.0.0
[  1579.738]     Module class: X.Org Video Driver
[  1579.738] (II) NVIDIA dlloader X Driver  384.90  Tue Sep 19 17:02:53 PDT 2017
[  1579.738] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[  1579.738] (--) Using syscons driver with X support (version 2.0)
[  1579.738] (--) using VT number 9

[  1579.740] (II) Loading sub module "fb"
[  1579.740] (II) LoadModule: "fb"
[  1579.740] (II) Loading /usr/local/lib/xorg/modules/libfb.so
[  1579.740] (II) Module fb: vendor="X.Org Foundation"
[  1579.740]     compiled for 1.18.4, module version = 1.0.0
[  1579.740]     ABI class: X.Org ANSI C Emulation, version 0.4
[  1579.740] (II) Loading sub module "wfb"
[  1579.740] (II) LoadModule: "wfb"
[  1579.740] (II) Loading /usr/local/lib/xorg/modules/libwfb.so
[  1579.740] (II) Module wfb: vendor="X.Org Foundation"
[  1579.740]     compiled for 1.18.4, module version = 1.0.0
[  1579.740]     ABI class: X.Org ANSI C Emulation, version 0.4
[  1579.740] (II) Loading sub module "ramdac"
[  1579.740] (II) LoadModule: "ramdac"
[  1579.740] (II) Module "ramdac" already built-in
[  1579.740] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[  1579.740] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
[  1579.740] (==) NVIDIA(0): RGB weight 888
[  1579.740] (==) NVIDIA(0): Default visual is TrueColor
[  1579.740] (**) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[  1579.740] (**) NVIDIA(0): Option "ModeValidation" "AllowNonEdidModes"
[  1579.740] (**) NVIDIA(0): Option "ConstrainCursor" "off"
[  1579.740] (**) NVIDIA(0): Option "UseEDID" "false"
[  1579.740] (**) NVIDIA(0): Option "ConnectedMonitor" "DFP-0"
[  1579.740] (**) NVIDIA(0): Option "IgnoreEDIDChecksum" "DFP-0"
[  1579.740] (**) NVIDIA(0): Option "MetaModes" "DFP-0:nvidia-auto-select,DFP-1:nvidia-auto-select"
[  1579.740] (**) NVIDIA(0): Option "UseDisplayDevice" "DFP-0"
[  1579.740] (**) NVIDIA(0): Enabling 2D acceleration
[  1579.740] (**) NVIDIA(0): ConnectedMonitor string: "DFP-0"
[  1579.740] (**) NVIDIA(0): Ignoring EDIDs
[  1579.952] (--) NVIDIA(0): Valid display device(s) on GPU-0 at PCI:1:0:0
[  1579.953] (--) NVIDIA(0):     DFP-0
[  1579.953] (--) NVIDIA(0):     DFP-1
[  1579.953] (**) NVIDIA(0): Using ConnectedMonitor string "DFP-0".
[  1579.953] (II) NVIDIA(0): NVIDIA GPU GeForce GTX 1050 (GP107-A) at PCI:1:0:0 (GPU-0)
[  1579.953] (--) NVIDIA(0): Memory: 2097152 kBytes
[  1579.953] (--) NVIDIA(0): VideoBIOS: 86.07.2a.00.47
[  1579.953] (II) NVIDIA(0): Detected PCI Express Link width: 16X
[  1579.953] (--) NVIDIA(GPU-0): DFP-0: connected
[  1579.953] (--) NVIDIA(GPU-0): DFP-0: Internal DisplayPort
[  1579.953] (--) NVIDIA(GPU-0): DFP-0: 1440.0 MHz maximum pixel clock
[  1579.953] (--) NVIDIA(GPU-0):
[  1579.953] (--) NVIDIA(GPU-0): DFP-1: disconnected
[  1579.953] (--) NVIDIA(GPU-0): DFP-1: Internal TMDS
[  1579.953] (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock
[  1579.953] (--) NVIDIA(GPU-0):
[  1579.953] (**) NVIDIA(GPU-0): Mode Validation Overrides for DFP-0:
[  1579.953] (**) NVIDIA(GPU-0):     AllowNonEdidModes
[  1579.962] (II) NVIDIA(0): Validated MetaModes:
[  1579.962] (II) NVIDIA(0):     "DFP-0:nvidia-auto-select,DFP-1:nvidia-auto-select"
[  1579.962] (II) NVIDIA(0): Virtual screen size determined to be 1024 x 768
[  1579.983] (WW) NVIDIA(0): DFP-0 does not have an EDID, or its EDID does not contain a
[  1579.983] (WW) NVIDIA(0):     maximum image size; cannot compute DPI from DFP-0's EDID.
[  1579.983] (==) NVIDIA(0): DPI set to (75, 75); computed from built-in default
[  1579.983] (--) Depth 24 pixmap format is 32 bpp
[  1579.983] (II) NVIDIA: Reserving 24576.00 MB of virtual memory for indirect memory
[  1579.983] (II) NVIDIA:     access.
[  1580.007] (II) NVIDIA(0): Setting mode "DFP-0:nvidia-auto-select,DFP-1:nvidia-auto-select"
[  1580.055] (==) NVIDIA(0): Disabling shared memory pixmaps
[  1580.055] (==) NVIDIA(0): Backing store enabled
[  1580.055] (==) NVIDIA(0): Silken mouse enabled
[  1580.055] (==) NVIDIA(0): DPMS enabled
[  1580.055] (WW) NVIDIA(0): Option "DFP-0" is not used
[  1580.055] (II) Loading sub module "dri2"
[  1580.055] (II) LoadModule: "dri2"
[  1580.055] (II) Module "dri2" already built-in
[  1580.055] (II) NVIDIA(0): [DRI2] Setup complete
[  1580.055] (II) NVIDIA(0): [DRI2]   VDPAU driver: nvidia
[  1580.055] (--) RandR disabled
[  1580.055] (II) Initializing extension GLX
[  1580.055] (II) Indirect GLX disabled.
[  1580.119] (II) config/devd: probing input devices...
[  1580.119] (II) config/devd: adding input device (null) (/dev/kbdmux)
[  1580.119] (II) LoadModule: "kbd"
[  1580.119] (II) Loading /usr/local/lib/xorg/modules/input/kbd_drv.so
[  1580.119] (II) Module kbd: vendor="X.Org Foundation"
[  1580.119]     compiled for 1.18.4, module version = 1.9.0
[  1580.119]     Module class: X.Org XInput Driver
[  1580.119]     ABI class: X.Org XInput driver, version 22.1
[  1580.119] (II) Using input driver 'kbd' for 'kbdmux'
[  1580.119] (**) kbdmux: always reports core events
[  1580.119] (**) kbdmux: always reports core events
[  1580.119] (**) Option "Protocol" "standard"
[  1580.119] (**) Option "XkbRules" "base"
[  1580.119] (**) Option "XkbModel" "pc105"
[  1580.119] (**) Option "XkbLayout" "us"
[  1580.119] (**) Option "config_info" "devd:kbdmux"
[  1580.119] (II) XINPUT: Adding extended input device "kbdmux" (type: KEYBOARD, id 6)
[  1580.120] (II) config/devd: kbdmux is enabled, ignoring device ukbd0
[  1580.121] (II) config/devd: kbdmux is enabled, ignoring device atkbd0
[  1580.121] (II) config/devd: adding input device (null) (/dev/sysmouse)
[  1580.121] (II) LoadModule: "mouse"
[  1580.121] (II) Loading /usr/local/lib/xorg/modules/input/mouse_drv.so
[  1580.121] (II) Module mouse: vendor="X.Org Foundation"
[  1580.121]     compiled for 1.18.4, module version = 1.9.2
[  1580.121]     Module class: X.Org XInput Driver
[  1580.121]     ABI class: X.Org XInput driver, version 22.1
[  1580.121] (II) Using input driver 'mouse' for 'sysmouse'
[  1580.121] (**) sysmouse: always reports core events
[  1580.121] (**) Option "Device" "/dev/sysmouse"
[  1580.121] (==) sysmouse: Protocol: "Auto"
[  1580.121] (**) sysmouse: always reports core events
[  1580.121] (==) sysmouse: Emulate3Buttons, Emulate3Timeout: 50
[  1580.121] (**) sysmouse: ZAxisMapping: buttons 4 and 5
[  1580.121] (**) sysmouse: Buttons: 5
[  1580.121] (**) Option "config_info" "devd:sysmouse"
[  1580.121] (II) XINPUT: Adding extended input device "sysmouse" (type: MOUSE, id 7)
[  1580.121] (**) sysmouse: (accel) keeping acceleration scheme 1
[  1580.121] (**) sysmouse: (accel) acceleration profile 0
[  1580.121] (**) sysmouse: (accel) acceleration factor: 2.000
[  1580.121] (**) sysmouse: (accel) acceleration threshold: 4
[  1580.121] (II) sysmouse: SetupAuto: hw.iftype is 4, hw.model is 0
[  1580.121] (II) sysmouse: SetupAuto: protocol is SysMouse
[  1580.121] (II) config/devd: device /dev/ums0 already opened
[  1580.183] (II) config/devd: adding input device Mouse (/dev/psm0)
[  1580.183] (II) Using input driver 'mouse' for 'Mouse'
[  1580.183] (**) Mouse: always reports core events
[  1580.183] (**) Option "Device" "/dev/psm0"
[  1580.183] (==) Mouse: Protocol: "Auto"
[  1580.183] (**) Mouse: always reports core events
[  1580.243] (==) Mouse: Emulate3Buttons, Emulate3Timeout: 50
[  1580.243] (**) Mouse: ZAxisMapping: buttons 4 and 5
[  1580.243] (**) Mouse: Buttons: 5
[  1580.243] (**) Option "config_info" "devd:psm0"
[  1580.243] (II) XINPUT: Adding extended input device "Mouse" (type: MOUSE, id 8)
[  1580.243] (**) Mouse: (accel) keeping acceleration scheme 1
[  1580.243] (**) Mouse: (accel) acceleration profile 0
[  1580.243] (**) Mouse: (accel) acceleration factor: 2.000
[  1580.243] (**) Mouse: (accel) acceleration threshold: 4
[  1580.263] (II) Mouse: SetupAuto: hw.iftype is 3, hw.model is 0
[  1580.263] (II) Mouse: SetupAuto: protocol is PS/2
[  1580.711] (II) Mouse: ps2EnableDataReporting: succeeded
[  1584.684] (--) NVIDIA(GPU-0): DFP-0: connected
[  1584.684] (--) NVIDIA(GPU-0): DFP-0: Internal DisplayPort
[  1584.684] (--) NVIDIA(GPU-0): DFP-0: 1440.0 MHz maximum pixel clock
[  1584.684] (--) NVIDIA(GPU-0):
[  1584.684] (--) NVIDIA(GPU-0): DFP-1: disconnected
[  1584.684] (--) NVIDIA(GPU-0): DFP-1: Internal TMDS
[  1584.684] (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock
[  1584.684] (--) NVIDIA(GPU-0):
[  1592.611] (II) config/devd: terminating backend...
[  1592.611] (II) UnloadModule: "mouse"
[  1592.611] (II) UnloadModule: "mouse"
[  1592.611] (II) UnloadModule: "kbd"
[  1592.869] (II) NVIDIA(GPU-0): Deleting GPU-0
[  1592.871] (II) Server terminated successfully (0). Closing log file.
```


----------



## free-and-bsd (Oct 30, 2017)

1) CORRECT this in your /etc/rc.conf: *remove* the line hald_enable="YES".
2) Too much in your configuration file. Just try what the OP suggests. You can try my working configuration that I've been using ever since the new driver was uploaded, it works. You put just these 2 files into /usr/local/etc/X11/xorg.conf.d directory:
a) nvidia.conf:

```
Section "Device"
   Identifier  "Card0"
   Driver      "nvidia"
   BusID       "PCI:1:0:0"
EndSection
```
That's all! And you will notice, (1) it is the same as the OP suggests and (2) there is no "modesetting" stuff here.
b) monitor.conf:

```
Section "Monitor"
    Identifier   "DFP-0"
    Option   "Enable" "true"
EndSection

Section "Device"
    Identifier   "Card0"
    Driver   "nvidia"
    VendorName   "NVIDIA Corporation"
    Option   "MetaModes" "DFP-0:nvidia-auto-select"
EndSection
```
 This inspired by your own Xorg log, so just start with that... Don't think you need the glx module section at all, it's been my impression that nvidia-driver loads whatever other stuff it thinks necessary...

So to try it from the top, you put ONLY these two files in the xorg.conf.d directory (see above) and REMOVE all the xorg.conf files you have either in /etc/X11 or in /usr/local/etc/X11. Well if they're precious to you, you can just move them to some secure place, for further experiments maybe.

With the /etc/rc.conf hald_enable string _removed_ you can reboot, then from your console type $startx .

Imean, don't start with complicated setup, start with generic and simple. Whatever is needed for X to work need not be complicated, it does everything automatically these days... Well, if you're as lucky as your nick suggests .


----------



## Lucky (Oct 30, 2017)

free-and-bsd said:


> 1) CORRECT this in your /etc/rc.conf: *remove* the line hald_enable="YES".
> 
> [   231.184]
> X.Org X Server 1.18.4
> ...


----------



## free-and-bsd (Oct 30, 2017)

> [ 231.269] (EE) Device(s) detected, but none match those in the config file.


Why won't you just tell which laptop model (looks like METABOX, but which one?) you are using? In your previous log NVIDIA driver showed a lot, now it says the above...

I suspect you have a laptop with two graphical adapters. If so, their usage must be configurable via BIOS.


----------



## Lucky (Oct 30, 2017)

free-and-bsd said:


> Why won't you just tell which laptop model (looks like METABOX, but which one?) you are using? In your previous log NVIDIA driver showed a lot, now it says the above...
> 
> I suspect you have a laptop with two graphical adapters. If so, their usage must be configurable via BIOS.



I got this one... http://www.metabox.com.au/store/b218/Metabox-Alpha-N850HJ-laptop

btw... Thank you FaB. Seems that you help a lot of people in this area. You're a good man  It's truly appreciated (I'm sure by all)


----------



## free-and-bsd (Oct 30, 2017)

> [ 38.905] (II) NVIDIA(0): NVIDIA GPU GeForce GTX 1050 (GP107-A) at PCI:1:0:0 (GPU-0)


This is from your previous X log. And NOW it doesn't detect devices at PCI:1:0:0? Funny. Can it be the nvidia-modeset.ko module is _not_ loaded this time?


----------



## free-and-bsd (Oct 30, 2017)

Lucky said:


> I got this one... http://www.metabox.com.au/store/b218/Metabox-Alpha-N850HJ-laptop
> 
> btw... Thank you FaB. Seems that you help a lot of people in this area. You're a good man  It's truly appreciated (I'm sure by all)


So it has two graphics adapters. Could it be that when you unplug the monitor the Intel Graphics get used?


----------



## free-and-bsd (Oct 30, 2017)

OK, may try to remove the line containing "PCI:1:0:0" from nvidia.conf and see what happens.


----------



## free-and-bsd (Oct 30, 2017)

It seems, according to this thread your Intel adapter is not supported yet by i915 drm driver. I wonder how about your nvidia adapter...


----------



## ShelLuser (Nov 8, 2017)

Most of you probably already know this but I figured it still makes a good addition to this awesome guide.

If you're using a port to enhance your kernel then you might be interested in PORTS_MODULES.

If you add PORTS_MODULES to /etc/make.conf then this will instruct your system to grab and build the specified port(s) every time you recompile your kernel, thus ensuring that your system remains fully intact.

So to add to the example in the guide, if you're using the NVidia module then you might want to add:


```
PORTS_MODULE=x11/nvidia-driver
```
... to your /etc/make.conf.


----------



## Robert Kopp (Nov 9, 2017)

I made a fresh install of 11.1 (AMD) before I read this post. I have a GTX970 display adapter. I downloaded software from Nvidia's Website (384.98, instead of 384.90 that is currently in the ports tree) instead of using the port.  But such Linux-based applications as linux-unigine-heaven will not work. When I built that application, I built the required environment to support Linux, but it should have been done before the Nvidia driver was installed. And perhaps the Nvidia driver should have been installed from ports. What should I do now? Will installing the driver from ports fix the problem, or do I need to uninstall something first?


----------



## coyote_zed (Jul 26, 2018)

It seems that these instructions don't seem to work with 11.2. I started getting error messages (of which I neglected to write down) in regards to the nvidia driver. Are there any modifications that need to be made to the instructions?


----------



## scottro (Jul 27, 2018)

There are some issues with 11.2 and NVidia. Firstly, it has to be installed from ports for the moment, not packages.
Depending upon your card, you'll either want x11/nvidia-driver or, if it's an older card (you have to hunt around if it's a card that uses the legacy driver--NVidia has a list, but the model numbers sometimes differ, so you may have to look) use the nvidia-driver-340. If it's the 340, then in /boot/loader.conf you put nvidia_load="YES" if it's the newer driver then 
nvidia_modeset_load="YES"

If X won't start, at this point, you can try running the nvidia-xconfig program which usually gives you a working xorg.conf that will work with your card. If it still won't start, the only time that this has happened to me was because there was no BusID entry in the xorg.conf created nvidia-xconfig, so look for a BusID line and if not, you'll have to add it.
To get the BusID, you can use nvidia-smi -q |grep Bus and you might get something like


```
Bus Id                      : 00000000:01:00.0
```
So you would put in /etc/X11/xorg.conf 

```
BusID          "PCI:1:0:0"
```
 in the Device section. 

But sometimes, you don't even need an xorg.conf. I've never really noticed a pattern, and even if you do, you could cut out a lot of what nvidia-xconfig  puts in there and get by with a few lines, but I've never cared enough, I fear, to see how much I can leave out.


----------



## clawhammer (Jul 28, 2018)

scottro said:


> There are some issues with 11.2 and NVidia. Firstly, it has to be installed from ports for the moment, not packages.
> Depending upon your card, you'll either want x11/nvidia-driver or, if it's an older card (you have to hunt around if it's a card that uses the legacy driver--NVidia has a list, but the model numbers sometimes differ, so you may have to look) use the nvidia-driver-340. If it's the 340, then in /boot/loader.conf you put nvidia_load="YES" if it's the newer driver then
> nvidia_modeset_load="YES"
> 
> ...



I get command not found for nvidia-smi. I have the nvidia-driver installed and what ive read is that nvidia-smi should be included with that. Did you download nvidia-smi from some other source?


----------



## Chris_H (Jul 28, 2018)

That probably _should_ have read: `pciconf -lv`
Generally speaking. I've usually found it easier after loading the nvidia kernel module. To just exec `startx`.
Which produces a logfile as /usr/log/Xorg.0.log
opening that log file provides the `BusID` number that you can add as necessary. For example mine was: `0:2:0:0`. As I _don't_ need an /etx/X11/xorg.conf file. I simply created a
/usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf file that looke like this:

```
# /usr/local/etc/X11/xorg.conf.d/
Section "Device"
        Option  "DRI"   "True"
        Identifier      "Card0"
        Driver          "nvidia"
        BusID           "PCI:0:13:0"
        #BusID  "PCI:0:2:0:0"
EndSection
```

HTH!

--Chris


----------



## clawhammer (Jul 28, 2018)

Chris_H said:


> That probably _should_ have read: `pciconf -lv`
> Generally speaking. I've usually found it easier after loading the nvidia kernel module. To just exec `startx`.
> Which produces a logfile as /usr/log/Xorg.0.log
> opening that log file provides the `BusID` number that you can add as necessary. For example mine was: `0:2:0:0`. As I _don't_ need an /etx/X11/xorg.conf file. I simply created a
> ...



I'm sorry but ive been modifying rc.conf, nvidia config files for the past couple days. I have an gtx 1060 that I can get to boot in x server. the only way I can get x server to work with kde is with the intel integrated chipset. Ive tried all the way ive seen on the forums to  have the config files but it wont boot lol. Am I dumb or just missing something?


----------



## scottro (Jul 28, 2018)

clawhammer said:


> I get command not found for nvidia-smi. I have the nvidia-driver installed and what ive read is that nvidia-smi should be included with that. Did you download nvidia-smi from some other source?


No, perhaps it was included with nvida-xconfig?  I had it installed.
As Chris_H points out, pciconf -lv will also give you a busid, but the simplest (as also mentioned in their post) is probably  to just run startx and see if Xorg.0.log gives it.

In my case, I've only had to find it on one occasion, and nvidia-smi was my first google hit, and when I ran it, it was on my machine.


----------



## coyote_zed (Dec 7, 2018)

scottro said:


> There are some issues with 11.2 and NVidia. Firstly, it has to be installed from ports for the moment, not packages.
> Depending upon your card, you'll either want x11/nvidia-driver or, if it's an older card (you have to hunt around if it's a card that uses the legacy driver--NVidia has a list, but the model numbers sometimes differ, so you may have to look) use the nvidia-driver-340. If it's the 340, then in /boot/loader.conf you put nvidia_load="YES" if it's the newer driver then
> nvidia_modeset_load="YES"
> 
> ...



Is it possible to do this from packages at the moment?


----------



## Sevendogsbsd (Dec 7, 2018)

I seem to remember not long ago (before building my new box), that the nvidia driver pkg worked fine. I may have had to build custom configs under /usr/local/etc/X11/xorg.conf.d/ but maybe only one for resolution and DPMS. I would have been using the latest driver since I had a 1050Ti card. I did use
`nvidia-modeset_load="YES"` though.


----------



## scottro (Dec 7, 2018)

So Sevendogsbsd, at this point (early December, 2018) you are able to use packages for NVidia?  (I don't even have a test box to try it on right now.)
Thanks.


----------



## Sevendogsbsd (Dec 7, 2018)

Actually, I haven't tried this month, BUT, you are in luck! I am standing up my ports build server again tonight/tomorrow so will do an install of the nvidia driver as a test for you - I need to rebuild the box anyway (switch to zfs) and before I do, I'll install xorg and nvidia from pkgs and see if I can get a twm session. Shouldn't take long.


----------



## Sevendogsbsd (Dec 7, 2018)

I can happily report that the nvidia pkg works fine, at least X comes up and displays twm, anyway. The resolution is wrong on my monitor but that takes a config file to correct in my case, because I have a very large monitor. The nvidia kernel module is loaded with the statement in my earlier post, at least for the version 390.xx driver (latest). One caveat is that the pkg has Linux support as required so you will have to load that prior to installing the nvidia driver: `linux_enable="YES"` in /etc/rc.conf After that, you can either bounce the machine or run `kldload linux` and the linux module will be loaded without rebooting. After the Linux module is loaded, you can do the nvidia driver install via pkg.

Sorry - forgot, this is a fresh install of 11.2-RELEASE-p-5


----------



## meine (Dec 8, 2018)

There is also a very simple way to use your nvidia card, for those (including myself) that have trouble and/or impatience getting the nvidia driver to work properly:

`# pkg install -y xf86-video-nv`

Put the following in /usr/local/etc/X11/xorg.conf.d/driver-nv.conf

```
Section "Device"
    Identifier "Card0"
    Driver     "nv"
EndSection
```

There is no need for further adding of lines to any config file.

This xf86-video-nv is just a straightforward nvidia driver for basic use. Probably you won't get the performance you need when doing heavy graphical stuff, but for text processing, internet use etc it works fine.


----------



## free-and-bsd (Dec 13, 2018)

meine said:


> This xf86-video-nv is just a straightforward nvidia driver for basic use. Probably you won't get the performance you need when doing heavy graphical stuff, but for text processing, internet use etc it works fine.


Oh, it's the good old Xorg, formerly X11R6, NV driver, isn't it? Old friend 
I remember trying to use this one some *-teen years ago, the graphics _quality_ was rather low.

Moreover, I also _seem_ to remember some statements to the effect that its development had been dropped... but I may be mistaken. It was back at the time of switching from X11R6 over to Xorg as default.
But if it indeed _was_ dropped back at the time I seem to remember, then the modern framebuffer driver shall be far more useful here, right?
EDIT: it wasn't dropped, it was _deprecated_ in 2010 in favour of nouveau. There are some fresh commits there, but there doesn't seem to be _much_ of development there anyway.


----------



## Ogis (Dec 24, 2018)

Thanks for this instruction. I'll add that I additionally installed nvidia-settings and nvidia-xconfig. At this time, everything works normally.


----------



## christhegeek (Jun 29, 2019)

How else i could install nvidia 430 drivers ??? it isn't on ports if i remember correctly !!! Of course its good to install from web you will have the newest drivers !

Note that there is no need (and it's even counterproductive) to download the driver from that page.


----------



## shkhln (Jun 29, 2019)

christhegeek said:


> How else i could install nvidia 430 drivers ??? it isn't on ports if i remember correctly !!!



It's not that difficult to find the patch by searching "nvidia" on the bug tracker.



christhegeek said:


> Of course its good to install from web you will have the newest drivers !



You would have slightly broken drivers.


----------



## SirDice (Jul 1, 2019)

christhegeek said:


> How else i could install nvidia 430 drivers ??? it isn't on ports if i remember correctly !!!


x11/nvidia-dirver-304
x11/nvidia-driver-340
x11/nvidia-driver

Update is being worked on as far as I know. PR 232645


----------



## christhegeek (Jul 2, 2019)

*Not 340 !   430 is the version the latest drivers*



SirDice said:


> x11/nvidia-dirver-304
> x11/nvidia-driver-340
> x11/nvidia-driver
> 
> Update is being worked on as far as I know. PR 232645


----------



## SirDice (Jul 2, 2019)

Try reading the PR.


----------



## kpedersen (Aug 16, 2019)

Just ran though this today and it still works 

I don't suppose anyone knows why the NVIDIA package defaults to:

Linux enabled <-- Dragging in a bunch of fairly heavy deps
ACPI disabled <-- Causing suspend issues

It seems to me that this might want to be revised. Now that Flash is dead, Linux compat is becoming a little more "specialist" and since FreeBSD is becoming more successful at suspending it seems weird to not enable it in the default nvidia driver.


----------



## shkhln (Aug 16, 2019)

kpedersen said:


> Linux enabled <-- Dragging in a bunch of fairly heavy deps



danfe@ promised to extract Linux support in a separate port, which supposedly should help. Might take him a few more years to actually start working on it, though 



kpedersen said:


> ACPI disabled <-- Causing suspend issues



No idea. Anybody can remember why this is an option in the first place?


----------



## christhegeek (Aug 29, 2019)

support with nvidia graphics cards is great on freebsd unfortunately i don't see the same with amd , amd support is not good and performance is very bad from what i see on my rx580 8gb nitro+ 256bit graphics card its performance sucks utterly on freebsd while my low end nvidia graphics card can render the most demanding uhd video fine and the desktop seems to be fluent and smooth and fast as f...k !!!
I don't think you should even try using an amd graphics card on freebsd.


----------



## andros (Jul 7, 2020)

Just a hint
nvidia-driver-304 doesn't work with xorg-server 1.20 for a moment.


----------



## SirDice (Jul 7, 2020)

andros said:


> nvidia-driver-304 doesn't work with xorg-server 1.20 for a moment.


And is unlikely to get fixed. Ever. NVidia stopped supporting this version a long time ago.


----------



## free-and-bsd (Jul 27, 2020)

christhegeek said:


> support with nvidia graphics cards is great on freebsd unfortunately i don't see the same with amd , amd support is not good and performance is very bad from what i see on my rx580 8gb nitro+ 256bit graphics card its performance sucks utterly on freebsd while my low end nvidia graphics card can render the most demanding uhd video fine and the desktop seems to be fluent and smooth and fast as f...k !!!
> I don't think you should even try using an amd graphics card on freebsd.


Can't say I had that much luck with Radeon cards on Windows either. Buggy drivers all the time. So, even as a rule, when building a new machine for the office, I never ever buy AMD video cards. Oh, and when I go to the computer parts shop and say that, they seem to understand my meaning...


----------



## Sevendogsbsd (Jul 27, 2020)

I have had quite the opposite luck on FreeBSD, Linux and Windows: Nvidia hardware has given me nothing but issues on all platforms but Windows. I switched to AMD and everything works flawlessly, including on Windows.

Everyone has different hardware and different experiences. I will never buy Nvidia again.


----------



## shkhln (Jul 27, 2020)

Sevendogsbsd said:


> Everyone has different hardware and different experiences.



Nope. Unless you own defective hardware you should have _exactly_ the same experience as everyone.


----------



## Sevendogsbsd (Jul 27, 2020)

I can't tell if this is sarcasm....


----------



## free-and-bsd (Jul 27, 2020)

No, I was just about to say the same thing.


----------



## shkhln (Jul 27, 2020)

Nvidia's GPU drivers are highly unified between supported platforms and come from a single source (i.e. practically zero distribution-specific patches). Hardware is mass-produced, so no room for variation there. I doesn't make sense to approach this in "oh, well, everyone is different…" manner.


----------



## Sevendogsbsd (Jul 27, 2020)

In a perfect world, yes, but people use different motherboards, CPUs, software configurations, etc. Not trying to start an argument, just relaying my opinion.


----------



## kpedersen (Jul 27, 2020)

shkhln said:


> Nvidia's GPU drivers are highly unified between supported platforms and come from a single source (i.e. practically zero distribution-specific patches). Hardware is mass-produced, so no room for variation there. I doesn't make sense to approach this in "oh, well, everyone is different…" manner.



Almost any issue I have encountered with nvidia cards is due to the integration of the nvidia blob with the underlying platform (i.e Xorg or kernel version). So whilst nvidia's driver might be consistent, the platform environment that it needs to interact with is not. But this is exactly why open-source drivers in the kernel tree are usually preferable to blobs because they tend to work better as one.

Once Nvidia "modernizes" and starts supporting open-source drivers for their products, I am fairly sure it will be really solid (and help avoid filling up landfill sites with older hardware).


----------



## shkhln (Jul 27, 2020)

kpedersen said:


> But this is exactly why open-source drivers in the kernel tree are usually preferable to blobs because they tend to work better as one.



Found a Linux user.



kpedersen said:


> Once Nvidia "modernizes" and starts supporting open-source drivers for their products, I am fairly sure it will be really solid (and help avoid filling up landfill sites with older hardware).



Nvidia will never abandon their code to start contributing to Nouveau. And their own driver can't be merged into Linux even if it were open-sourced — Linux devs will not tolerate any kind of Windows/FreeBSD/Solaris compatibility layers.


----------



## kpedersen (Jul 27, 2020)

shkhln said:


> Found a Linux user.



Well yeah, Nvidia is kinda "Linux hardware" until we get an actual driver. For *BSD workstations it is just easier to pick a different manufacturer and avoid the issue altogether XD.
But I can honestly see Nvidia going out of business before a feasible driver ever appears in the FreeBSD kernel. However because there are alternatives, I suppose am fine with this. Just seems a bit wasteful of hardware.



shkhln said:


> And their own driver can't be merged into Linux even if it were open-sourced — Linux devs will not tolerate any kind of Windows/FreeBSD/Solaris compatibility layers.



Really? I thought the ndiswrapper stuff was fairly well received. They also make constant tweaks to the kernel in order to better support Wine.
I am fairly sure OpenZFS will also provide some layers like SPL. Isn't that aiming to be in the tree?


----------



## shkhln (Jul 27, 2020)

kpedersen said:


> Well yeah, Nvidia is kinda "Linux hardware". For *BSD workstations it is just easier to pick a different manufacturer and avoid the issue altogether XD



You'll have to use CURRENT if you want anything relatively new (<= 2 years) from AMD/Intel. This is especially fun for notebook buyers, I imagine.



kpedersen said:


> Really?



How many #ifdef __FreeBSD__ statements you can count in https://github.com/torvalds/linux/tree/master/drivers/gpu/drm/i915?



kpedersen said:


> I am fairly sure OpenZFS will also provide some layers similar to SPL.



OpenZFS wasn't exactly well received…


----------



## kpedersen (Jul 27, 2020)

shkhln said:


> You'll have to use CURRENT if you want anything relatively new (<= 2 years) from AMD/Intel. This is especially fun for notebook buyers, I imagine.



I don't believe any open-source operating system can run on a recent laptop in all fairness. The GPU is the least of your problems.



shkhln said:


> How many #ifdef __FreeBSD__ statements you can count in https://github.com/torvalds/linux/tree/master/drivers/gpu/drm/i915?



I believe you may have specified an invalid way of ascertaining the use of compatibility layers within the Linux kernel.
For example I don't imagine I would see any __linux__ #ifdefs in Windows drivers and yet they have many compatibility layers.



shkhln said:


> OpenZFS wasn't exactly well received…


And yet it is going in anyway isn't it? Same with DTrace. I think as long as it is a module (which their drivers are), it can go it regardless of CDDL. I am pretty sure nvidia will be no problem. I would hate for them to be making excuses


----------



## free-and-bsd (Jul 27, 2020)

kpedersen said:


> ...
> And yet it is going in anyway isn't it?


As regards OpenZFS in Linux, it seems to be rather going OUT. At least Linus said so with regard to the further kernel development.


----------



## shkhln (Jul 27, 2020)

kpedersen said:


> I believe you may have specified an invalid way of ascertaining the use of compatibility layers within the Linux kernel.



That's what FreeBSD is doing with Intel/AMD driver ports. Would be nice to upstream that, wouldn't it? Constantly rebasing/reapplying the same old patches isn't fun.



kpedersen said:


> For example I don't imagine I would see any __linux__ #ifdefs in Windows drivers and yet they have many compatibility layers.



Driver compatibility layers? I don't think so. Ndiswrapper is an independent effort. Wine doesn't handle drivers. Neither of those are maintained in the kernel tree.



kpedersen said:


> And yet it is going in anyway isn't it?



Yes, but it was open source to begin with. There is no point for Nvidia to open-source their driver, when most of their paying customers are fine with it as it is and the Linux fanboy crowd demands something that can't be satisfied with that move anyway.

EDIT: misread "going in" as "going on"


----------



## free-and-bsd (Jul 27, 2020)

free-and-bsd said:


> As regards OpenZFS in Linux, it seems to be rather going OUT. At least Linus said so with regard to the further kernel development.


Almost seems to me like vengeance for the failure of btrfs, support for which was also dropped about that same time. No other logic there -- at least, no sensible logic.


----------



## kpedersen (Jul 27, 2020)

shkhln said:


> There is no point for Nvidia to open-source their driver, when most of their paying customers are fine with it as it is and the Linux fanboy crowd demands something that can't be satisfied with that move anyway.



Well with business in mind you are possibly right for the immediate future. Though I am not entirely convinced that it cannot be integrated with Linux (in the way they desire) over time and then maintain it from there.
As for Nouveau, there are some patches from NVidia employees, is there a big reason why they can't embrace it fully?

For long term, looking back at things, much of the closed source "things" have either died or been obsoleted by their open alternatives. I am pretty sure the same will be true of NVidia if they don't open up. Already we are seeing some issues with their driver not being in tree. Not to mention I am sure they could benefit from the "free" labor maintaining it with Linux's constant changes. You can already start to see some preference towards AMD for their in-tree drivers on many of the tech forums. If this can reach critical mass, Nvidia might have no choice but do so just to keep up appearances.

Whilst I don't give much of a crap about Linux, this is fairly important because sadly FreeBSD is very dependent on the work done here.


----------



## shkhln (Jul 28, 2020)

kpedersen said:


> As for Nouveau, there are some patches from NVidia employees, is there a big reason why they can't embrace it fully?



Nothing is impossible there, but why bother in the first place? Nvidia is a corporation, not a charity. Getting Nouveau in shape would require hiring (quite?) a few competent developers and then spending several years on that. There must be at least some economic sense to it.

Also keep in mind, since the closed source Unit driver is largely a port of the Windows driver, it gets bug-for-bug compatibility for free. This must be worth something.



kpedersen said:


> For long term, looking back at things, much of the closed source "things" have either died or been obsoleted by their open alternatives.



My cynical take on it is that some corporations have figured out how to keep things locked in with open source technology.



kpedersen said:


> I am pretty sure the same will be true of NVidia if they don't open up.



It's a bit too early to predict Nvidia's demise. You need to look at the situation holistically. What's the value proposition of open source drivers? How does this help Intel/AMD sell GPUs?

It's not lock-in avoidance. It can't be — the drivers are still chained to proprietary hardware with limited useful life. More so, GPUs are programmed by targeting higher-level APIs (OpenGL, OpenCL, D3D11, CUDA, etc.), so openness is not even a consideration there.

So, what would that be? Better experience with debugging/profiling? Is it actually better?



kpedersen said:


> Already we are seeing some issues with their driver not being in tree.



There aren't really any serious issues, which aren't self-inflicted by the Linux side. You know, "stable API nonsense".

As for the driver deprecation, planned obsolescence is not a bug  Although I agree this is annoying. (No, open source doesn't mean support forever either. What it actually means: a driver fork/rewrite once in every 5-10 years. See Intel's i965 -> Iris transition for an example.)



kpedersen said:


> Not to mention I am sure they could benefit from the "free" labor maintaining it with Linux's constant changes.



Definitely not. At best it's a good strategy for hiring motivated developers for maintenance.



kpedersen said:


> You can already start to see some preference towards AMD for their in-tree drivers on many of the tech forums. If this can reach critical mass, Nvidia might have no choice but do so just to keep up appearances.



Let me guess, Phoronix? That forum almost 100% consists of trolls trying to out-troll other trolls. It's outrageously dumb.



kpedersen said:


> If this can reach critical mass, Nvidia might have no choice but do so just to keep up appearances.



I believe it when I see it: https://store.steampowered.com/hwsurvey/Steam-Hardware-Software-Survey-Welcome-to-Steam. Computing is totally dominated by Nvidia as well. They didn't even employ any dirty tricks to arrive here. They offered a comprehensive solution (CUDA) earlier than competitors and they kept it ahead of the curve by adding relevant features. Well, some marketing too. That's about it.



kpedersen said:


> Whilst I don't give much of a crap about Linux, this is fairly important because sadly FreeBSD is very dependent on the work done here.



Stuffing even more things into the Linux kernel doesn't really help us that much. Somebody still has to spend a lot of time porting these drivers. This is not at all comparable to direct vendor support.


----------



## kpedersen (Jul 28, 2020)

shkhln said:


> What's the value proposition of open source drivers? How does this help Intel/AMD sell GPUs?



I strongly suspect the reason why Intel GPUs are so popular is because of their open-driver. No fuss or fiddling. It just works. (Even the AMD driver isn't there quite yet). In the server world this is pretty nice! So much so that Intel are planning to sell discrete / standalone cards which I think has the potential to be a game-changer in the open-source world.



shkhln said:


> Let me guess, Phoronix? That forum almost 100% consists of trolls trying to out-troll other trolls. It's outrageously dumb.



Heh, not them. Many of them are just there for (proprietary/Steam) games which unfortunately the proprietary blobs have an edge (game developers only ever test against them for example). In my experience, commercial game developers are a daft bunch and try to aim for brand names as much as possible. Stockholm syndrome perhaps? At least it is no longer Direct3D (That damage took decades to undo).



shkhln said:


> There aren't really any serious issues, which aren't self-inflicted by the Linux side. You know, "stable API nonsense".



This is why on FreeBSD it would be so great to get an open-source driver. It will pretty much stay stable and trustworthy forever. For Linux, it is such a clusterfsck that whether it is proprietary or not, it doesn't matter, it will probably be broken next week anyway. And if it isn't... everything else will be XD



shkhln said:


> Stuffing even more things into the Linux kernel doesn't really help us that much. Somebody still has to spend a lot of time porting these drivers. This is not at all comparable to direct vendor support.



True, but it does provide a base for our guys to start the project rather than starting from scratch. (I.e our existing intelkms/amdkms drivers). It will still be a sodding difficult project but I do imagine one day we will see a port of Nouveau on FreeBSD from Linux.
Think of Linux as a bargain bin or a jumble sale. People can rummage around in there and fix up whatever is important to them.



shkhln said:


> Nothing is impossible there, but why bother in the first place? Nvidia is a corporation, not a charity.



I certainly don't expect them to be giving out their hardware for free. People pay for the hardware. Not the driver (they give that away for free). Ensuring integration of their hardware with the platforms people run is within a companies interest.


----------



## shkhln (Jul 28, 2020)

kpedersen said:


> I strongly suspect the reason why Intel GPUs are so popular is because of their open-driver.



Intel's GPUs are bundled with almost all of their consumer processors.



kpedersen said:


> No fuss or fiddling. It just works.



As long as you don't need 3d graphics, that is.



kpedersen said:


> In the server world this is pretty nice! So much so that Intel are planning to sell discrete / standalone cards which I think has the potential to be a game-changer in the open-source world.



What do you mean "so much"? Intel doesn't sell any server GPUs at the moment. (No, Xeon Phi doesn't count, because it doesn't use the same OpenGL/OpenCL/Vulkan drivers as consumer GPUs.)


----------



## kpedersen (Jul 28, 2020)

shkhln said:


> Intel's GPUs are bundled with almost all of their consumer processors.


Yep and people are much less likely to install a dedicated card anymore because things just work with the onboard intel. Especially for Linux where graphics aren't typically the focus (until recently with crap like Gnome 3).

Contrast this with ~10 years ago with the GMA9xx era. Many people would still opt for a dedicated amd/nvidia gpu because the Intel driver was still seen as inferior (remember the fun that was 915resolution?).

We aren't at the whims anymore of things like fglrx (thankfully!) and blobs and Nvidia might hopefully realise this and try to gain some loyalty by working on an open driver (with no real loss, it isn't like AMD could steal parts). But perhaps I am dreaming 



shkhln said:


> What do you mean "so much"? Intel doesn't sell any server GPUs at the moment.


Sloppy language on my part. Decent Intel support on servers (onboard) is nice (Think replacement of Matrox G-series. Nothing fantastic for 3D but it still works better than nvidia GPU + vesa driver.) But Intel in general has been successful with their GPU, that is why they are also going to be moving into the dedicated GPU space.


----------



## mkru (Dec 2, 2020)

I have tried the method described in this post with my GeForce GTX 1060 card. When I `startx` xorg returns `(EE) no screens found(EE)`, xrandr returns`Can't open display.` Does anyone know what might be wrong? I have one display embedded in the laptop and one external connected via HDMI.


----------



## free-and-bsd (Dec 2, 2020)

mkru said:


> I have tried the method described in this post with my GeForce GTX 1060 card. When I `startx` xorg returns `(EE) no screens found(EE)`, xrandr returns`Can't open display.` Does anyone know what might be wrong? I have one display embedded in the laptop and one external connected via HDMI.


What does kldstat command show?


----------



## scottro (Dec 2, 2020)

I've found that in some, not all, cases, installing the nvidia-xconfig package will fix that problem.  Install the package, then run with root privilege nvidia-xconfig and it backs up an existing xorg.conf if one exists and creates one. Usually, in my case, it's been a matter of xorg.conf needing (again, this is on some machines, not all) BusID information.


----------



## free-and-bsd (Dec 2, 2020)

scottro said:


> I've found that in some, not all, cases, installing the nvidia-xconfig package will fix that problem.  Install the package, then run with root privilege nvidia-xconfig and it backs up an existing xorg.conf if one exists and creates one. Usually, in my case, it's been a matter of xorg.conf needing (again, this is on some machines, not all) BusID information.


Yes, it's easier than hacking /var/log/Xorg.0.log for the IDs, monitor resolutions etc.


----------



## mkru (Dec 2, 2020)

kldstat shows that `linux.ko, nvidia.ko nvidia-modeset.ko` are loaded. I have installed nvidia-xconfig and run it with root privilege, but still the same result, no screens found. I have also tried rebooting after running nvidia-xconfig, but the result is the same, no screens found.


----------



## LordInateur (Dec 2, 2020)

Might be unrelated, and I'm not sure if you're already doing this (and perhaps someone already said something to this effect), but I definitely ran into similar issues with `nvidia-modeset` being loaded through /boot/loader.conf... I had to take it out and explicitly set it in /etc/rc.conf instead.

In /etc/rc.conf:


```
kld_list="nvidia-modeset"
```

(Note that if you've got `kld_list` already set you can append `nvidia-modeset`, delimited by a space).

Could be unrelated, but at least I'll have this here when I inevitably run into this issue again in the future.


----------



## mkru (Dec 2, 2020)

Ok, my `/boot/loader.conf` is now clean. Still the same info `no screens found` ... I have tried regenerating config with nvidia-xconfig, did not help.
Here is some config and modules info:


----------



## SirDice (Dec 3, 2020)

Remove any of those generated xorg.conf files. You don't need them. Please stop generating these files with any kind of tool (`Xorg -configure`, `nvidia-xconfig`).

Create a /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf:

```
Section "Device"
        Identifier "Card0"
        Driver     "nvidia"
EndSection
```

Then run `startx`. Look in /var/log/Xorg.0.log if you get errors.


----------



## mkru (Dec 3, 2020)

I finally managed to get it to work. I had to add `BusID` to the `driver-nvidia.conf`.
So in my case `driver-nvidia.conf` file looks like this:

```
Section "Device"
    Identifier "Card0"
    Driver "nvidia"
    BusID "PCI:1:0:0"
EndSection
```
Why did I have to add `BusID`? I have no idea.
How did I get the idea to add `BusID`? I have checked how the configuration file looks like on Linux.

One more remark. Do not add `linux` to the `kld_list`, it is obsolete. Instead just set `linux_enable="YES"`.


----------



## SirDice (Dec 3, 2020)

mkru said:


> Why did I have to add `BusID`? I have no idea.


Should only be necessary if you have more than one graphics card.



mkru said:


> One more remark. Do not add `linux` to the `kld_list`, it is obsolete. Instead just set `linux_enable="YES"`.


You don't need it at all for the driver to work. The port/package depends on it so you can use the NVidia driver with the Linux compatibility layer, not because the driver needs it.


----------



## mkru (Dec 3, 2020)

There is

```
product: UHD Graphics 630 (Mobile)
       vendor: Intel Corporation
```
does it count?

If it counts, I think it should be noted somewhere in the installation guides, that the BusID is necessary in such case. I have spent 2 days to figure this out.


----------



## scottro (Dec 3, 2020)

I only have one graphics card in my work worstation. It has multple ports, a VGA, HDMI and DVI. In my particular case, I think something's slightly wrong with the machine, as on another machine, with the same card, I didn't have to do that. Anyway, as I've said, I've often found that nvidia-xconfig gets a card working for me, IF it doesn't work with more minimal configuration.  In most cases, it seems to be the BUSID added by nvidia-xconfig that helps.  

IMPORTANT NOTE: Most of my FreeBSD experience is on servers, so this isn't based on tons of experience, probably 6 or 7 machines in the last 5 years.


----------



## debguy (Jan 24, 2021)

I have both i5 w/intel video usesless and nvidia 1050 useless (still today not released i think).  WIIl they ever, they are working on googleTV instead.

Here's what I do it works "great unless your a #3dgamr"

I use may previous 'nix box (any having a supported AGP card or PCI card running 'nix)

I run xdm (the X11 daemon) on the "fast but unsupported pc".  On the old PC I run the comand:

# X -query new_host

I get a pretty responsive desktop including smooth scrolling web browser.  It's well known not to work with 3D on (older releases of X11, so even that depends).  It's a great thing to have working "when things just aren't working".


----------



## debguy (Jan 24, 2021)

now if (ubuntu/google) wares android/TV allowed remote X11 query to a fast host with non-supported graphics card, that would be special!  they are busy locking out competitors stream icons i think.  Really?  things are way too deep in 2021 to spend weeks getting nvidia employees driver errata job done.  you need an xbox or playstation or 2nd pc for gaming ... unless your actually "working with / for them" to make freeBSD a steam stream tv platform right?  then you'd be wasting your time well!


----------



## shkhln (Jan 25, 2021)

Ah, our favorite insane rumblings guy. Hello there.


----------



## free-and-bsd (Feb 5, 2021)

Well, with all said and discussed above, I MUST state this with regard to NVIDIA driver. It works fine for me, yes. 
BUT: X never startx without me having driver definition in /usr/local/etc/X11/xorg.conf.d/driver.conf. Nor does i915kms work without it either. WITHOUT that driver definition you get weird error to the effect that "X server must be set root".
So I actually don't know about Xorg "being able to determine" things on its own, except for keyboard & mouse.


----------



## scottro (Feb 5, 2021)

Summaries are good, but as a thread gets longer, harder and harder to fine. That's why I sometimes put up little pages, almost as much for myself as for others.
NVidia. Usually works for me, but sometimes I have make use of the nvidia-xconfig program, other times, just installing the driver is sufficient. With my workstation, that has a multi-monitor setup, I needed nvidia-settings, though someone more skilled than me can probably get it going by hand.

Dedicated Intel cards on laptops, even on one that's pretty old, like a barebones Clevo, probably from 2012 or so, I needed the drm-kmod module. As has been mentioned many times, right now, on 12.2 or 13-Alpha or whatever 13 is at, and CURRENT which I guess is 14?, you need to build it from portsl
I've only run into an AMD dedicated card on my new laptop, (which is already considered old I think, but that's OK, so am I), a T495 Ryzen 7, and on that, I needed 13-CURRENT to get it to work, and had to build from ports. Now that 13 is alpha, still works.  (As dates are hard to readon these forums for my aging eyes, I'll mention that this is of early February, 2021).
All that being said, and remembering that one has to install src to build drm-kmod, it only takes a few minutes. Most Linux distributions use Nouveau, an open source NVidia driver by default, but the majority of distributions have something like rpmfusion (for RH based distributions) that will easily install Nvidia and blacklist the nouveau drivers. (My own experience with nouveau has been poor).


----------



## free-and-bsd (Feb 5, 2021)

scottro said:


> Summaries are good, but as a thread gets longer, harder and harder to fine. That's why I sometimes put up little pages, almost as much for myself as for others.
> NVidia. Usually works for me, but sometimes I have make use of the nvidia-xconfig program, other times, just installing the driver is sufficient. With my workstation, that has a multi-monitor setup, I needed nvidia-settings, though someone more skilled than me can probably get it going by hand.
> 
> Dedicated Intel cards on laptops, even on one that's pretty old, like a barebones Clevo, probably from 2012 or so, I needed the drm-kmod module. As has been mentioned many times, right now, on 12.2 or 13-Alpha or whatever 13 is at, and CURRENT which I guess is 14?, you need to build it from portsl
> ...


I, on the other hand, never (recentlly) needed nvidia-xconfig. However, without defining nvidia in driver.conf Xorg won't find anything. So I would say, it's a bit of exaggeration to say that 'normally you don't need anything in xorg.conf.d directory'. Simple as it is, I still do need something there.


----------

