Kernel modules conflict

Hello lovely community. This happened after I switched ports tree to Q4. I managed to upgrade all ports with portmaster (except devel/appstream which ran into some hiccups), but I decapitated my working plasma desktop, because amdgpu.ko won't load by any means. Boot-time message says:
KLD amdgpu.ko: depends on kernel - not available or version mismatch
When I run
Code:
# kldload amdgpu
kldload: can't load amdgpu: module already loaded or in the kernel
Code:
#freebsd-version -kru
15.1-RELEASE-p4
15.1-RELEASE-p4
15.1-RELEASE-p4

How do I get out of this mess and avoid this happening in the future? I'm no FreeBSD expert but I'm good at following instructions.
 
Please post the output of:
pkg -vv | sed -nE -e '/(^OSVERSION|^ABI)/ p' -e '/^Repositories:/,$ p'
pkg query -x '[%R] %o %n %v' '^drm-(51.-|6..?-)?kmod|(^nvidia-(d|k))'
 

Attachments

  • terminal_output1.jpg
    terminal_output1.jpg
    238.6 KB · Views: 16
I apologize for using a screenshot, but I have no gui to copy/paste and it would take me rest of the day to type it all in.
 
No worries.

I have on 15.1-RELEASE available using quarterly:
Rich (BB code):
[1-0] # pkg rquery -x '[%R] %o %n %v' '^drm-(51.-|6..?-)?kmod'| egrep '(6\.6\.25)|(graphics/drm-kmod)|drm-612-kmod' | column -t | nl
     1  [FreeBSD-ports]        graphics/drm-66-kmod   drm-66-kmod   6.6.25.1500068_10
     2  [FreeBSD-ports]        graphics/drm-kmod      drm-kmod      20260508
     3  [FreeBSD-ports-kmods]  graphics/drm-612-kmod  drm-612-kmod  6.12.85.1501000_2
     4  [FreeBSD-ports-kmods]  graphics/drm-66-kmod   drm-66-kmod   6.6.25.1501000_11
For graphics/drm-66-kmod* your output shows the right combination: #2 and #4 (=matching your kernel, and PORTREVISION 11). By the looks of it you haven't installed these from the remote FreeBSD package servers but build them locally ("[unknown-repository]"); that should work just as well. I can't exactly see what the cause of the problem is.

What is your graphics card, or CPU with iGPU?

Temporarily disable the loading in /etc/rc.conf wrt kld_list="amdgpu" and try kldloading manually.

What gives:
pkg which /boot/modules/amdgpu.ko
After kldloading with kldload -v /boot/modules/amdgpu.ko:
kldstat -v | grep amdgpu

Does kldload -v /boot/modules/amdgpu.ko result in the same error as mentioned in your OP?

___
* Alternatively, you could try graphics/drm-612-kmod, unless your (modern) graphics really needs the drm-66 variety.
 
By the looks of it you haven't installed these from the remote FreeBSD package servers but build them locally ("[unknown-repository]")
Yes, building ports is the main appeal of FreeBSD to me, otherwise it'd be like another (non-Gentoo)Linux distro.
What is your graphics card, or CPU with iGPU
It's primarily a gaming rig I'm dual booting now with FreeBSD and it has Radeon 6750XT.
Temporarily disable the loading in /etc/rc.conf wrt kld_list="amdgpu" and try kldloading manually.
Done - same error as before.
Code:
#pkg which /boot/modules/amdgpu.ko
/boot/modules/amdgpu.ko was installed by package drm-66-kmod-6.6.25.1501000_11
I was hoping there was an obvious faux pas on my behalf. AFAIK I haven't done anything to the kernel (it's not part of user-land) - why the sudden mismatch? Do I need to rebuild the kernel?
I just rebuilt graphics/drm-66-kmod and still get same error:(
 
This summer has been a very long story of mixed up Graphics driver versions in the binary Repos.
for 15.1-p4 you should have
drm-kmod-20260508
and
drm-612-kmod-6.12.85.1501000_2
installed
during yesterday drm-612-kmod-6.12.85.1501000_2 appeared in FreeBSD-Ports-kmods 2026Q4 quarterly repo.

SO basically if you first delete the DRM packages you have installed ( as you dont want to use drm-66-kmod )
and run

pkg install drm-kmod
then
drm-612-kmod-6.12.85.1501000_2

Should install as well. ( you can check the Makefile in /usr/ports/graphics/drm-kmod , which directs to install drm-612-kmod on 15.1 )

I'll be interested in the outcome of that test.

Regards.
 
Do I need to rebuild the kernel?
You might, but I'm not very knowledgable in that area wrt to your mismatch problem. Perhaps (grasping at straws), make 2 individual efforts:
1) pkg ins -f -r FreeBSD-ports-kmods drm-66-kmod and see where kldloading gets you.
2) pkg ins -f -r FreeBSD-ports-kmods drm-612-kmod and see where kldloading gets you.

Using -f for #2 is not strictly necessary but doesn't hurt either.
If these all give the same error, then it seems there's something with your kernel going on. Others can then likely provide better advice than I.

EDIT: Didn't see the previous response, graphics/drm-kmod can also be installed but, you've already got that one and amdgpu.ko is part of graphics/drm-{612,66}-kmod
 
Building graphics/drm-66-kmod from port (ports-mgmt/portmaster) requires a source tree under /usr/src. Make sure the source tree is releng/15.1.


Apropos:
I apologize for using a screenshot, but I have no gui to copy/paste and it would take me rest of the day to type it all in.
Next time the system has no GUI and you need to show some output in forums, send it to a text storage site. The most suitable is https://termbin.com . Example:

pkg repos | nc termbin.com 9999

Or:
Code:
% pkg -vv | sed -nE -e '/(^OSVERSION|^ABI)/ p' -e '/^Repositories:/,$ p' > amdgpu.txt
% echo >> amdgpu.txt
% pkg query -x '[%R] %o %n %v' '^drm-(51.-|6..?-)?kmod|(^nvidia-(d|k))'  >>   amdgpu.txt
% cat amdgpu.txt | nc termbin.com 9999

netcat to tembin.com will return a short URL.
 
for 15.1-p4 you should have
drm-kmod-20260508
and
drm-612-kmod-6.12.85.1501000_2
I can pick the driver a la carte? I thought this was determined by graphics card version.
I was always told not to mix binaries with ports, but I can try building drm-612-kmod and remove the other one.
as you dont want to use drm-66-kmod
Why?

Quick update: it didn't work, same errors.
 
It looks like you have a "main" (aka 16.0-CURRENT) source tree. Which tool did you use to populate /usr/src?
I believe I used git, but that was before building the drm-kmods and it worked then. I did not consciously manipulate /usr/src since. I may have done compulsive
Code:
git -pull
but I assumed that refreshes currently used branch, not switches to a new one - am I wrong?
In any case it looks like I need to delete /usr/src and get 15.1 ? Also, could someone advise what is the proper way of getting and maintaining the correct sources? The Handbook insists on git and I don't like it much as it is a package. I believe source should be handled by the system.
 
Back
Top