Bug 287069 - FreeBSD-14.3-BETA4 loading i915 kernel module fails
Summary: FreeBSD-14.3-BETA4 loading i915 kernel module fails
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 14.3-STABLE
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
: 287489 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-05-25 16:54 UTC by Juan
Modified: 2025-07-14 08:29 UTC (History)
9 users (show)

See Also:


Attachments
/var/log/messages (49.08 KB, text/plain)
2025-05-25 16:54 UTC, Juan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juan 2025-05-25 16:54:56 UTC
Created attachment 260707 [details]
/var/log/messages

After a fresh install from a FreeBSD-14.3-BETA4-amd64-memstick.img,
loading the i915 module results in:

May 25 01:38:59 kiwi kernel: link_elf_obj: symbol linux_kfree_async undefined
May 25 01:38:59 kiwi kernel: linker_load_file: /boot/modules/dmabuf.ko - unsupported file type
May 25 01:38:59 kiwi kernel: KLD drm.ko: depends on dmabuf - not available or version mismatch
May 25 01:38:59 kiwi kernel: linker_load_file: /boot/modules/drm.ko - unsupported file type
May 25 01:38:59 kiwi kernel: KLD i915kms.ko: depends on drmn - not available or version mismatch
May 25 01:38:59 kiwi kernel: linker_load_file: /boot/modules/i915kms.ko - unsupported file type
Comment 1 Marek Zarychta 2025-05-25 17:27:28 UTC
Please try adding the repository for 14.3, it should solve the issue
https://lists.freebsd.org/archives/freebsd-stable/2025-May/002830.html
Comment 2 Juan 2025-05-25 19:10:40 UTC
Added: 

FreeBSD-kmods: {
	url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_latest",
	mirror_type: "srv",
	signature_type: "fingerprints",
	fingerprints: "/usr/share/keys/pkg",
	enabled: yes
}

to /usr/local/etc/pkg/repos/kmods.conf, then:

   # pkg update
   # pkg upgrade

no updated packages were reported, so:

   # pkg remove drm_kmod
   # pkg autoremove
   # pkg install drm_kmod
   # kldins i915kms

same message...
Comment 3 Eric 2025-06-03 16:22:06 UTC
(In reply to Juan from comment #2)

You'll likely need:
[1-0] # pkg query -x  '[%R]\t(%a)  %n %v' '^drm(-|-515-|-61-)kmod'
[FreeBSD-kmods] (1)  drm-61-kmod 6.1.128.1403501_4
[FreeBSD]       (0)  drm-kmod 20250428
[2-0] #

In my experience, using both 
- FreeBSD
- FreeBSD-kmods

a two-step upgrade process works:
# pkg upgrade -r FreeBSD
# pkg upgrade -r FreeBSD-kmods

Your specific steps used could be modified as:
# pkg install drm-kmod
# pkg upgrade -r FreeBSD-kmods

See also:
https://forums.freebsd.org/threads/possible-solution-to-the-drm-kmod-kernel-mismatch-after-upgrade-from-bapt.96058/page-2#post-684836
https://forums.freebsd.org/threads/possible-solution-to-the-drm-kmod-kernel-mismatch-after-upgrade-from-bapt.96058/page-2#post-684777
Comment 4 Eric 2025-06-03 16:35:08 UTC
(In reply to Eric from comment #3)

When having advanced to 14.3-RC1, that'll likely be:
[FreeBSD-kmods] drm-61-kmod-6.1.128.1403000_4

For the FreeBSD-kmods repository you may need to switch to using:
url: pkg+https://pkg.freebsd.org/${ABI}/kmods_latest_${VERSION_MINOR},
Comment 5 Graham Perrin 2025-06-08 07:54:25 UTC
(In reply to Marek Zarychta from comment #1)

Addition is no longer necessary, the FreeBSD-kmods repository is present in 14.3-RELEASE.

<https://github.com/freebsd/freebsd-src/commit/a47542f7151160cb2d9606b4eb91d7d3fb555e92>
Comment 6 Doug White 2025-06-10 03:23:18 UTC
bz@ changed linuxkpi in this commit, staticizing linux_kfree_async:

https://cgit.freebsd.org/src/commit/sys/compat/linuxkpi/common/src/linux_slab.c?h=stable/14&id=ebe210ca703bd584274396b2c0fa1694750f05c1

Anything using the LinuxKPI slab allocator will need to be rebuilt for 14.3. This includes out-of-tree graphics drivers like nvidia.
Comment 7 Paul Ivanov 2025-06-12 08:36:15 UTC
(In reply to Eric from comment #3)
> Your specific steps used could be modified as:
> # pkg install drm-kmod
> # pkg upgrade -r FreeBSD-kmods

Thank you, Eric, this did the trick for me on a recently upgraded 14.2 -> 14.3 machine that had been spitting out 

link_elf_obj: symbol linux_kfree_async undefined
linker_load_file: /boot/modules/dmabuf.ko - unsupported file type
KLD drm.ko: depends on dmabuf - not available or version mismatch
linker_load_file: /boot/modules/drm.ko - unsupported file type
KLD i915kms.ko: depends on drmn - not available or version mismatch
linker_load_file: /boot/modules/i915kms.ko - unsupported file type

when trying to load i915kms, now I'm back in business and, for example, backlight works again.
Comment 8 Pavneet Arora 2025-06-13 17:01:17 UTC
And for me, as I suffered the same error this morning on one of may laptops also in upgrading from 14.2 to 14.3.

Curiously, the other laptop did exhibit the same symptoms even though they are identical models of a similar vintage:

$ pkg query -x  '[%R]\t(%a)  %n %v' '^drm(-|-515-|-61-)kmod'
[FreeBSD-kmods] (0)  drm-515-kmod 5.15.160.1403000_4
Comment 9 Graham Perrin 2025-06-15 07:05:53 UTC
From bug 287489 comment 4: 

> This is a documentation issue. 

The same for this bug 287069: documentation (not Base System). 

The requirement to specify a repository was noted a few months ago, 

<https://lists.freebsd.org/archives/freebsd-ports/2024-December/007016.html>
Comment 10 Graham Perrin 2025-06-15 07:20:17 UTC
See also: bug 283755.
Comment 11 Juan 2025-06-16 20:15:11 UTC
(In reply to Graham Perrin from comment #5)

After a fresh install of FreeBSD 14.3-RELEASE

   /usr/local/etc/pkg/repos/kmods.conf

is no longer required (as stated by Graham, FreeBSD-kmods is already included).

However, running:

   pkg upgrade -r FreeBSD-kmods 

is still required (as suggested by Eric).

Thanks to you all.
Comment 12 Mark Linimon freebsd_committer freebsd_triage 2025-06-17 14:14:35 UTC
(In reply to Juan from comment #11)
So, can this PR be closed?
Comment 13 Graham Perrin 2025-06-17 18:40:08 UTC
Re: comment 9

There's no mention of FreeBSD-kmods at <https://docs.freebsd.org/en/books/faq/> or in the FreeBSD Handbook.
Comment 14 Bjoern A. Zeeb freebsd_committer freebsd_triage 2025-06-18 06:59:47 UTC
(In reply to Graham Perrin from comment #13)

And likely not the release notes for 14.3 either?
Comment 15 Graham Perrin 2025-06-18 07:33:44 UTC
(In reply to Graham Perrin from comment #9)

> The requirement to specify a repository was noted a few months ago, 
> 
> <https://lists.freebsd.org/archives/freebsd-ports/2024-December/007016.html>

In that case, <https://gist.github.com/grahamperrin/0bfcd7bbc162e92d9b2176bcdf4f888b> involved installation of the meta package: 

    drm-kmod

----

Note that where the FreeBSD-kmods repo is used, 
the --repository option (-r) is _not always_ required. 

In the screenshot at <https://imgur.com/WL9sAwo> there's attention to a packaged kernel module – not to be confused with the meta package. Note that two versions of the package are found. In this case, installing 

    drm-61-kmod

_does_ install the appropriate version from the FreeBSD-kmods repo, without specifying the repo. Discussion: 

* <https://www.reddit.com/r/freebsd/comments/1ldqocy/comment/myemi60/?context=2>. 

For documentation purposes, <https://docs.freebsd.org/en/books/faq/> should have a question with an answer like the one below. 

----

FreeBSD 14.3-RELEASE is preconfigured to use a FreeBSD-kmods repository. This repo provides packages for many commonly required kernel modules that are non-base – not integral to FreeBSD. The command below should ensure that available packages are used: 

pkg upgrade --repository FreeBSD-kmods
Comment 16 Graham Perrin 2025-06-18 09:12:55 UTC
(In reply to Bjoern A. Zeeb from comment #14)

<https://www.freebsd.org/releases/14.3R/relnotes/#ports> noted the readiness to use a new FreeBSD-kmods repository, without detailing the ways in which it might be used. 

That level of detail, not delving into use cases, was wise. The pre-configuration was late in the release cycle (release candidate, not beta).
Comment 17 Graham Perrin 2025-06-20 18:38:56 UTC
Re: comment 13

> … or in the FreeBSD Handbook.

See also: bug 287662
Comment 18 Juan 2025-06-24 03:09:00 UTC
So it seems that integration of FreeBSD-kmods management instructions is already underway.

The corresponding update to:

https://docs.freebsd.org/en/books/handbook/x11/#x-configuration-intel

may be in place as well.
Comment 19 Mark Linimon freebsd_committer freebsd_triage 2025-07-04 08:59:17 UTC
*** Bug 287489 has been marked as a duplicate of this bug. ***