API mismatch on starting xorg

Right, now X does load the NVidia driver. Which is good:
Code:
[    48.034] (II) NVIDIA dlloader X Driver  580.95.05  Tue Sep 23 09:33:06 UTC 2025
[    48.034] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
Code:
[    48.387] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the
[    48.387] (EE) NVIDIA:     system's kernel log for additional error messages and
[    48.387] (EE) NVIDIA:     consult the NVIDIA README for details.
[    48.387] (EE) No devices detected.
This seems to suggest the kernel module isn't loaded.

I would suggest forgetting about the DRM driver for now. Lets try and get this working with the 'traditional' NVidia driver first. Once we get that working we can have a look at the NVidia DRM drivers.

What's in /etc/rc.conf?
And what does kldstat output?
 
I've had similar problems in the past. I've always, so far, been able to solve it with using git to get ports to the latest, then running portmaster install nvidia-kmod which will pull in and/or update all the things needed.
 
Right, now X does load the NVidia driver. Which is good:
Code:
[    48.034] (II) NVIDIA dlloader X Driver  580.95.05  Tue Sep 23 09:33:06 UTC 2025
[    48.034] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
Code:
[    48.387] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the
[    48.387] (EE) NVIDIA:     system's kernel log for additional error messages and
[    48.387] (EE) NVIDIA:     consult the NVIDIA README for details.
[    48.387] (EE) No devices detected.
This seems to suggest the kernel module isn't loaded.

I would suggest forgetting about the DRM driver for now. Lets try and get this working with the 'traditional' NVidia driver first. Once we get that working we can have a look at the NVidia DRM drivers.

What's in /etc/rc.conf?
And what does kldstat output?
Kldstat output: termbin.com/rify
/etc/rc.conf: termbin.com/fcf9n
 
Kldstat output: termbin.com/rify
Code:
Id Refs Address                Size Name
 1   40 0xffffffff80200000  1f41458 kernel
 2    1 0xffffffff82143000   5e9340 zfs.ko
 3    1 0xffffffff8272d000     7808 cryptodev.ko
 4    1 0xffffffff83310000     4250 ichsmb.ko
 5    1 0xffffffff83315000     2178 smbus.ko
 6    1 0xffffffff83318000     3360 uhid.ko
 7    1 0xffffffff8331c000     4364 ums.ko
 8    1 0xffffffff83321000     3360 wmt.ko
 9    1 0xffffffff83325000     e017 if_rtwn_usb.ko
10    1 0xffffffff83334000    19140 rtwn.ko
The Nvidia kernel module isn't loaded.
/etc/rc.conf: termbin.com/fcf9n
Code:
kld_list="nvidia-modeset"
Ok, that's correct. For some reason it doesn't want to load that module.
Both output that the driver wasn’t found in the database
That indicates x11/nvidia-driver isn't installed. pkg install nvidia-driver
That also explains why the kernel module isn't being loaded, it wasn't installed.
 
Code:
Id Refs Address                Size Name
 1   40 0xffffffff80200000  1f41458 kernel
 2    1 0xffffffff82143000   5e9340 zfs.ko
 3    1 0xffffffff8272d000     7808 cryptodev.ko
 4    1 0xffffffff83310000     4250 ichsmb.ko
 5    1 0xffffffff83315000     2178 smbus.ko
 6    1 0xffffffff83318000     3360 uhid.ko
 7    1 0xffffffff8331c000     4364 ums.ko
 8    1 0xffffffff83321000     3360 wmt.ko
 9    1 0xffffffff83325000     e017 if_rtwn_usb.ko
10    1 0xffffffff83334000    19140 rtwn.ko
The Nvidia kernel module isn't loaded.

Code:
kld_list="nvidia-modeset"
Ok, that's correct. For some reason it doesn't want to load that module.

That indicates x11/nvidia-driver isn't installed. pkg install nvidia-driver
That also explains why the kernel module isn't being loaded, it wasn't installed.
But when i run pkg install nvidia-driver, it says: the most recent version of this package is already installed.
 
I am getting the same behavior, looking at the dmesg excerpt shows the driver loading attempt and the mismatch:
nvidia0: <NVIDIA GeForce GT 1030> on vgapci0
vgapci0: child nvidia0 requested pci_enable_io
vgapci0: child nvidia0 requested pci_enable_io
nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 580.105.08 Wed Oct 29 22:04:36 UTC 2025
...
NVRM: API mismatch: the client 'Xorg' (pid 2143)
NVRM: has the version 580.95.05, but this kernel module has
NVRM: the version 580.105.08. Please make sure that this
NVRM: kernel module and all NVIDIA driver components
NVRM: have the same version.
NVRM: API mismatch: the client 'Xorg' (pid 2143)
NVRM: has the version 580.95.05, but this kernel module has
NVRM: the version 580.105.08. Please make sure that this
NVRM: kernel module and all NVIDIA driver components
NVRM: have the same version.

Have done a pkg update and the latest are installed, see:
pkg info | grep nvidia

shows the mismatch between .95 and .105:
nvidia-driver-580.95.05 NVidia graphics card binary drivers for hardware OpenGL rendering
nvidia-kmod-580.105.08.1500068 kmod part of NVidia graphics card binary drivers for hardware OpenGL rendering

What is the best way to proceed in this situation?
 
Are you installing them with pkg?
If so, try deinstalling and install again with restricting repo.

For 15.0, there are 3 repos. One for pkgbase (FreeBSD-base), one for pkg from ports dedicated for kernel modules (FreeBSD-ports-kmods) and for pkg from ports all allowed ones including kernel modules (FreeBSD-ports).
pkg install -r FreeBSD-ports x11/nvidia-driver
could help.

While multiple minor releases are supported for single major release (i.e., 14.3 and 14.2 until the end of September), newer release needs kmods repo, but there can be risks of mis-matching versions, due to different build time on different builders.
Fortunately, all supported releases have single minor release for now, so the above can help.

But if you don't hesitate to keep /usr/src tree 100% in sync with instlled kernel and build kernel module ports (and strongly tied ports) locally, it would be the safest.
 
Thanks kindly for the reply. I installed from the FreeBSD-ports as suggested.

It appears that this new installation also contains "nvidia-driver-580.95.05", so the mismatch remains. Behavior of system is the same.

If I understand correctly, the nvidia-kmod is AHEAD of the nvidia-driver (both the base pkg and the ports pkg). So, a newer driver is needed.

I am not so knowledgeable on ports repositories. But, I would imagine that if I wait, and try
pkg install -r FreeBSD-ports x11/nvidia-driver
again. Then at some point a matching version 105 becomes available.

If there are better avenues to pursue, I'd be appreciative to learn of them.
 
Forgot to mention.

Ports tree is categorized into two.
One is main branch (aka latest branch) and others are quarterly branches.
Quarterly branches are created per-quarter, branching from main branch at the moment. Currently, 2025Q4.
Main branch is used to build latest branch of pkg, and currently 2025Q4 is used to build quarterly branch (default for *-RELEASE).

Once branched, "basically" quarterly branches are not intended to be upgraded. The exceptions are:
  • Security fixes
  • Build fixes
These are always allowed without explicit approval by SecTeam and PortmgrTeam. But if anyone want quarterly to be updated in other reasons, explicit approval is needed before committing.

For current state of nvidia driver ports, main branch has 580.105.08, while 2025Q4 has 580.95.05. No plan to update 2025Q4, as 580.105.08 doesn't state security fixes.
 
Thanks again! How do I grab the 105 package from the ports main branch?

Ahhhh.... please ignore the above. I now have found this at https://wiki.freebsd.org/Ports/QuarterlyBranch

How to switch from quarterly to latest​


On a system where /usr/local/etc/pkg/repos/FreeBSD.conf does not yet exist, with sh (not with csh/tcsh):

  1. mkdir -p /usr/local/etc/pkg/repos
  2. echo "FreeBSD { url = \"pkg+http://pkg.freebsd.org/\${ABI}/latest\"; }" > /usr/local/etc/pkg/repos/FreeBSD.conf
  3. pkg upgrade -f to install packages from latest (relatively time-consuming), or pkg update to update the catalogue alone.
Hint: if your system supports ZFS boot environments, create one before the upgrade.
 
Followed the "How to switch post" which created contents of this FreeBSD.conf:
FreeBSD { url = "pkg+http://pkg.freebsd.org/${ABI}/latest"; }

However, performing a "pkg upgrade -f" produces these error message:
pkg: packagesite URL error for pkg+http://pkg.freebsd.org/FreeBSD:15:amd64/latest/meta.conf -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+http://pkg.freebsd.org/FreeBSD:15:amd64/latest/meta.txz -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+http://pkg.freebsd.org/FreeBSD:15:amd64/latest/data.pkg -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+http://pkg.freebsd.org/FreeBSD:15:amd64/latest/data.tzst -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+http://pkg.freebsd.org/FreeBSD:15:amd64/latest/packagesite.pkg -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+http://pkg.freebsd.org/FreeBSD:15:amd64/latest/packagesite.tzst -- pkg+:// implies SRV mirror type

Feel lost on this one.
 
Thanks again! How do I grab the 105 package from the ports main branch?

Ahhhh.... please ignore the above. I now have found this at https://wiki.freebsd.org/Ports/QuarterlyBranch

How to switch from quarterly to latest​


On a system where /usr/local/etc/pkg/repos/FreeBSD.conf does not yet exist, with sh (not with csh/tcsh):

  1. mkdir -p /usr/local/etc/pkg/repos
  2. echo "FreeBSD { url = \"pkg+http://pkg.freebsd.org/\${ABI}/latest\"; }" > /usr/local/etc/pkg/repos/FreeBSD.conf
  3. pkg upgrade -f to install packages from latest (relatively time-consuming), or pkg update to update the catalogue alone.
Hint: if your system supports ZFS boot environments, create one before the upgrade.

This information in this wiki is incomplete.

Please post the output of
pkg -vv | sed -nE -e '/(OSVERSION|ABI|BACKUP)/ p' -e '/^Repositories:/,$ p'
 
It appears that removing the "pkg+" allows the pkg upgrade -f to run without errors. Am rebooting now to see what the X windows situation is.

Responding to Erichans message: I saw your message only after removing the pkg+ and running. At any rate, after doing that, the output of "sed ..." is:

IGNORE_OSVERSION = false;
BACKUP_LIBRARIES = false;
BACKUP_LIBRARY_PATH = "/usr/local/lib/compat/pkg";
ABI = "FreeBSD:15:amd64";
ALTABI = "freebsd:15:x86:64";
OSVERSION = "1500068";
Repositories:
FreeBSD-ports: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/quarterly",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
FreeBSD-ports-kmods: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/kmods_quarterly_0",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
FreeBSD-base: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/base_release_0",
enabled : no,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkgbase-15"
}
FreeBSD: {
url : "http://pkg.freebsd.org/FreeBSD:15:amd64/latest",
enabled : yes,
priority : 0
}
 
Responding to Erichans message
You are using FreeBSD 15.0-RELEASE.

There are several things clearly wrong with your pkg configuration settings.

First I'd like to know what your preference is: quarterly or latest packages?
I think your Nvidia graphics will be able to work either way.

Are you using Xorg or anything like Wayland (no experience with the latter).
 
Hej, thanks I appreciate the help here. I believe that there is indeed probably wrong with my settings. I am just not sure what it is (nor how to fix it).

I prefer stability, and do not need to be on the bleeding edge. BUT, I really desire to get xfce working for the desktop on the newly install FreeBSD 15.

Using Xorg.
 
Quick summary of the solution to anyone finding this thread in the future.

I received guidance on how to downgrade version .105 kmods to version .95 (to agree with the version .95 of the nvidia-driver).

Doing so removed the version mismatch, and the system with X windows booted normally.
 
I've contacted almostblue and helped to solve the problem; below the pkg commands used to resolve the mismatch.

The 15.0-RELEASE configurations have been restored to use quarterly. The mismatch that occurred on quarterly between offending drivers has been resolved by a force install of the correctly versioned package.

To get an overview of relevant available packages, you can use:
pkg rquery -x '%n [%R] %v' '^drm-(510-|515-|61-|66-)?kmod|(^nvidia-(d|k))' | sed -En '/^[^ ]+-devel/d;p'| column -t
(Development versions are filtered out.)

Starting from the mismatch situation as happened using quarterly, below is a possible way to correct the situation, and the resulting overview of installed drivers:
Rich (BB code):
[10-0] # pkg query -x '%n [%R] %v' '^drm-(510-|515-|61-|66-)?kmod|(^nvidia-(d|k))' | column -t | nl
     1  drm-66-kmod    [FreeBSD-ports]        6.6.25.1500068_6
     2  drm-kmod       [FreeBSD-ports]        20250428
     3  nvidia-driver  [FreeBSD-ports]        580.95.05
     4  nvidia-kmod    [FreeBSD-ports-kmods]  580.105.08.1500068
[11-0] # pkg install -f -r FreeBSD-ports nvidia-kmod
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
FreeBSD-ports is up to date.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be DOWNGRADED:
        nvidia-kmod: 580.105.08.1500068 -> 580.95.05.1500068 [FreeBSD-ports]

Number of packages to be downgraded: 1

151 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching nvidia-kmod-580.95.05.1500068~7d26c97025.pkg: 100%  151 MiB  26.4MB/s    00:06
Checking integrity... done (0 conflicting)
[1/1] Downgrading nvidia-kmod from 580.105.08.1500068 to 580.95.05.1500068...
[1/1] Extracting nvidia-kmod-580.95.05.1500068: 100%
[12-0] # pkg query -x '%n [%R] %v' '^drm-(510-|515-|61-|66-)?kmod|(^nvidia-(d|k))' | column -t | nl
     1  drm-66-kmod    [FreeBSD-ports]  6.6.25.1500068_6
     2  drm-kmod       [FreeBSD-ports]  20250428
     3  nvidia-driver  [FreeBSD-ports]  580.95.05
     4  nvidia-kmod    [FreeBSD-ports]  580.95.05.1500068
[13-0] #

Alternatively, similar results can be achieved by building nvidia-driver from source, as has been mentioned. In that case, you'll probably get version 580.105.08
 
Back
Top