(EE) no screens found(EE) whyle trying to enable the nvidia driver on Debian 11 emulated with bhyve

Hello.

I’m trying to enable the NVIDIA driver in Debian 11,that I have emulated with bhyve on FreeBSD 13r. This is the error I get while I’m logged inside Debian using ssh from FreeBSD :

root@marietto:~# startx


X.Org X Server 1.20.11
X Protocol Version 11, Revision 0
Build Operating System: linux Debian
Current Operating System: Linux marietto 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.10.0-8-amd64 root=UUID=c25a24a3-12f2-4653-a275-9f43924d6c3b ro quiet
Build Date: 13 April 2021  04:07:31PM
xorg-server 2:1.20.11-1 (https://www.debian.org/support) 
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: Sun Sep  5 15:48:08 2021
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/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.
^Cxinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: unexpected signal 2

This is what lspci says :

root@marietto:~# lspci

00:00.0 Host bridge: Network Appliance Corporation Device 1275
00:01.0 SCSI storage controller: Red Hat, Inc. Virtio block device
00:02.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti] (rev a1)
00:02.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Controller (rev a1)
00:02.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Host Controller (rev a1)
00:02.3 Serial bus controller [0c80]: NVIDIA Corporation TU102 USB Type-C UCSI Controller (rev a1)
00:06.0 Ethernet controller: Red Hat, Inc. Virtio network device
00:1e.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller
00:1f.0 ISA bridge: Intel Corporation Z390 Chipset LPC/eSPI Controller (rev 10)

as u can see the nvidia graphic card is passed through correctly from FreeBSD to Debian 11.

What I want to appurate is the cause of the problem. If it belongs to bhyve or to a wrong configuration of debian 11 / Xorg / or the graphic driver. Anyway,debian 11 is able to detect correctly the graphic card :

root@marietto:~# nvidia-detect

Detected NVIDIA GPUs:
00:02.0 VGA compatible controller [0300]: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti] [10de:1e04] (rev a1)

Checking card:  NVIDIA Corporation TU102 [GeForce RTX 2080 Ti] (rev a1)
Your card is supported by the default drivers.
Your card is also supported by the Tesla 460 drivers series.
Your card is also supported by the Tesla 450 drivers series.
Your card is also supported by the Tesla 418 drivers series.
It is recommended to install the nvidia-driver package.

but :

root@marietto:~# nvidia-smi
No devices were found

What I did to get that output ? I’ve followed this guide :

https://wiki.debian.org/NvidiaGraphicsDrivers#Tesla_Drivers

So,I did the following :

root@marietto:~# install nvidia-driver
root@marietto:~# nvidia-xconfig

and it has created a xorg.conf file like this :

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 460.32.03


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen0 (1)" RightOf "Screen0"
    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/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

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

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

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:0:2:0"
    Screen          0
EndSection

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

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

What else ? just ask. I really want to use my nvidia graphic card from within debian 11 os installed with bhyve. Take in consideration that it works if I use the nouveau driver. yes,my monitor,attached to the HDMI port of the graphic card turns on if I use the nouveau driver but it doesn’t if I use the nvidia driver. (I even tried with the proprietary nvidia driver)

dmesg :

[   14.697445] NVRM: GPU 0000:00:02.0: RmInitAdapter failed! (0x24:0x65:1248)

[    1.948773] nvidia: loading out-of-tree module taints kernel.
[    1.948781] nvidia: module license 'NVIDIA' taints kernel.
[    1.956323] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[    1.967795] nvidia-nvlink: Nvlink Core is being initialized, major device number 248
[    1.968329] nvidia 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
[    2.112279] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  460.91.03  Fri Jul  2 05:43:38 UTC 2021
[    2.123865] audit: type=1400 audit(1630855752.267:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe" pid=383 comm="apparmor_parser"
[    2.123868] audit: type=1400 audit(1630855752.267:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe//kmod" pid=383 comm="apparmor_parser"
[    2.204737] [drm] [nvidia-drm] [GPU ID 0x00000002] Loading driver
[    2.204739] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:00:02.0 on minor 0

[    0.847082] pci 0000:00:02.0: vgaarb: setting as boot VGA device
[    0.847082] pci 0000:00:02.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[    1.968329] nvidia 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem