Problems with DKMS modules and kernel 5.19.x + GCC 12.2?
Hey r/archlinux,
I updated all the packages on my machine tonight for the first time in several days, and since then I've been unable to load any kernel modules that are built with DKMS. The modules don't load on boot, and attempting to modprobe them manually just shows the following error (xone_gip is just an example - the behaviour is the same for any DKMS module):
modprobe: ERROR: could not insert 'xone_gip': Operation not permitted
If I look in dmesg when I do this, I can see the following error:
[ 47.372403] BPF: [112255] Invalid kind:19
[ 47.372405] failed to validate module [xone_gip] BTF: -22
During the upgrade, I noticed that my kernel was upgraded to 5.19.3 and GCC was also updated to 12.2.0. After some digging, it seems like support for BTF/BPF is something that was added to GCC in the 12.x series. For fun I tried dumping the symbols from one of the compiled modules using objdump -x xone-gip.ko (after decompressing it) and noticed the following section:
30 .BTF 0000dc6e 0000000000000000 0000000000000000 00005e4c 2**0
So it seems to me that now GCC is adding that .BTF section into the compiled modules, and the kernel doesn't like it? On a lark I decided to try stripping the .BTF section out of every module compiled with DKMS with the following shell script:
cd /usr/lib/modules/$(uname -r)/updates/dkms
for file in *.zst
do
cp "$file" "$file.bak"
unzstd -f "$file"
base=$(basename "$file" .zst)
objcopy --remove-section .BTF "$base"
zstd -f "$base"
rm -f "$base"
done
Much to my surprise, all of the modules load now!
Has anyone else encountered this issue? Is this a known issue or something particular to my setup? And is there a less-janky workaround than what I'm doing here? :)
EDIT: Thanks to everyone that has chimed in here. I've raised this bug to track the issue. Based on this forum post I'm not alone.
EDIT #2: Current workaround/solution is to downgrade pahole to 1.23-1.
EDIT #3: It looks like pahole 1.24-1 has been replaced with 1:1.23-1 in some mirrors, so everyone should automatically get a working version in the near future and not run into this issue.
Edited 24 Aug 2022. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 84 · 99% up
- Kind
- Text
- ID
- ww9fa2
32 comments
I was having the exact same problem after updated my kernel (linux, linux-lts) and gcc (and gcc-libs, gcc-go) to version 12.2. while in the completion of the update i got error msgs saying module not found "nvidia" and "nvidia-uvm". Followed the instruction given by the dkms while still in the terminal to get to know more about the error, it turn out that my nvidia modules was compiled using gcc 12.1, and i already updated my gcc to 12.2.
So, downgrading the gcc, gcc-libs and gcc-go to 12.1.1-4 did save my systems. And at this point i am not really sure what is wrong with what haha i'm a total noob, been using the arch for regular daily use.
I'm using nvidia-340xx-dkms driver btw
Thanks to everyone commented! I've update the original post with a link to the Arch Forums where this issue has also been reported, and to a bug tracker issue that I've raised.
EDIT: Current workaround/solution is to downgrade
paholeto1.23-1.EDIT #2: Working version of
paholeis rolling out to mirrors now.Can you inform/give us some update here in your post later if the bugs has been fixed ? I'd like to keep my system up to date, but at this point I'm too afraid to upgrade the gcc packages to newer version than 12.1.1-4. I fear it'll break my systems again. Thanks for reporting it as bugs btw.
The affected package,
pahole, has been replaced with1:1.23-1which is a version that works and should avoid this issue. Once your mirror is updated you should be fine!I just want to say thanks to all you arch folks finding the bugs in GCC 12 plus kernel 5.19 so everyone running GCC 10 and kernel 5.18 wont have to worry when the upgrade comes later.
You guys are legitimately a big help to the ecosystem
Can you use the non dkms version of Nvidia? That’s the work around I’m using.
I'm doing that as well. It's the handful of other DKMS modules that I use that are problematic right now.
What other dkms modules are you using? I’m still learning so interested.
I've been seeing so many people here having problems with 5.19 that I was afraid to update, but fortunately I didn't have any problems in both of my arch machines, one is using the Nvidia privative driver.
Have you checked if anybody else reported this issue on the arch forums or anywhere else?
Also check arch bugtracker (warning: NSFL)
I've checked the forums and bug tracker but didn't find anything relevant yet. I'll submit a big tracker issue if it seems necessary!
I have the same issue with nvidia-dkms and virtualbox and your solution worked perfectly. No idea why it's happening.
Thank you. I was pulling my hair out trying to get my laptop to work. Even the non-DKMS drivers for my nVidia GPU were loading. Now it is up and running properly.
Deleted before we saved it.
the pahole downgrade fixed my issues with nvidia, but virtualbox kernel modules still aren't loading --fixed
same problem :/
I fixed it, make sure to reinstall virtualbox-host-dkms, just reinstalling virtualbox doesn't reinstall that for some reason.
Just reporting in here. No problem with Nvidia 470
Yes, and your hack worked. Thanks!
I have the following modules:
Deleted before we saved it.
Deleted before we saved it.
My PC (nvidia geforce rtx 2070): I was beating this dead horse last night for 2 hours. I saw the errors mentioned, reinstalled nvidia drivers , saw the pahole downgrade and verified it, and my fix was switching out "nvidia-dkms" for "nvidia" via Yay package manager. I need to verify gcc version before anyone draws any conclusion from my comment.
Old laptop: Unrelated, but I was using one broken machine to research how to fix the other. Went so long with no updates that mirrors and PGP keys are causing problems... imma try again tonight but then imma just do a fresh install cause I'm getting ready to swap out some hardware anyway.
Deleted before we saved it.