API mismatch on starting xorg

I just intalled FreeBSD in a PC with a nvidia geForce GTX 1060 GPU. I’m trying to install xorg on it, I downloaded nvidia-driver from pkg and followed this video:
View: https://youtu.be/FUs7Or_Uxn8?si=J5DBdAnEDC4L1ILQ


But when I try to run startx, it displays a weird API mismatch error, the complete output is:
Code:
Current
Operating
System: FreeBSD rauls. notebook 14.3-RELEASE FreeBSD 14.3-RELEASE re
leng/14.3-n271432-8c9ce319fef7 GENERIC amd64
Current version of pixman: 0.46.2
Before reporting problems, check http://wikl.x.org to make sure that you have the latest version
Markers:
(--) probed, (**) from config file, (==) default setting.
(++) from command line,
(!!) notice, (Il) informational.
(WW) warning.
(EE) error,
(NI) not implemented. (??) unknown.
(==) Log file:
Using config file: “/etc/X11/xorg.conf”
(==)
Using config file:
Time: Mon Bec
1 09:13:01 2025
(ニニ)
Using system config directory
/usr/local/share/X11/xorg.conf.d"
NVRM: API mismatch: the client
Xorg' (pid 1561)
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.
(EE )
Fatal
server error:
(EE) no screens found(EE)
(EE )
Please consult the The X.Org Foundation support
at http://w1k1.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.
xinit: giving up
xinit: unable to connect to X server: Connection refused xinit: server error raulmesqui ta@rauls:" $
 
Skipped the video. Don't want to watch a 10 minute video for something I can write down in a couple of sentences.

Code:
pkg install nvidia-driver
sysrc kld_list+="nvidia-modeset"
cat <<EOF > /usr/local/etc/X11/xorg.conf.d/nvidia-driver.conf
Section "Device"
  Identifier "Nvidia"
  Driver "nvidia"
EndSection
EOF
 
These version numbers are not the same; they need to be the same.

Please post the ouput of
pkg query -x '[%R] %o %n %v' '^drm-(510-|515-|61-|66-)?kmod|(^nvidia-)' | column -t
Usage: pkg query <query-format> <pkg-name>
Pkg query [-a] <query-format>
Pkg query -F <pkg-name> <query-format>
Pkg query -e <evaluation> <query-format>
Pkg query [-Cgix] <query-format> <pattern> <…>
 
Skipped the video. Don't want to watch a 10 minute video for something I can write down in a couple of sentences.

Code:
pkg install nvidia-driver
sysrc kld_list+="nvidia-modeset"
cat <<EOF > /usr/local/etc/X11/xorg.conf.d/nvidia-driver.conf
Section "Device"
  Identifier "Nvidia"
  Driver "nvidia"
EndSection
EOF
I did these exact steps right now, rebooted and still got the same result
 
cat /var/log/Xorg.0.log | nc termbin.com 9999 and post the URL here.
 
Should I have used the %R out of the brackets?
You should have gotten something like (the square brackects "[" and "]" are not essential):
Rich (BB code):
[1-0] # pkg query -x '[%R] %o %n %v' '^drm-(510-|515-|61-|66-)?kmod|(^nvidia-)' | column -t
[FreeBSD]        graphics/drm-61-kmod         drm-61-kmod         6.1.128.1403000_7
[FreeBSD]        graphics/drm-kmod            drm-kmod            20250428
[FreeBSD]        x11/nvidia-driver            nvidia-driver       580.95.05
[FreeBSD]        graphics/nvidia-drm-61-kmod  nvidia-drm-61-kmod  580.105.08.1403000
[FreeBSD-kmods]  x11/nvidia-kmod              nvidia-kmod         580.105.08.1403000
At least that was what I was expecting.

What do you get when you exactly give this command?
 
You should have gotten something like (the square brackects "[" and "]" are not essential):
Rich (BB code):
[1-0] # pkg query -x '[%R] %o %n %v' '^drm-(510-|515-|61-|66-)?kmod|(^nvidia-)' | column -t
[FreeBSD]        graphics/drm-61-kmod         drm-61-kmod         6.1.128.1403000_7
[FreeBSD]        graphics/drm-kmod            drm-kmod            20250428
[FreeBSD]        x11/nvidia-driver            nvidia-driver       580.95.05
[FreeBSD]        graphics/nvidia-drm-61-kmod  nvidia-drm-61-kmod  580.105.08.1403000
[FreeBSD-kmods]  x11/nvidia-kmod              nvidia-kmod         580.105.08.1403000
At least that was what I was expecting.

What do you get when you exactly give this command?
[FreeBSD] x11/nvidia-driver nvidia-driver 580.95.05
[FreeBSD-kmods] x11/nvidia-kmod nvidia-kmod 580.105.08.1403000
[FreeBSD] x11/nvidia-xconfig nvidia-xconfig 580.95.05
 
[FreeBSD] x11/nvidia-driver nvidia-driver 580.95.05
[FreeBSD-kmods] x11/nvidia-kmod nvidia-kmod 580.105.08.1403000
[FreeBSD] x11/nvidia-xconfig nvidia-xconfig 580.95.05
These need to be the same version.

Starting from your situation (command "[7-0]") with the bad combination, follow these commands:
Rich (BB code):
[7-0] # pkg query -x '[%R] %o %n %v' '^drm-(510-|515-|61-|66-)?kmod|(^nvidia-)' | column -t
[FreeBSD]        graphics/drm-61-kmod  drm-61-kmod    6.1.128.1403000_7
[FreeBSD]        graphics/drm-kmod     drm-kmod       20250428
[FreeBSD]        x11/nvidia-driver     nvidia-driver  580.95.05
[FreeBSD-kmods]  x11/nvidia-kmod       nvidia-kmod    580.105.08.1403000
[8-0] # pkg install -f -r FreeBSD nvidia-kmod
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
FreeBSD 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.1403000 -> 580.95.05.1403000 [FreeBSD]

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.1403000~f95db82ff5.pkg: 100%  151 MiB  19.8MB/s    00:08
Checking integrity... done (0 conflicting)
[1/1] Downgrading nvidia-kmod from 580.105.08.1403000 to 580.95.05.1403000...
[1/1] Extracting nvidia-kmod-580.95.05.1403000: 100%
[9-0] # pkg query -x '[%R] %o %n %v' '^drm-(510-|515-|61-|66-)?kmod|(^nvidia-)' | column -t
[FreeBSD]  graphics/drm-61-kmod  drm-61-kmod    6.1.128.1403000_7
[FreeBSD]  graphics/drm-kmod     drm-kmod       20250428
[FreeBSD]  x11/nvidia-driver     nvidia-driver  580.95.05
[FreeBSD]  x11/nvidia-kmod       nvidia-kmod    580.95.05.1403000
You should now have the same versions as listed in the output of my last command ("[9-0]")
 
Aren't you mangling latest and quarterly between FreeBSD repo and FreeBSD-kmods repo? 580.105.08 is available only on latest (aka main) branch.

Fortunately, at present (Dec.1, 2025 JST), no supported major releases have multiple supported minor version. So adding -r FreeBSD in your command line of pkg would help until upcoming 14.4 is released.
 
Aren't you mangling latest and quarterly between FreeBSD repo and FreeBSD-kmods repo? 580.105.08 is available only on latest (aka main) branch.
I have this wrt to 14.3-R and quarterly:
Code:
[10-0] # pkg -vv | sed -nE -e '/^OSVERSION|^ABI/ p' -e '/^Repositories:/,$ p'
ABI = "FreeBSD:14:amd64";
OSVERSION = "1403000";
Repositories:
  FreeBSD: {
    url             : "pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  FreeBSD-kmods: {
    url             : "pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_quarterly_3",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
[11-0] # pkg rquery -x '[%R] %o %n %v' '^drm-(510-|515-|61-|66-)?kmod|(^nvidia-)' | column -t
[FreeBSD]        graphics/drm-515-kmod               drm-515-kmod               5.15.160.1403000_6
[FreeBSD]        graphics/drm-61-kmod                drm-61-kmod                6.1.128.1403000_6
[FreeBSD]        graphics/drm-kmod                   drm-kmod                   20250428
[FreeBSD]        x11/nvidia-driver                   nvidia-driver              580.95.05
[FreeBSD]        x11/nvidia-driver-304               nvidia-driver-304          304.137_11
[FreeBSD]        x11/nvidia-driver-340               nvidia-driver-340          340.108_5
[FreeBSD]        x11/nvidia-driver-390               nvidia-driver-390          390.157_1
[FreeBSD]        x11/nvidia-driver-470               nvidia-driver-470          470.256.02_2
[FreeBSD]        x11/nvidia-driver-devel             nvidia-driver-devel        580.95.05
[FreeBSD]        graphics/nvidia-drm-515-kmod        nvidia-drm-515-kmod        580.95.05.1403000
[FreeBSD]        graphics/nvidia-drm-515-kmod-devel  nvidia-drm-515-kmod-devel  580.95.05.1403000
[FreeBSD]        graphics/nvidia-drm-61-kmod         nvidia-drm-61-kmod         580.95.05.1403000
[FreeBSD]        graphics/nvidia-drm-61-kmod-devel   nvidia-drm-61-kmod-devel   580.95.05.1403000
[FreeBSD]        graphics/nvidia-drm-kmod            nvidia-drm-kmod            580.95.05_1
[FreeBSD]        graphics/nvidia-drm-kmod-devel      nvidia-drm-kmod-devel      580.95.05_1
[FreeBSD]        x11/nvidia-kmod                     nvidia-kmod                580.95.05.1403000
[FreeBSD]        x11/nvidia-kmod-304                 nvidia-kmod-304            304.137.1403000
[FreeBSD]        x11/nvidia-kmod-340                 nvidia-kmod-340            340.108.1403000
[FreeBSD]        x11/nvidia-kmod-390                 nvidia-kmod-390            390.157.1403000
[FreeBSD]        x11/nvidia-kmod-470                 nvidia-kmod-470            470.256.02.1403000
[FreeBSD]        x11/nvidia-kmod-devel               nvidia-kmod-devel          580.95.05.1403000
[FreeBSD]        x11/nvidia-settings                 nvidia-settings            580.95.05
[FreeBSD]        graphics/nvidia-texture-tools       nvidia-texture-tools       2.1.2
[FreeBSD]        x11/nvidia-xconfig                  nvidia-xconfig             580.95.05
[FreeBSD-kmods]  graphics/drm-515-kmod               drm-515-kmod               5.15.160.1403000_8
[FreeBSD-kmods]  graphics/drm-61-kmod                drm-61-kmod                6.1.128.1403000_7
[FreeBSD-kmods]  x11/nvidia-kmod                     nvidia-kmod                580.105.08.1403000

That is, my output still has:
Rich (BB code):
[FreeBSD]        x11/nvidia-driver                   nvidia-driver              580.95.05
[FreeBSD-kmods]  x11/nvidia-kmod                     nvidia-kmod                580.105.08.1403000
 
When i try the pkg install command it says pkg: cached package nvidia-kmod-580.95.05.1403000: missing or size mismatch, cannot continue
Consider running ‘pkg update -f’
 
Strange.
x11/nvidia-kmod picks which version to use from x11/nvidia-driver/Makefile.version to be 100% sure to match with x11/nvidia-driver.

The linked one is for 2025Q4 on Codeberg mirror (currently official cgit is unstable, maybe due to too excessive accesses by crawlers).

This (too advanced version on kmods repo with regard to Makefile.version) specific case can happen:
  • Missingly configured kmod repo (url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_latest_${VERSION_MINOR}", instead of url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}",) on the affected computer, or
  • Official builders for FreeBSD-kmods repo (independent from main pkg builders) are somehow mis-configured with ports tree to use.
 
When i try the pkg install command it says pkg: cached package nvidia-kmod-580.95.05.1403000: missing or size mismatch, cannot continue
Consider running ‘pkg update -f’
If the downloading of affected pkg is somehow interrupted on whichever of sides, downloaded pkg should be broken and the error happenes.

All pkgs downloaded from official repo should be in /var/cache/pkg/ (or under All/ subdir under it) by default.

So you can try deleting broken ones as root and retry.
 
I'm not sure what that means; please post the exact command and its complete output.
I ran: pkg -f -r FreeBSD nvidia-kmod

And it asked to downgrade the package, i typed ‘y’, the it repeated the same lines of download, saying it was at 0% and that it would take approximately 1-3 hours or says ‘-stalled-‘, until it just stopped and showed the missing or size mismatch error
 
And it asked to downgrade the package, i typed ‘y’, the it repeated the same lines of download, saying it was at 0% and that it would take approximately 1-3 hours or says ‘-stalled-‘, until it just stopped and showed the missing or size mismatch error
Seems you (still) may have internet problems; I'm not sure how to proceed with that; SirDice, T-Aoki and others know a lot more.
 
Seems you (still) may have internet problems; I'm not sure how to proceed with that; SirDice, T-Aoki and others know a lot more.
Likely. But too many to be considerable and hard to determine here.
  • Too heavy loaded official repo.
  • Too heavy traffic on network route the packet comes and goes through.
  • Problem in whichever of ISP side or local side of network interface.
  • Mis-behaving router (regardless the position in the network).
  • Mis-configuration of local network interface.
And would be more.
 
Likely. But too many to be considerable and hard to determine here.
  • Too heavy loaded official repo.
  • Too heavy traffic on network route the packet comes and goes through.
  • Problem in whichever of ISP side or local side of network interface.
  • Mis-behaving router (regardless the position in the network).
  • Mis-configuration of local network interface.
And would be more.
Do you have any idea on how to troubleshoot and/or fix this?
 
Back
Top