Can't use nvidia driver , error "No screens found".

I tried a lot of things but i can't get the nvidia driver working with my Geforce RTX 2060 card.

Here i post my configuration:

pkg info | grep nvidia
nvidia-driver-570.169.1402000 NVidia graphics card binary drivers for hardware OpenGL rendering
nvidia-drm-61-kmod-570.169.1402000_2 NVIDIA DRM Kernel Module
nvidia-drm-kmod-570.169 NVIDIA DRM Kernel Module
nvidia-settings-570.169 Display Control Panel for X NVidia driver
nvidia-xconfig-570.169 Tool to manipulate X configuration files for the NVidia driver

cat loader.conf
vfs.root.mountfrom=ufs:/dev/ada0p1
nvidia_load="YES"
nvidia-drm_load="YES"

sysctl.conf is empty

cat rc.conf
ifconfig_em0="DHCP"
ifconfig_em0_ipv6="inet6 accept_rtadv"
rtsold_enable="YES"
keymap="be.acc.kbd"
keyrate="fast"
kld_list="nvidia-modeset"
linux_enable="YES"

cat xorg.conf
Section "Device"
Identifier "Card0"
#Option "AccelMethod" "EXA"
BusID "PC:1:0:0"
#Screen 0
#Driver "nvidia"
EndSection

With this configuration the framebuffer driver is used an only one screen is seen of my two monitors.

When i enable the line Driver "nvidia" , startx bails out with an error of "No screen found". No usefull information is logged.



Any advice hints tips are welcome
 
Remove the nvidia lines from /boot/loader.conf as the driver will be loaded by the lines in rc.conf. I think also there is a conflict between nvidia-modeset and the old way of using the driver (your settings in loader.conf). They cannot both be enabled at the same time.
 
Some appendix.
Loader allocates a limited amount of memories to load kernel AND kernel modules (and their dependencies which are auto-loaded) specified in /boot/loader.conf BEFORE KERNEL STARTS RUNNING.

As the amount is NOT enouch for loading multiple large modules like zfs.ko and GPU drivers including nvidia.ko, drm.ko and so on.

So kernel modules that are loaded via /boot/loader.conf should be limited to anything mandatory to boot FreeBSD (more precisely, kernel modules which are mandatory to mount root filesystem).
 
I performed your suggestion, but the problem still remains.
As you've installed graphics/nvidia-drm-61-kmod, what should be specified in kld_list variable of /etc/rc.conf is nvidia-drm. It should auto-load /boot/modules/nvidia-modeset.ko and /boot/modules/nvidia.ko as dependencies (and some more, DRM related).

And make sure you add hw.nvidiadrm.modeset=1 in your /boot/loader.conf.
As this variable needs to be set BEFORE /boot/modules/nvidia-drm.ko is loaded, so /etc/sysctl.conf could be too late (possibly racy).

And delete or rename xorg.conf. Basically, xorg driver of graphics/nvidia-drm-*-kmod should be automatically recognized by xorg-server, in contrast with ones of x11/nvidia-driver.
 
According to your listing you have installed the drm-kmod for 14.2, but maybe you already run 14.3?
I run indeed 14.3 , maybe i should compile from source. Could you guide me ?
I don't know which port, but i know make config , make , make install.
 
Forgot to mention.
You can read pkg-message by pkg info -D <pkg-name> for installed pkgs/ports like pkg info -D nvidia-drm-61-kmod if you missed reading on installation. And you can read usages with pkg help info.
 
I run indeed 14.3 , maybe i should compile from source. Could you guide me ?
I don't know which port, but i know make config , make , make install.
On 14.3, /etc/pkg/FreeBSD.conf has an entry for kmod ports.
Try pkg upgrade -r FreeBSD-kmods first.
If any problem happenes, you'll need to obtain ports tree and src tree to build via ports. There are several ways which has PROs and CONs each other.
 
What i did :
I added to loader.conf hw.nvidiadrm.modeset=1
-pkg upgrade -r FreeBSD-kmods , no updates
-rebuild nvidia-kmod from ports
-Changed rc.conf to kld_list="nvidia-drm"
The problem still remains. I'm out of ideas.
 
I run indeed 14.3 , maybe i should compile from source.
You could do that, but there is no need for that.
Just get your packages/ports tree up to date, and install the 14.3 drm-kmod.
I recently upgraded from 14.1 to 14.3 (yes, I missed/skipped/forgot 14.2), and my #1 concern about this upgrade was the X server wasn't running anymore after the update, and I had to install the drm-kmod from ports, but there was no need for that.
Clean freebsd-update to 14.3, clean update of the packages (I pulled a new ports tree anyway) - voilá, job done within ~1h, X runs, system runs 14.3, all packages updated - perfect.
Ah, yes, I almost forogt: I also run a NVidia card.
 
vgapci1@pci0:0:2:0: class=0x038000 rev=0x0c hdr=0x00 vendor=0x8086 device=0x
4682 subvendor=0x1462 subdevice=0xb930
vendor = 'Intel Corporation'
device = 'Alder Lake-S GT1 [UHD Graphics 730]'
class = display

vgapci0@pci0:1:0:0: class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x1f03 subvendor=0x1462 subdevice=0xc757
vendor = 'NVIDIA Corporation'
device = 'TU106 [GeForce RTX 2060 12GB]'
class = display
subclass = VGA

I must have a look to the firmware config

currently i'm doing a
-pkg update -f
-pkg upgrade -f
 
I tried a lot of things but i can't get the nvidia driver working with my Geforce RTX 2060 card.

Here i post my configuration:

pkg info | grep nvidia
nvidia-driver-570.169.1402000 NVidia graphics card binary drivers for hardware OpenGL rendering
nvidia-drm-61-kmod-570.169.1402000_2 NVIDIA DRM Kernel Module
nvidia-drm-kmod-570.169 NVIDIA DRM Kernel Module
nvidia-settings-570.169 Display Control Panel for X NVidia driver
nvidia-xconfig-570.169 Tool to manipulate X configuration files for the NVidia driver

cat loader.conf
vfs.root.mountfrom=ufs:/dev/ada0p1
nvidia_load="YES"
nvidia-drm_load="YES"

sysctl.conf is empty

cat rc.conf
kld_list="nvidia-modeset"


cat xorg.conf
Section "Device"
Identifier "Card0"
#Option "AccelMethod" "EXA"
BusID "PC:1:0:0"
#Screen 0
#Driver "nvidia"
EndSection

With this configuration the framebuffer driver is used an only one screen is seen of my two monitors.

When i enable the line Driver "nvidia" , startx bails out with an error of "No screen found". No usefull information is logged.



Any advice hints tips are welcome

A shot in the dark here:
  • If you are still using an xorg.conf file, I believe your BusID specification is missing an "I"; i.e.:
    BusID "PC:1:0:0"
    should become:
    BusID "PCI:1:0:0"
    (but FWIW in my config, I have the BusID line commented-out -- I think the nvidia driver auto-configures that if not specified)
  • You probably already solved the kmod kernel version mismatch by installing nvidia packages from ports, but to be clear, if pkg info still shows "nvidia-driver-570.169.1402000", the "1402" part means that the kernel module was compiled for a 14.2 kernel (not 14.3 like you are apparently running).
  • You should be able to determine if the nvidia driver loaded by checking "kldstat" and seeing if nvidia.ko is in the list, you'll probably see one of nvidia-drm.ko or nvidia-modeset.ko as well.
  • If you want your Section "Device" entry to use/load the nvidia accelerated driver, you would need to un-comment the line containing:
    Driver "nvidia"
    (I'm guessing you commented that out while you had the wrong kmod version installed in order to get Xorg to start at all; but if you retry that now, it might make a difference)
  • I believe T-Aoki's suggestion to try no xorg.conf is excellent, at least once your kmod/kernel version mismatch is solved, assuming there is at least one display connected to one of your RTX2060's outputs.
  • If the display connected to your RTX2060 goes black when you start X, it might be that Xorg is selecting your Intel iGPU as the "primary" -- if so, you might be able to tell Xorg to make the NVidia primary by adding:
    Option "PrimaryGPU" "yes"
    to your Section "Device" where you have Driver "nvidia", but there is a chance PrimaryGPU might apply only to Optimus Prime hardware configs.
If you're still having problems, might help if we could see your /var/log/Xorg.0.log
 
The log does not show nothing except, No screens found.
The only thing i can think about the driver is broken for my specific card.
Linux nouveau works fine bye the way.
 
One way to fix "No screens found" is to create xorg.conf file which uses vesa driver. If you are into tty (command prompt), run


Xorg :1 -configure


It makes a /root/xorg.conf.new file, so modify that file replacing driver line(s) as


Driver "vesa"


Use your favorite editor for editing (nano, vi, ...)

When you have edited /root/xorg.conf.new file, copy that file to /etc/X11 folder.


cp /root/xorg.conf.new /etc/X11/xorg.conf


Install also xinit and packages


pkg install xinit twm


Reboot and see what happens

You should get desktop on, and if not, run


startx


... or


startx mate-session ## if you use mate desktop
 
The problem is
-Driver "vesa" does not work
-Driver "nvidia" does not work
Only no Driver line works. But only with one monitor.
 
One way to fix "No screens found" is to create xorg.conf file which uses vesa driver. If you are into tty (command prompt), run


Xorg :1 -configure


It makes a /root/xorg.conf.new file, so modify that file replacing driver line(s) as


Driver "vesa"


Use your favorite editor for editing (nano, vi, ...)

When you have edited /root/xorg.conf.new file, copy that file to /etc/X11 folder.


cp /root/xorg.conf.new /etc/X11/xorg.conf


Install also xinit and packages


pkg install xinit twm


Reboot and see what happens

You should get desktop on, and if not, run


startx


... or


startx mate-session ## if you use mate desktop
Correct fallback for BIOS boots, but for UEFI boots, VESA driver won't work.
Need using x11-drivers/xf86-video-scfb instead.
 
Disconnect external monitor(s). Install inxi for knowing better your system and hardware.


pkg install inxi
inxi -MSGx
 
Have you read ashafer@'s document I've already linked on comment #12?
And sorry, I myself never tried PRIME, as I always purchase notebooks that can disable iGPU from firmware and internal LCD panel works for it.
 
Back
Top