# No devices detected/no screens found(EE)



## amnixed (Mar 1, 2021)

Hello,

I'm trying to make X work on FreeBSD 12.2-STABLE r369362 with a GeForce GT 1030.

`# cat /boot/loader.conf
[...]
kern.vty="vt"
nvidia_load="YES"

# portversion -v | grep nvidia
[Reading data from pkg(8) ... - 320 packages found - done]
nvidia-driver-460.56        =  up-to-date with port 
nvidia-xconfig-460.56       =  up-to-date with port

# make showconfig             
===> The following configuration options are available for xorg-drivers-7.7_6:
[...]
     EVDEV=on: Install evdev input driver
     KEYBOARD=on: Install keyboard input driver
     LIBINPUT=on: Install libinput input driver
     MOUSE=on: Install mouse input driver
     SCFB=on: Install scfb video driver
     VESA=on: Install vesa video driver

# cat /etc/X11/xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 460.56


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
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 "InputDevice"

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

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

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

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection`

Here is what seems to be relevant from the log file:

`# cat /var/log/Xorg.0.log
[  1540.691] 
X.Org X Server 1.20.9
X Protocol Version 11, Revision 0
[  1540.691] Build Operating System: FreeBSD 12.2-STABLE amd64 
[...]
[  1540.695] (II) Loader magic: 0x434a80
[  1540.695] (II) Module ABI versions:
[  1540.695]     X.Org ANSI C Emulation: 0.4
[  1540.695]     X.Org Video Driver: 24.1
[  1540.696]     X.Org XInput driver : 24.1
[  1540.696]     X.Org Server Extension : 10.0
[  1540.696] (!!) More than one possible primary device found
[  1540.696] (--) PCI: (1@0:0:0) 10de:1d01:1458:375d rev 161, Mem @ 0xfc000000/16777216, 0xd0000000/268435456, 0xce000000/33554432, I/O @ 0x0000c800/128, BIOS @ 0x????????/65536
[  1540.696] (--) PCI: (4@0:4:0) 102b:0532:15d9:a711 rev 10, Mem @ 0xfa000000/16777216, 0xfdffc000/16384, 0xfe000000/8388608, BIOS @ 0x????????/65536
[  1540.697] (II) LoadModule: "glx"
[  1540.697] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[  1540.701] (II) Module glx: vendor="X.Org Foundation"
[  1540.701]     compiled for 1.20.9, module version = 1.0.0
[  1540.701]     ABI class: X.Org Server Extension, version 10.0
[  1540.701] (II) LoadModule: "nvidia"
[  1540.701] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[  1540.702] (II) Module nvidia: vendor="NVIDIA Corporation"
[  1540.702]     compiled for 1.6.99.901, module version = 1.0.0
[  1540.702]     Module class: X.Org Video Driver
[  1540.702] (II) NVIDIA dlloader X Driver  460.56  Tue Feb 23 23:25:01 UTC 2021
[  1540.702] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[  1540.703] (--) Using syscons driver with X support (version 2.0)
[  1540.703] (--) using VT number 9

[  1540.705] (EE) No devices detected.
[  1540.705] (EE) 
Fatal server error:
[  1540.705] (EE) no screens found(EE)`

Would you please advise?


----------



## shkhln (Mar 1, 2021)

amnixed said:


> Would you please advise?


Disable onboard video in BIOS, make sure that your display is connected to GT 1030, load _nvidia-modeset_.


----------



## amnixed (Mar 1, 2021)

Thank you for the quick reply!

Onboard video is disabled, display is connected to GT 1030, nvidia-modeset loaded:

`# dmesg | grep -i nvidia
nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  460.56  Tue Feb 23 23:19:04 UTC 2021
nvidia0: <GeForce GT 1030> on vgapci0
vgapci0: child nvidia0 requested pci_enable_io
vgapci0: child nvidia0 requested pci_enable_io
hdac0: <NVIDIA (0x0fb8) HDA Controller> mem 0xfdefc000-0xfdefffff irq 19 at device 0.1 on pci1
hdacc0: <NVIDIA (0x0081) HDA CODEC> at cad 0 on hdac0
hdaa0: <NVIDIA (0x0081) Audio Function Group> at nid 1 on hdacc0
pcm0: <NVIDIA (0x0081) (HDMI/DP 8ch)> at nid 4 on hdaa0
pcm1: <NVIDIA (0x0081) (HDMI/DP 8ch)> at nid 5 on hdaa0`

Still, the log shows the same error:

`# cat /var/log/Xorg.0.log
[   253.351] 
X.Org X Server 1.20.9
X Protocol Version 11, Revision 0
[...]
[   253.361] (II) LoadModule: "nvidia"
[   253.361] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[   253.362] (II) Module nvidia: vendor="NVIDIA Corporation"
[   253.362]     compiled for 1.6.99.901, module version = 1.0.0
[   253.362]     Module class: X.Org Video Driver
[   253.362] (II) NVIDIA dlloader X Driver  460.56  Tue Feb 23 23:25:01 UTC 2021
[   253.362] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[   253.362] (--) Using syscons driver with X support (version 2.0)
[   253.362] (--) using VT number 9

[   253.375] (EE) No devices detected.
[   253.375] (EE) 
Fatal server error:
[   253.376] (EE) no screens found(EE) 
[   253.376] (EE) 
Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 
[   253.376] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[   253.376] (EE) 
[   253.392] (EE) Server terminated with error (1). Closing log file.`


----------



## shkhln (Mar 1, 2021)

What `nvidia-smi` prints?


----------



## Snurg (Mar 1, 2021)

Maybe you need a BusID directive in the Device section?
There are some cases the driver seems not to find the correct one on its own.

Example:`BusID “PCI:41:0:0”`
`pciconf -lv |grep vgapci -A5` tells you which one to use.


----------



## amnixed (Mar 2, 2021)

shkhln said:


> What `nvidia-smi` prints?


`# nvidia-smi
Mon Mar  1 19:29:27 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.56       Driver Version: 460.56       CUDA Version: N/A      |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GT 1030     Off  | 00000000:01:00.0 Off |                  N/A |
|  0%   25C    P0    N/A /  30W |      0MiB /  2000MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+`


----------



## amnixed (Mar 2, 2021)

Snurg said:


> Maybe you need a BusID directive in the Device section?
> There are some cases the driver seems not to find the correct one on its own.
> 
> Example:`BusID “PCI:41:0:0”`
> `pciconf -lv |grep vgapci -A5` tells you which one to use.


`# pciconf -lv |grep vgapci -A5
vgapci0@pci0:1:0:0:    class=0x030000 card=0x375d1458 chip=0x1d0110de rev=0xa1 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'GP108 [GeForce GT 1030]'
    class      = display
    subclass   = VGA
hdac0@pci0:1:0:1:    class=0x040300 card=0x375d1458 chip=0x0fb810de rev=0xa1 hdr=0x00
--
vgapci1@pci0:4:4:0:    class=0x030000 card=0xa71115d9 chip=0x0532102b rev=0x0a hdr=0x00
    vendor     = 'Matrox Electronics Systems Ltd.'
    device     = 'MGA G200eW WPCM450'
    class      = display
    subclass   = VGA`

FWIW, X did work fine in this same hardware setup under 12.1-STABLE. Yesterday I updated from source, after which neither the new nor the old kernel booted. I installed an additional hard drive and installed on the new hard drive 12.2-STABLE and imported the old zpool - but haven't been able to start X.


----------



## shkhln (Mar 2, 2021)

amnixed said:


> FWIW, X did work fine in this same hardware setup under 12.1-STABLE. Yesterday I updated from source, after which neither the new nor the old kernel booted. I installed an additional hard drive and installed on the new hard drive 12.2-STABLE and imported the old zpool - but haven't been able to start X.


Try rebuilding the kernel driver for a change. Also, there is no 12.2-STABLE, it's just 12-STABLE.


----------



## amnixed (Mar 2, 2021)

shkhln said:


> Try rebuilding the kernel driver for a change. Also, there is no 12.2-STABLE, it's just 12-STABLE.


Do you mean rebuild kernel (and world)? That's what I did, and the new kernel did not boot (nor did the old).

This computer thinks it's 12.2-STABLE:

`# uname -v
FreeBSD 12.2-STABLE r369362 GENERIC`


----------



## Snurg (Mar 2, 2021)

Does the new kernel just hang, or does it panic somewhere, giving a hint what might have gone wrong?
If this problem persists, maybe open a specific thread to find out what is wrong?

Your nvidia card is PCI ID 0, and not some other, so I think it is not a missing BusID entry, but some other problem.


----------



## shkhln (Mar 2, 2021)

amnixed said:


> Do you mean rebuild kernel (and world)? That's what I did, and the new kernel did not boot (nor did the old).


No, the x11/nvidia-driver port.



amnixed said:


> This computer thinks it's 12.2-STABLE:
> 
> `# uname -v
> FreeBSD 12.2-STABLE r369362 GENERIC`


Computer is in the wrong there. (You are running a build from the stable/12 branch with changes that eventually will go into the 12.3 release.)


----------



## amnixed (Mar 2, 2021)

shkhln said:


> No, the x11/nvidia-driver port.
> 
> 
> Computer is in the wrong there. (You are running a build from the stable/12 branch with changes that eventually will go into the 12.3 release.)


Thanks for replying...

I have rebuilt x11/nvidia-driver but `startx` produces the same error.


----------



## Snurg (Mar 2, 2021)

Could you please extract the last startup sequence in the /var/log/Xorg.0.log and post it?
There must be something wrong after the nvidia driver starts, but that is hard to see if only part of that log is shown.


----------



## amnixed (Mar 2, 2021)

Snurg said:


> Could you please extract the last startup sequence in the /var/log/Xorg.0.log and post it?
> There must be something wrong after the nvidia driver starts, but that is hard to see if only part of that log is shown.


Here it is:

`# cat /var/log/Xorg.0.log
[ 10011.952] 
X.Org X Server 1.20.9
X Protocol Version 11, Revision 0
[ 10011.952] Build Operating System: FreeBSD 12.2-STABLE amd64 
[ 10011.952] Current Operating System: FreeBSD buffrescue.[...] 12.2-STABLE FreeBSD 12.2-STABLE r369362 GENERIC amd64
[ 10011.953] Build Date: 01 March 2021  02:20:56AM
[ 10011.953]  
[ 10011.953] Current version of pixman: 0.40.0
[ 10011.953]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[ 10011.953] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 10011.953] (==) Log file: "/var/log/Xorg.0.log", Time: Mon Mar  1 22:14:00 2021
[ 10011.954] (==) Using config file: "/etc/X11/xorg.conf"
[ 10011.954] (==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
[ 10011.954] (==) ServerLayout "Layout0"
[ 10011.954] (**) |-->Screen "Screen0" (0)
[ 10011.954] (**) |   |-->Monitor "Monitor0"
[ 10011.955] (**) |   |-->Device "Device0"
[ 10011.955] (**) |-->Input Device "Keyboard0"
[ 10011.955] (**) |-->Input Device "Mouse0"
[ 10011.955] (==) Automatically adding devices
[ 10011.955] (==) Automatically enabling devices
[ 10011.955] (==) Not automatically adding GPU devices
[ 10011.955] (==) Max clients allowed: 256, resource mask: 0x1fffff
[ 10011.955] (==) 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/,
    catalogue:/usr/local/etc/X11/fontpath.d
[ 10011.955] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[ 10011.955] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[ 10011.955] (WW) Disabling Keyboard0
[ 10011.955] (WW) Disabling Mouse0
[ 10011.955] (II) Loader magic: 0x434a80
[ 10011.955] (II) Module ABI versions:
[ 10011.955]     X.Org ANSI C Emulation: 0.4
[ 10011.955]     X.Org Video Driver: 24.1
[ 10011.956]     X.Org XInput driver : 24.1
[ 10011.956]     X.Org Server Extension : 10.0
[ 10011.956] (!!) More than one possible primary device found
[ 10011.956] (--) PCI: (1@0:0:0) 10de:1d01:1458:375d rev 161, Mem @ 0xfc000000/16777216, 0xd0000000/268435456, 0xce000000/33554432, I/O @ 0x0000c800/128, BIOS @ 0x????????/65536
[ 10011.956] (--) PCI: (4@0:4:0) 102b:0532:15d9:a711 rev 10, Mem @ 0xfa000000/16777216, 0xfdffc000/16384, 0xfe000000/8388608, BIOS @ 0x????????/65536
[ 10011.956] (II) LoadModule: "glx"
[ 10011.957] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[ 10011.960] (II) Module glx: vendor="X.Org Foundation"
[ 10011.960]     compiled for 1.20.9, module version = 1.0.0
[ 10011.960]     ABI class: X.Org Server Extension, version 10.0
[ 10011.960] (II) LoadModule: "nvidia"
[ 10011.960] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[ 10011.961] (II) Module nvidia: vendor="NVIDIA Corporation"
[ 10011.961]     compiled for 1.6.99.901, module version = 1.0.0
[ 10011.961]     Module class: X.Org Video Driver
[ 10011.962] (II) NVIDIA dlloader X Driver  460.56  Tue Feb 23 23:25:01 UTC 2021
[ 10011.962] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[ 10011.962] (--) Using syscons driver with X support (version 2.0)
[ 10011.962] (--) using VT number 9

[ 10011.967] (EE) No devices detected.
[ 10011.967] (EE) 
Fatal server error:
[ 10011.967] (EE) no screens found(EE) 
[ 10011.967] (EE) 
Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 
[ 10011.967] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[ 10011.967] (EE)`

Thank you for your patience!


----------



## Snurg (Mar 2, 2021)

The message "More than one possible primary device found" wonders me, but I think it is a result of the BIOS somehow not fully disabling the onboard Matrox VGA.
However I have no idea why the Nvidia driver does not load.

Before the Nvidia driver becomes active (-> messages with uppercase "NVIDIA", there should be loaded a few other modules (here from my xorg log)

```
[    45.761] (II) Loading sub module "fb"
[    45.761] (II) LoadModule: "fb"
[ 45.761] (II) Loading /usr/local/lib/xorg/modules/libfb.so
[ 45.768] (II) Module fb: vendor="X.Org Foundation"
[ 45.768] compiled for 1.20.9, module version = 1.0.0
[ 45.768] ABI class: X.Org ANSI C Emulation, version 0.4
[ 45.768] (II) Loading sub module "wfb"
[ 45.768] (II) LoadModule: "wfb"
[ 45.769] (II) Loading /usr/local/lib/xorg/modules/libwfb.so
[ 45.771] (II) Module wfb: vendor="X.Org Foundation"
[ 45.771] compiled for 1.20.9, module version = 1.0.0
[ 45.771] ABI class: X.Org ANSI C Emulation, version 0.4
[ 45.771] (II) Loading sub module "ramdac"
[ 45.771] (II) LoadModule: "ramdac"
[ 45.771] (II) Module "ramdac" already built-in
[ 45.777] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[ 45.777] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
```

I am wondering, are the libraries /usr/local/lib/xorg/modules/libfb.so and /usr/local/lib/xorg/modules/libwfb.so present on your computer? Don't know if it matters...

Above you see a warning about a missing kernel arbiter, which confuses me a bit, because on my computer is no secondary graphics card.
I have no experience with dual-graphics-card-setups. I have read people say that one needs to provide/install a driver (possibly x11-drivers/xf86-video-mga, but not sure - the driver might be outdated) even when not using the secondary graphics card. No idea whether it matters.

If this doesn't help, maybe it is best to wait a bit, the gurus are asleep now...


----------



## amnixed (Mar 2, 2021)

Snurg said:


> The message "More than one possible primary device found" wonders me, but I think it is a result of the BIOS somehow not fully disabling the onboard Matrox VGA.
> However I have no idea why the Nvidia driver does not load.
> [...]
> 
> I am wondering, are the libraries /usr/local/lib/xorg/modules/libfb.so and /usr/local/lib/xorg/modules/libwfb.so present on your computer? Don't know if it matters...


Yes, they both are:

`# ls -l /usr/local/lib/xorg/modules/libfb.so
-rwxr-xr-x  1 root  wheel  112792 Mar  1 02:24 /usr/local/lib/xorg/modules/libfb.so

# ls -l /usr/local/lib/xorg/modules/libwfb.so
-rwxr-xr-x  1 root  wheel  123464 Mar  1 02:24 /usr/local/lib/xorg/modules/libwfb.so`


----------



## Snurg (Mar 2, 2021)

well if it does not work with a `BusID “PCI:1:0:0”` directive in the nvidia cards' "Device" section of the xorg.conf, which practically only says "do not search for cards, just use that card you find at these PCI coordinates", then I'd be really curious what the gurus will say tomorrow,,,


----------



## Mjölnir (Mar 2, 2021)

shkhin meant the kernel module. The graphics driver.  Merged this he wrote _"kernel driver"_. This is common "nerd slang".
Since 12-STABLE is source-only IIRC, this looks strange to me; because 12-STABLE implies you built kernel & world from source, incl. graphics drivers; correct?
You must not install any kernel modules from packages (*-kmod) on any *-STABLE revision.  You didn't, correct?
The point is: you built the graphics driver from ports(7) on that very same system, good.  The _stable_ branch should be -- well, very stable; that will be the next 12.3 revision, it receives updates every few days.  Doesn't mean it is bug-free.
BIOS: legacy or UEFI?  Please try harder to make sure there is only one graphics port.  Disable the others.  Once we succeed to have something working, you can try to enable the 2nd graphics port and maybe find a configuration where you can switch between both or maybe even run both concurrently.  But let's start with the most basic config possible.
xorg.conf: ideally we should start without and the X11 server should start; it's _automagic_ is very very good, often better than the average human.


----------



## amnixed (Mar 2, 2021)

Mjölnir said:


> shkhin meant the kernel module. The graphics driver.  Merged this he wrote _"kernel driver"_. This is common "nerd slang".
> Since 12-STABLE is source-only IIRC, this looks strange to me; because 12-STABLE implies you built kernel & world from source, incl. graphics drivers; correct?


I have downloaded FreeBSD-12.2-STABLE-amd64-20210225-r369362-memstick.img and installed it from a USB stick. No packages installed, everything built from ports on the same system, including the nvidia driver.


Mjölnir said:


> You must not install any kernel modules from packages (*-kmod) on any *-STABLE revision.  You didn't, correct?


I did not.


Mjölnir said:


> The point is: you built the graphics driver from ports(7) on that very same system, good.  The _stable_ branch should be -- well, very stable; that will be the next 12.3 revision, it receives updates every few days.  Doesn't mean it is bug-free.


STABLE has been very stable in my experience.


Mjölnir said:


> BIOS: legacy or UEFI?  Please try harder to make sure there is only one graphics port.  Disable the others.  Once we succeed to have something working, you can try to enable the 2nd graphics port and maybe find a configuration where you can switch between both or maybe even run both concurrently.  But let's start with the most basic config possible.


It's legacy. The motherboard is an old SUPERMICRO MBD-H8SGL-F-O ATX.

I have toggled to onboard VGA in the BIOS. Verified that the monitor input is VGA, not HDMI (which is connected to the NVIDIA card).

Also, commented out nvidia:

`# cat /boot/loader.conf
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
opensolaris_load="YES"
zfs_load="YES"
kern.vty="vt"
# nvidia_load="YES"
# nvidia-modeset_load="YES"`

Also, deleted existing /etc/X11/xorg.conf (generated previously with nvidia-xconfig(1)).



Mjölnir said:


> xorg.conf: ideally we should start without and the X11 server should start; it's _automagic_ is very very good, often better than the average human.


Well, tried to start X again, but failed:

`# cat /var/log/Xorg.0.log
[  1006.365] 
X.Org X Server 1.20.9
X Protocol Version 11, Revision 0
[  1006.365] Build Operating System: FreeBSD 12.2-STABLE amd64 
[  1006.365] Current Operating System: FreeBSD buffrescue.[...] 12.2-STABLE FreeBSD 12.2-STABLE r369362 GENERIC amd64
[  1006.366] Build Date: 01 March 2021  02:20:56AM
[  1006.366]  
[  1006.366] Current version of pixman: 0.40.0
[  1006.366]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[  1006.366] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  1006.367] (==) Log file: "/var/log/Xorg.0.log", Time: Tue Mar  2 01:55:06 2021
[  1006.390] (==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
[  1006.390] (==) No Layout section.  Using the first Screen section.
[  1006.390] (==) No screen section available. Using defaults.
[  1006.390] (**) |-->Screen "Default Screen Section" (0)
[  1006.391] (**) |   |-->Monitor "<default monitor>"
[  1006.391] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.
[  1006.391] (==) Automatically adding devices
[  1006.391] (==) Automatically enabling devices
[  1006.392] (==) Not automatically adding GPU devices
[  1006.392] (==) Max clients allowed: 256, resource mask: 0x1fffff
[  1006.392] (==) 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/,
    catalogue:/usr/local/etc/X11/fontpath.d
[  1006.392] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[  1006.392] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
[  1006.392] (II) Loader magic: 0x434a80
[  1006.392] (II) Module ABI versions:
[  1006.392]     X.Org ANSI C Emulation: 0.4
[  1006.392]     X.Org Video Driver: 24.1
[  1006.392]     X.Org XInput driver : 24.1
[  1006.392]     X.Org Server Extension : 10.0
[  1006.393] (!!) More than one possible primary device found
[  1006.393] (--) PCI: (1@0:0:0) 10de:1d01:1458:375d rev 161, Mem @ 0xfc000000/16777216, 0xd0000000/268435456, 0xce000000/33554432, I/O @ 0x0000c800/128, BIOS @ 0x????????/65536
[  1006.393] (--) PCI: (4@0:4:0) 102b:0532:15d9:a711 rev 10, Mem @ 0xfa000000/16777216, 0xfdffc000/16384, 0xfe000000/8388608, BIOS @ 0x????????/65536
[  1006.393] (II) LoadModule: "glx"
[  1006.394] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[  1006.397] (II) Module glx: vendor="X.Org Foundation"
[  1006.397]     compiled for 1.20.9, module version = 1.0.0
[  1006.397]     ABI class: X.Org Server Extension, version 10.0
[  1006.397] (==) Matched modesetting as autoconfigured driver 0
[  1006.397] (==) Matched scfb as autoconfigured driver 1
[  1006.397] (==) Matched vesa as autoconfigured driver 2
[  1006.397] (==) Assigned the driver to the xf86ConfigLayout
[  1006.398] (II) LoadModule: "modesetting"
[  1006.398] (II) Loading /usr/local/lib/xorg/modules/drivers/modesetting_drv.so
[  1006.405] (II) Module modesetting: vendor="X.Org Foundation"
[  1006.405]     compiled for 1.20.9, module version = 1.20.9
[  1006.405]     Module class: X.Org Video Driver
[  1006.405]     ABI class: X.Org Video Driver, version 24.1
[  1006.405] (II) LoadModule: "scfb"
[  1006.406] (II) Loading /usr/local/lib/xorg/modules/drivers/scfb_drv.so
[  1006.412] (II) Module scfb: vendor="X.Org Foundation"
[  1006.412]     compiled for 1.20.9, module version = 0.0.5
[  1006.412]     ABI class: X.Org Video Driver, version 24.1
[  1006.412] (II) LoadModule: "vesa"
[  1006.412] (II) Loading /usr/local/lib/xorg/modules/drivers/vesa_drv.so
[  1006.425] (II) Module vesa: vendor="X.Org Foundation"
[  1006.425]     compiled for 1.20.9, module version = 2.5.0
[  1006.425]     Module class: X.Org Video Driver
[  1006.425]     ABI class: X.Org Video Driver, version 24.1
[  1006.425] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[  1006.425] (II) scfb: driver for wsdisplay framebuffer: scfb
[  1006.425] (II) VESA: driver for VESA chipsets: vesa
[  1006.430] (--) Using syscons driver with X support (version 2.0)
[  1006.430] (--) using VT number 9

[  1006.458] (WW) Falling back to old probe method for modesetting
[  1006.458] (EE) open /dev/dri/card0: No such file or directory
[  1006.458] (WW) Falling back to old probe method for scfb
[  1006.458] scfb trace: probe start
[  1006.458] scfb trace: probe done
[  1006.458] (WW) Falling back to old probe method for modesetting
[  1006.459] (EE) open /dev/dri/card0: No such file or directory
[  1006.459] (WW) Falling back to old probe method for scfb
[  1006.459] scfb trace: probe start
[  1006.459] scfb trace: probe done
[  1006.459] (EE) No devices detected.
[  1006.459] (EE) 
Fatal server error:
[  1006.459] (EE) no screens found(EE)`


----------



## Snurg (Mar 2, 2021)

I have looked at the sources of the xf86-video-mga driver. It supports your onboard vga chip. So it might be interesting to `pkg install` the driver and look what happens.

With my currently installed Nvidia cards I was not able to use HDMI or DP.
No idea why... could be defective cable, monitor, card or driver. I am using DVI or VGA. In case you have a VGA or DVI cable, maybe try it?


----------



## shkhln (Mar 2, 2021)

Mjölnir said:


> xorg.conf: ideally we should start without and the X11 server should start; it's _automagic_ is very very good, often better than the average human.


It's not magic, it goes through a hardcoded set of drivers and only probes nvidia on Solaris (!): https://github.com/freedesktop/xorg-xserver/blob/master/hw/xfree86/common/xf86AutoConfig.c#L228. Our port is additionally patched to probe scfb. That's all there is to it.


----------



## shkhln (Mar 2, 2021)

amnixed said:


> I have rebuilt x11/nvidia-driver but `startx` produces the same error.


I'd suggest to trace it (with truss or ktrace). Pay attention to what happens with /dev/nvidia* files, see if there are any failing ioctls.


----------



## amnixed (Mar 2, 2021)

Snurg said:


> I have looked at the sources of the xf86-video-mga driver. It supports your onboard vga chip. So it might be interesting to `pkg install` the driver and look what happens.
> 
> With my currently installed Nvidia cards I was not able to use HDMI or DP.
> No idea why... could be defective cable, monitor, card or driver. I am using DVI or VGA. In case you have a VGA or DVI cable, maybe try it?


Just installed x11-drivers/xf86-video-mga, getting the same error.


----------



## amnixed (Mar 2, 2021)

shkhln said:


> I'd suggest to trace it (with truss or ktrace). Pay attention to what happens with /dev/nvidia* files, see if there are any failing ioctls.


I fell back on the onboard video (VGA) which can't start X either. Unfortunately, I have no expertise to interpret truss(1) output. I have attached the file.


----------



## T-Daemon (Mar 2, 2021)

amnixed said:


> Also, deleted existing /etc/X11/xorg.conf (generated previously with nvidia-xconfig(1)).


Without an X configuration file for the NVIDIA driver there won't be a use of the full potential of the GPU, all attempts to diagnose the problem without loading the driver are useless. As the Xorg.0.log in #19 shows no NVIDIA driver is loaded. Please put the following minimal configuration into /usr/local/etc/X11/xorg.conf.d/nvidia.conf, restart Xorg and report back:


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


----------



## shkhln (Mar 2, 2021)

amnixed said:


> I fell back on the onboard video (VGA) which can't start X either. Unfortunately, I have no expertise to interpret truss(1) output. I have attached the file.


`sudo ktrace -d X -retro`, then `kdump -H | grep -E "(ioctl|nvidia)" -A 1`.


----------



## Snurg (Mar 2, 2021)

Yes, the nvidia-driver is necessary, as xorg itself only detects the (very old!) nvidia cards that are supported by the xf86-video-nv driver.



shkhln said:


> It's not magic, it goes through a hardcoded set of drivers and only probes nvidia on Solaris (!): https://github.com/freedesktop/xorg-xserver/blob/master/hw/xfree86/common/xf86AutoConfig.c#L228. Our port is additionally patched to probe scfb. That's all there is to it.


If all other attempts do not help, maybe try deleting the nvidia-driver and installing the upstream nvidia driver from the nvidia site.
If it then still does not work, then a problem with the port itself could probably be ruled out.

Personally I am using the upstream driver because, at least with earlier versions of the packaged nvidia-drivers, there were stability problems with suspend/resume.
This is commonly advised against, because the upstream driver does not register itself with the packaging system, which can cause problems when installing or updating stuff.


----------



## shkhln (Mar 2, 2021)

Snurg said:


> xorg itself only detects the (very old!) nvidia cards that are supported by the xf86-video-nv driver.


That's not true.



Snurg said:


> If all other attempts do not help, maybe try deleting the nvidia-driver and installing the upstream nvidia driver from the nvidia site.


Tracing and bisection are pretty reliable debugging strategies. Reinstalling things with random variations, on the other hand, is not.


----------



## T-Daemon (Mar 2, 2021)

amnixed said:


> Also, commented out nvidia:
> 
> 
> ```
> ...


Also the X configuration is useless without the NVIDIA kernel module loaded. Execute as root `kldload nvidia-modeset` before `startx`.

Note: The recommended place to enable the driver is in /etc/rc.conf:

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


----------



## Mjölnir (Mar 2, 2021)

I re-read the thread from the top to better understand what's going on.  If you know all this, please ignore & sorry for the noise.

You are aware that FreeBSD has CURRENT (_head branch_, developer) major-STABLE (stable API, test branch) & major.minor-RELEASE (production) branches of the source tree.
The _stable_ branch receives cherry-picked so-called MFC updates & bug fixes from _current_, and this will eventually become the next maj.min _release_.  The purpose of _stable_ is to supply newest software to _early adaptors_ willing to test  & help with bug fixes.  _Early adaptors_ are typically the test labs of big organisations, experienced users willing to test & curious newbies... Besides that, those whose hardware demands the newest release because their hardware is not supported by a _release_ version.
Therefore, if you want to run _stable_, you are kindly requested to subscribe to svn-src-stable (read about latest MFCs) & freebsd-stable (report bugs & get help).  Did you?
That version maj.min-STABLE is to make the version number to conform to the scheme maj.min-XYZ, e.g. to make scripts happy that parse that.  In realitas, it is maj-STABLE.



amnixed said:


> FWIW, X did work fine in this same hardware setup under 12.1-STABLE. Yesterday I updated from source, after which neither the new nor the old kernel booted. I installed an additional hard drive and installed on the new hard drive 12.2-STABLE and imported the old zpool - but haven't been able to start X.


No matter the outcome here, you should report this issue to the mailing list, because your previous _stable_ version ran ok, so there must have been an MFC that might be suspicious or errorneous and should be investigated.

Now enjoy the privilege to follow a graphics wizzards (shkhin) guidance. T-Daemon may also be one, I dunno because usually I don't follow these threads.  I'm not, @least not with non-intel.  Afterwards, you may want to sum up & report to <freebsd-stable_@_freebsd.org_>_.  Good luck!

PS: Theoretically, a x11 graphics driver from packages (same _major_ version) should run as long as it's not a kernel module (*-kmod), but experience shows that you're better off compiling from ports for the kernel version you want to run it on.  Since these talk to the kernel module, minimal changes in the kernel interface can cause incompatibilities.


----------



## amnixed (Mar 2, 2021)

T-Daemon said:


> Without an X configuration file for the NVIDIA driver there won't be a use of the full potential of the GPU, all attempts to diagnose the problem without loading the driver are useless. As the Xorg.0.log in #19 shows no NVIDIA driver is loaded. Please put the following minimal configuration into /usr/local/etc/X11/xorg.conf.d/nvidia.conf, restart Xorg and report back:
> 
> 
> ```
> ...


Hello T-Daemon,

following the advice given by Mjölnir, I have disabled the nvidia card in the BIOS in favor of the on-board card. X gives the same error using either the onboard card or the GT 1030.


----------



## T-Daemon (Mar 2, 2021)

There is a lot of mixing two GPU's going on here, I suggest we concentrate on one GPU. Is this a desktop or notebook system? Please give details on the hardware.


----------



## T-Daemon (Mar 2, 2021)

T-Daemon said:


> Is this a desktop or notebook system? Please give details on the hardware.


Got it.


amnixed said:


> The motherboard is an old SUPERMICRO MBD-H8SGL-F-O ATX.


Is the Xorg configuration I advised in place, and the nvidia-modeset kernel driver loaded?


----------



## amnixed (Mar 2, 2021)

T-Daemon said:


> There is a lot of mixing two GPU's going on here, I suggest we concentrate on one GPU. Is this a desktop or notebook system? Please give details on the hardware.


Hello T-Daemon,

It's a desktop. Full dmesg:

`# dmesg
---<<BOOT>>---
Copyright (c) 1992-2021 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
    The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.2-STABLE r369362 GENERIC amd64
FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2)
VT(vga): resolution 640x480
CPU: AMD Opteron(TM) Processor 6212                  (2600.06-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0x600f12  Family=0x15  Model=0x1  Stepping=2
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
  Features2=0x1e98220b<SSE3,PCLMULQDQ,MON,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,AESNI,XSAVE,OSXSAVE,AVX>
  AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
  AMD Features2=0x1c9bfff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,XOP,SKINIT,WDT,LWP,FMA4,NodeId,Topology,PCXC,PNXC>
  SVM: NP,NRIP,VClean,AFlush,DAssist,NAsids=65536
  TSC: P-state invariant, performance statistics
real memory  = 34359738368 (32768 MB)
avail memory = 33353658368 (31808 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: <111111 APIC1653>
FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs
FreeBSD/SMP: 1 package(s) x 2 cache groups x 4 core(s)
random: unblocking device.
Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/32 (20200430/tbfadt-748)
ioapic0 <Version 2.1> irqs 0-23 on motherboard
Launching APs: 1 2 6 3 7 5 4
Timecounter "TSC-low" frequency 1300028028 Hz quality 1000
random: entropy device external interface
WARNING: Device "g_ctl" is Giant locked and may be deleted before FreeBSD 14.0.
000.000017 [4340] netmap_init               netmap: loaded module
WARNING: Device "pci" is Giant locked and may be deleted before FreeBSD 14.0.
[ath_hal] loaded
module_register_init: MOD_LOAD (vesa, 0xffffffff81171790, 0) error 19
WARNING: Device "kbd" is Giant locked and may be deleted before FreeBSD 14.0.
kbd1 at kbdmux0
mlx5en: Mellanox Ethernet driver 3.6.0 (December 2020)
nexus0
vtvga0: <VT VGA driver> on motherboard
cryptosoft0: <software crypto> on motherboard
acpi0: <SMCI > on motherboard
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
atrtc0: registered as a time-of-day clock, resolution 1.000000s
Event timer "RTC" frequency 32768 Hz quality 0
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 950
apei0: <ACPI Platform Error Interface> on acpi0
Timecounter "ACPI-safe" frequency 3579545 Hz quality 850
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> irq 18 at device 2.0 on pci0
pci1: <ACPI PCI bus> on pcib1
vgapci0: <VGA-compatible display> port 0xc800-0xc87f mem 0xfc000000-0xfcffffff,0xd0000000-0xdfffffff,0xce000000-0xcfffffff irq 18 at device 0.0 on pci1
vgapci0: Boot video device
hdac0: <NVIDIA (0x0fb8) HDA Controller> mem 0xfdefc000-0xfdefffff irq 19 at device 0.1 on pci1
pcib2: <ACPI PCI-PCI bridge> irq 17 at device 9.0 on pci0
pci2: <ACPI PCI bus> on pcib2
em0: <Intel(R) PRO/1000 Network Connection> port 0xd800-0xd81f mem 0xfe9e0000-0xfe9fffff,0xfe9dc000-0xfe9dffff irq 17 at device 0.0 on pci2
em0: Using 1024 TX descriptors and 1024 RX descriptors
em0: Using 2 RX queues 2 TX queues
em0: Using MSI-X interrupts with 3 vectors
em0: Ethernet address: 00:25:90:4e:32:3a
em0: netmap queues/slots: TX 2/1024, RX 2/1024
pcib3: <ACPI PCI-PCI bridge> irq 18 at device 10.0 on pci0
pci3: <ACPI PCI bus> on pcib3
em1: <Intel(R) PRO/1000 Network Connection> port 0xe800-0xe81f mem 0xfeae0000-0xfeafffff,0xfeadc000-0xfeadffff irq 18 at device 0.0 on pci3
em1: Using 1024 TX descriptors and 1024 RX descriptors
em1: Using 2 RX queues 2 TX queues
em1: Using MSI-X interrupts with 3 vectors
em1: Ethernet address: 00:25:90:4e:32:3b
em1: netmap queues/slots: TX 2/1024, RX 2/1024
ahci0: <AMD SB7x0/SB8x0/SB9x0 AHCI SATA controller> port 0xb000-0xb007,0xa000-0xa003,0x9000-0x9007,0x8000-0x8003,0x7000-0x700f mem 0xfebfbc00-0xfebfbfff irq 22 at device 17.0 on pci0
ahci0: AHCI v1.10 with 4 3Gbps ports, Port Multiplier supported
ahci0: quirks=0x22000<ATI_PMP_BUG,1MSI>
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0
ahcich2: <AHCI channel> at channel 2 on ahci0
ahcich3: <AHCI channel> at channel 3 on ahci0
ohci0: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfebf9000-0xfebf9fff irq 16 at device 18.0 on pci0
usbus0 on ohci0
usbus0: 12Mbps Full Speed USB v1.0
ohci1: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfebfa000-0xfebfafff irq 16 at device 18.1 on pci0
usbus1 on ohci1
usbus1: 12Mbps Full Speed USB v1.0
ehci0: <AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller> mem 0xfebfb800-0xfebfb8ff irq 17 at device 18.2 on pci0
usbus2: EHCI version 1.0
usbus2 on ehci0
usbus2: 480Mbps High Speed USB v2.0
ohci2: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfebf7000-0xfebf7fff irq 18 at device 19.0 on pci0
usbus3 on ohci2
usbus3: 12Mbps Full Speed USB v1.0
ohci3: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfebf8000-0xfebf8fff irq 18 at device 19.1 on pci0
usbus4 on ohci3
usbus4: 12Mbps Full Speed USB v1.0
ehci1: <AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller> mem 0xfebfb400-0xfebfb4ff irq 19 at device 19.2 on pci0
usbus5: EHCI version 1.0
usbus5 on ehci1
usbus5: 480Mbps High Speed USB v2.0
atapci0: <ATI IXP700/800 UDMA133 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xff00-0xff0f at device 20.1 on pci0
ata0: <ATA channel> at channel 0 on atapci0
ata1: <ATA channel> at channel 1 on atapci0
isab0: <PCI-ISA bridge> at device 20.3 on pci0
isa0: <ISA bus> on isab0
pcib4: <ACPI PCI-PCI bridge> at device 20.4 on pci0
pci4: <ACPI PCI bus> on pcib4
vgapci1: <VGA-compatible display> mem 0xfa000000-0xfaffffff,0xfdffc000-0xfdffffff,0xfe000000-0xfe7fffff irq 20 at device 4.0 on pci4
ohci4: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfebf6000-0xfebf6fff irq 18 at device 20.5 on pci0
usbus6 on ohci4
usbus6: 12Mbps Full Speed USB v1.0
acpi_button0: <Power Button> on acpi0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0
orm0: <ISA Option ROM> at iomem 0xce800-0xcf7ff pnpid ORM0000 on isa0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbdc0: non-PNP ISA device will be removed from GENERIC in FreeBSD 12.
hwpstate0: <Cool`n'Quiet 2.0> on cpu0
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
Timecounters tick every 1.000 msec
hdacc0: <NVIDIA (0x0081) HDA CODEC> at cad 0 on hdac0
hdaa0: <NVIDIA (0x0081) Audio Function Group> at nid 1 on hdacc0
pcm0: <NVIDIA (0x0081) (HDMI/DP 8ch)> at nid 4 on hdaa0
pcm1: <NVIDIA (0x0081) (HDMI/DP 8ch)> at nid 5 on hdaa0
ugen4.1: <ATI OHCI root HUB> at usbus4
ugen1.1: <ATI OHCI root HUB> at usbus1
uhub0: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus4
ugen0.1: <ATI OHCI root HUB> at usbus0
ugen5.1: <ATI EHCI root HUB> at usbus5
uhub1: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen3.1: <ATI OHCI root HUB> at usbus3
ugen2.1: <ATI EHCI root HUB> at usbus2
Trying to mount root from zfs:buffrescue/ROOT/default []...
Root mount waiting for: CAM usbus0 usbus1 usbus2 usbus3 usbus4 usbus5 usbus6
uhub2: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
uhub3: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus3
uhub4: <ATI EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
ugen6.1: <ATI OHCI root HUB> at usbus6
uhub5: <ATI EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus5
uhub6: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus6
uhub6: 2 ports with 2 removable, self powered
uhub1: 3 ports with 3 removable, self powered
uhub2: 3 ports with 3 removable, self powered
uhub3: 3 ports with 3 removable, self powered
uhub0: 3 ports with 3 removable, self powered
Root mount waiting for: CAM usbus2 usbus5
Root mount waiting for: CAM usbus2 usbus5
uhub5: 6 ports with 6 removable, self powered
uhub4: 6 ports with 6 removable, self powered
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <Hitachi HDS723020BLA642 MN6OA800> ATA8-ACS SATA 3.x device
ada0: Serial Number MN1240F33RJUXD
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 1907729MB (3907029168 512 byte sectors)
ada1 at ahcich1 bus 0 scbus1 target 0 lun 0
ada1: <Hitachi HDS723020BLA642 MN6OA800> ATA8-ACS SATA 3.x device
ada1: Serial Number MN1240F33RLNGD
ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada1: Command Queueing enabled
ada1: 1907729MB (3907029168 512 byte sectors)
ada2 at ahcich2 bus 0 scbus2 target 0 lun 0
ada2: <Hitachi HDS723020BLA642 MN6OA800> ATA8-ACS SATA 3.x device
ada2: Serial Number MN1240F33RGGXD
ada2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada2: Command Queueing enabled
ada2: 1907729MB (3907029168 512 byte sectors)
ada3 at ata0 bus 0 scbus4 target 1 lun 0
ada3: <WDC WD2003FZEX-00Z4SA0 01.01A01> ACS-2 ATA SATA 3.x device
ada3: Serial Number WD-WMC1F1223234
ada3: 150.000MB/s transfers (SATA, UDMA6, PIO 8192bytes)
ada3: 1907729MB (3907029168 512 byte sectors)
ada3: quirks=0x1<4K>
cd0 at ahcich3 bus 0 scbus3 target 0 lun 0
cd0: <ASUS DRW-24B1ST   c 1.05> Removable CD-ROM SCSI device
cd0: Serial Number C3D0CL166037
cd0: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO 8192bytes)
cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed
ugen0.2: <Logitech Trackball> at usbus0
ugen3.2: <Winbond Electronics Corp Hermon USB hidmouse Device> at usbus3
ukbd0 on uhub3
ukbd0: <Winbond Electronics Corp Hermon USB hidmouse Device, class 0/0, rev 1.10/0.01, addr 2> on usbus3
kbd2 at ukbd0
ugen1.2: <Unicomp Inc Unicomp R7210xKbrdv748> at usbus1
ukbd1 on uhub2
ukbd1: <Boot Ifc Keyboard> on usbus1
kbd3 at ukbd1
intsmb0: <AMD SB600/7xx/8xx/9xx SMBus Controller> at device 20.0 on pci0
intsmb0: intr SMI enabled revision 0
intsmb0: using polling mode when configured interrupt is SMI
smbus0: <System Management Bus> on intsmb0
lo0: link state changed to UP
em0: link state changed to UP
ums0 on uhub3
ums0: <Winbond Electronics Corp Hermon USB hidmouse Device, class 0/0, rev 1.10/0.01, addr 2> on usbus3
ums1 on uhub1
ums1: <Logitech Trackball, class 0/0, rev 1.10/2.20, addr 2> on usbus0
ums0: 3 buttons and [Z] coordinates ID=0
ums1: 3 buttons and [XYZ] coordinates ID=0
Security policy loaded: MAC/ntpd (mac_ntpd)`


----------



## amnixed (Mar 2, 2021)

T-Daemon said:


> Got it.
> 
> Is the Xorg configuration I advised in place, and the nvidia-modeset kernel driver loaded?


Yes, both:

`# kldload nvidia-modeset
kldload: can't load nvidia-modeset: module already loaded or in kernel`

`# cat /usr/local/etc/X11/xorg.conf.d/nvidia.conf
Section "Device"
    Identifier "Card0"
    Driver     "nvidia"
EndSection`

Also, I have attached the file startx3.txt which is the output of `truss -o startx3.txt startx`


----------



## shkhln (Mar 2, 2021)

amnixed said:


> Also, I have attached the file startx3.txt which is the output of `truss -o startx3.txt startx`


That won't do. See https://forums.FreeBSD.org/threads/no-devices-detected-no-screens-found-ee.79127/post-497019.


----------



## T-Daemon (Mar 3, 2021)

amnixed said:


> Yes, both:
> 
> `# kldload nvidia-modeset
> kldload: can't load nvidia-modeset: module already loaded or in kernel`
> ...


Please execute `startx -- -verbose 5 -logverbose 5` and afterwards `cat /var/log/Xorg.0.log | nc termbin.com 9999`, post URL.


----------



## amnixed (Mar 3, 2021)

Thank you for your continuing patience. Here is the link:
https://termbin.com/uhsr


----------



## Snurg (Mar 3, 2021)

The xorg.conf only tells us what we alredy know, that the packaged nvidia-driver just does nothing.
It does not give idea why.

shkln repeated multiple times:


shkhln said:


> `sudo ktrace -d X -retro`, then `kdump -H | grep -E "(ioctl|nvidia)" -A 1`.


----------



## amnixed (Mar 4, 2021)

Hello Snurg,

Here it is:

`# ktrace -d X -retro

X.Org X Server 1.20.9
X Protocol Version 11, Revision 0
Build Operating System: FreeBSD 12.2-STABLE amd64 
Current Operating System: FreeBSD buffrescue.[...] 12.2-STABLE FreeBSD 12.2-STABLE r369362 GENERIC amd64
Build Date: 01 March 2021  02:20:56AM

Current version of pixman: 0.40.0
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Thu Mar  4 00:24:05 2021
(==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
(EE) 
Fatal server error:
(EE) no screens found(EE) 
(EE) 
Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.
# kdump -H | grep -E "(ioctl|nvidia)" -A 1
  4950 101440 Xorg.wrap NAMI  "/usr/local/etc/libmap.d/nvidia.conf"
  4950 101440 Xorg.wrap RET   openat 4
--
       "# libmap.conf file for nvidia provide libraries

--
    libGLESv1_CM.so    libGLESv1_CM_nvidia.so
    libGLESv1_CM.so.1    libGLESv1_CM_nvidia.so.1

--
  4950 101440 Xorg     NAMI  "/usr/local/etc/libmap.d/nvidia.conf"
  4950 101440 Xorg     RET   openat 4
--
       "# libmap.conf file for nvidia provide libraries

--
    libGLESv1_CM.so    libGLESv1_CM_nvidia.so
    libGLESv1_CM.so.1    libGLESv1_CM_nvidia.so.1

--
  4950 101440 Xorg     NAMI  "/usr/local/etc/X11/xorg.conf.d/nvidia.conf"
  4950 101440 Xorg     RET   open 14/0xe
--
        Driver     "nvidia"
    EndSection
--
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCGETCONF,0x7fffffffb8f0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  mmap(0,0x3000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0)
--
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCREAD,0x7fffffffe848)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCGETBAR,0x7fffffffe8e0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCGETBAR,0x7fffffffe8e0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCGETBAR,0x7fffffffe8e0)
  4950 101440 Xorg     RET   ioctl -1 errno 22 Invalid argument
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCGETBAR,0x7fffffffe8e0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCGETBAR,0x7fffffffe8e0)
  4950 101440 Xorg     RET   ioctl -1 errno 22 Invalid argument
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCGETBAR,0x7fffffffe8e0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCREAD,0x7fffffffe848)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCGETBAR,0x7fffffffe8e0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCGETBAR,0x7fffffffe8e0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCGETBAR,0x7fffffffe8e0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCGETBAR,0x7fffffffe8e0)
  4950 101440 Xorg     RET   ioctl -1 errno 22 Invalid argument
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCGETBAR,0x7fffffffe8e0)
  4950 101440 Xorg     RET   ioctl -1 errno 22 Invalid argument
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCGETBAR,0x7fffffffe8e0)
  4950 101440 Xorg     RET   ioctl -1 errno 22 Invalid argument
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCREAD,0x7fffffffe8b8)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xa,PCIOCREAD,0x7fffffffe8b8)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  write(0x3,0x7fffffffdcd0,0xd)
--
  4950 101440 Xorg     NAMI  "/usr/local/lib/xorg/modules/drivers/nvidia_drv.so/"
  4950 101440 Xorg     RET   fstatat -1 errno 20 Not a directory
--
  4950 101440 Xorg     NAMI  "/usr/local/lib/xorg/modules/extensions/libglxserver_nvidia.so/"
  4950 101440 Xorg     RET   fstatat -1 errno 20 Not a directory
--
       "(II) LoadModule: "nvidia""
  4950 101440 Xorg     RET   write 25/0x19
--
  4950 101440 Xorg     NAMI  "/usr/local/lib/xorg/modules/drivers/nvidia_drv.so/"
  4950 101440 Xorg     RET   fstatat -1 errno 20 Not a directory
--
       "(II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
       "
--
  4950 101440 Xorg     NAMI  "/usr/local/lib/xorg/modules/drivers/nvidia_drv.so"
  4950 101440 Xorg     RET   openat 12/0xc
--
       "(II) Module nvidia: vendor="NVIDIA Corporation"
       "
--
  4950 101440 Xorg     CALL  ioctl(0xc,TIOCNOTTY,0)
  4950 101440 Xorg     RET   ioctl -1 errno 1 Operation not permitted
  4950 101440 Xorg     CALL  close(0xc)
--
  4950 101440 Xorg     CALL  ioctl(0xc,0xc0185671,0x7fffffffe3d8)
  4950 101440 Xorg     RET   ioctl -1 errno 25 Inappropriate ioctl for device
  4950 101440 Xorg     CALL  close(0xc)
--
  4950 101440 Xorg     CALL  ioctl(0xc,VT_GETMODE,0x7fffffffe3e0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,CONS_GETVERS,0x7fffffffe3d8)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,VT_GETACTIVE,0x43b4dc)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,VT_OPENQRY,0x43b23c)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  close(0xc)
--
  4950 101440 Xorg     CALL  ioctl(0xc,VT_GETMODE,0x7fffffffe3e0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  write(0x3,0x7fffffffd760,0xd)
--
  4950 101440 Xorg     CALL  ioctl(0xc,VT_ACTIVATE,0x9)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,VT_WAITACTIVE,0x9)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  sigprocmask(SIG_SETMASK,0x80091c66c,0x7fffffffe2f0)
--
  4950 101440 Xorg     CALL  ioctl(0xc,VT_SETMODE,0x7fffffffe438)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,KDSETMODE,0x1)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,TIOCGETA,0x44f314)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,KDGKBMODE,0x44f340)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,KDSKBMODE,0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,TIOCSETA,0x7fffffffe440)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  openat(AT_FDCWD,0x230e13,0x2<O_RDWR>)
--
  4950 101440 Xorg     CALL  ioctl(0xc,KDSETMODE,0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,KDSKBMODE,0x1)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,TIOCSETA,0x44f314)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,VT_GETMODE,0x7fffffffe8a0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,VT_SETMODE,0x7fffffffe8a0)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  ioctl(0xc,VT_ACTIVATE,0x1)
  4950 101440 Xorg     RET   ioctl 0
  4950 101440 Xorg     CALL  close(0xc)`


----------



## Snurg (Mar 4, 2021)

Great!
Now the turn is on shkhln .
Would be wonderful if he takes the effort to find out why the packaged nvidia driver apparently does some erroneous system calls and bails out.


----------



## shkhln (Mar 4, 2021)

As far as I can tell, the userspace driver doesn't attempt to talk to the kernel driver. amnixed, did you actually test a configuration with _BusID "PCI:1:0:0"_?


----------



## amnixed (Mar 5, 2021)

Hello shkhln,

I have added the file /usr/local/etc/X11/xorg.conf.d/nvidia.conf with the content


```
Section "Device"
    Identifier "Card0"
    Driver     "nvidia"
    BusID "PCI:1:0:0"
EndSection
```

Also, copied the same file to /usr/local/share/X11/xorg.conf.d/nvidia.conf.

`# ls -l /usr/local/share/X11/xorg.conf.d
total 19
-rw-r--r--  1 root  wheel  1099 Mar  1 02:31 10-evdev.conf
-rw-r--r--  1 root  wheel  1350 Mar  1 02:24 10-quirks.conf
-rw-r--r--  1 root  wheel   152 Mar  1 02:24 20-evdev-kbd.conf
-rw-r--r--  1 root  wheel  1429 Mar  1 02:41 40-libinput.conf
-rw-r--r--  1 root  wheel    93 Mar  5 09:21 nvidia.conf`


X does start, but the keyboard and mouse is frozen and shows a black screen, and CTR-ALT-Backspace doesn't kill X.

I have attached the logfile.


----------



## amnixed (Mar 5, 2021)

shkhln said:


> As far as I can tell, the userspace driver doesn't attempt to talk to the kernel driver. amnixed, did you actually test a configuration with _BusID "PCI:1:0:0"_?


Forgot to add: in the startup messages, this appears: rc.conf: nvidia-modeset_load=YES: not found


----------



## Snurg (Mar 5, 2021)

Well, I think it might be best to be frank:
I feel at loss why it was necessary at least three times to ask, by me and by shkhln as well, to make you actually try with the BusID directive.
Getting the kernel trace also needed at least three requests by shkhln and me as well.

Regarding the log, I see no monitor detection, and I do not know why.
Personally I have the feeling it might be due to some problem with the packaged driver, but who knows whether you actually did all steps necessary. You may want to review the article "HOWTO: Setup Xorg with NVIDIA's driver" to verify this.

If this does provide insights, you might send another kernel trace, this time with the nvidia driver actually running due to the BusID directive. Maybe shkhln might look into it then.

The Zap keys are disabled by default, here is how to re-enable them.

Otherwise, if shkhln is already tired of this issue, I'd try the upstream driver just to know whether it also shows the same problems like the packaged version.


----------



## shkhln (Mar 6, 2021)

```
% pkg info -D nvidia-driver
…
Starting with version 358.09, some important functionality of the driver
has been broken out into a separate kernel module, nvidia-modeset.ko.
Users that experience hangs when starting X11 server, or observe

    (II) NVIDIA(0): Validated MetaModes:
    (II) NVIDIA(0):     "NULL"

in /var/log/Xorg.0.log should replace ``nvidia'' with ``nvidia-modeset''
in their /boot/loader.conf or /etc/rc.conf configuration files, depending
on how they prefer to load NVidia driver kernel module.

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


----------



## T-Daemon (Mar 6, 2021)

amnixed said:


> Also, copied the same file to /usr/local/share/X11/xorg.conf.d/nvidia.conf.



Please remove it. That in /usr/local/etc/X11/xorg.conf.d will suffice.



amnixed said:


> Forgot to add: in the startup messages, this appears: rc.conf: nvidia-modeset_load=YES: not found



Please remove `nvidia-modeset_load=YES` from /etc/rc.conf, enable the nvidia driver in the same file  with `kld_list="nvidia"` only.


----------



## Mjölnir (Mar 6, 2021)

Using `sysrc kld_list+=" nvidia"` is safer, since it does not remove all other entries of `kld_list`.  Likewise, you can remove with the command `sysrc -x "nvidia-modeset_load"`


----------



## amnixed (Mar 6, 2021)

Hello shkhln, T-Daemon, Snurg and Mjölnir,

Thank you for all your help and my apologies for being a scatterbrain in following your advice.

1. I have added the configuration described in the post https://unix.stackexchange.com/questions/375/how-to-enable-killing-xorg-with-ctrlaltbackspace.

2. In /etc/rc.conf removed 
	
	



```
nvidia-modeset_load="YES"
```
 and added 
	
	



```
kld_list+="nvidia"
```
.

3. In /boot/loader.conf replaced 
	
	



```
nvidia_load="YES"
```
 with 
	
	



```
nvidia-modeset_load="YES"
```
.

4. Rebooted.

5. Starting X: works perfect!

6. CTR-ALT-Backspace kills X.

Upon startup though I see "/etc/rc.conf: kld_list+=nvidia: not found".

I have attached the last Xorg.0.log file.


----------



## Mjölnir (Mar 6, 2021)

`kld_list+="nvidia"` will not work as expected.  This syntax can be used with the command line utilty sysrc(8) like this: on a console (aka terminal) type as user _root_: `sysrc kld_list+=" nvidia"` (note the space) will append the string `nvidia` (again note the space) to the variable `kld_list` in the file rc.conf(5).  When you omit the space, the item to add will be merged tightly to the previous items in that variable, without the necessary space between them.  That `kld_list` is, well, a list.  The separator between the items of the list is a space.


----------



## Mjölnir (Mar 6, 2021)

Maybe T-Daemon knew that your `kld_list` must have been empty & then he was absolutely right to write `kld_list="nvidia"` and I had better not written that trick, because it confused you...


----------



## amnixed (Mar 7, 2021)

Mjölnir said:


> `kld_list+="nvidia"` will not work as expected.  This syntax can be used with the command line utilty sysrc(8) like this: on a console (aka terminal) type as user _root_: `sysrc kld_list+=" nvidia"` (note the space) will append the string `nvidia` (again note the space) to the variable `kld_list` in the file rc.conf(5).  When you omit the space, the item to add will be merged tightly to the previous items in that variable, without the necessary space between them.  That `kld_list` is, well, a list.  The separator between the items of the list is a space.


Very valuable lesson for me. I was sure you made a typo. Thank you.


----------



## Snurg (Mar 7, 2021)

amnixed said:


> Very valuable lesson for me. [...] Thank you.


For me too.


Mjölnir said:


> `kld_list+="nvidia"` will not work as expected.  [...]
> `sysrc kld_list+=" nvidia"` (note the space) will append the string `nvidia` (again note the space) to the variable `kld_list` in the file rc.conf(5). [...]
> That `kld_list` is, well, a list.


Bummer.  
So one has to check anyway whether the item is already in the list, and do other formatting checks also.
And no -=
Maybe some extra options like --list, --uniqueitems and --separator would help making sysrc more usable.


----------



## Mjölnir (Mar 7, 2021)

Snurg said:


> So one has to check anyway whether the item is already in the list, and do other formatting checks also.
> And no -=
> Maybe some extra options like --list, --uniqueitems and --separator would help making sysrc more usable.


Please RTFM sysrc(8), sections APPENDING VALUES & SUBTRACTING VALUES.

Additionally, you can always RTSL `whereis sysrc` and patch it.  sysrc(8) is already doing some checks & handling strings smart.  That's no surprise since it knows it's handling strings according to sh(1)ell syntax in most cases.  And in `kld_list` duplicates won't hurt, since kernel modules refuse to load twice.
EDIT PS: Maybe some extra RTFM would help making users more BieSDable


----------



## Snurg (Mar 7, 2021)

Ahh good!
I misinterpreted your post above as if += were just concatenation, didn't get the message that the first char = separator to be used in list.
So that sysrc is actually usable, and if something clobbers the file, I can point to something else


----------

