cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
899 Views
Registered: ‎05-16-2018

Error loading a kernel module - version magic error - aarch64 - 2018.3

Hello,

We've found an unexpected behaviour when installing a kernel module in a Zynq UltraScale+ device and we'd like to know whether there is something wrong in our procedure. In any case, we've found a workaround thanks to this post:

https://forums.xilinx.com/t5/Machine-Learning/Kernel-release-miss-matched-for-DNNDK/td-p/938610

Here's the problem:

We have a kernel module installed and tested on a ZedBoard. The kernel module is compiled with xlnx_rebase_v4.14_2018.3 and the OS in the ZedBoard is created with PetaLinux 2018.3.

Now, we are porting this module to a ZCU102 board by using the same xlnx_rebase_v4.14_2018.3 but compiled for a ZynqMP (aarch64). However, when we try installing the module with insmod the following error appears:

kernel_module_drv: version magic '4.14.0 SMP mod_unload aarch64' should be '4.14.0-xilinx-v2018.3 SMP mod_unload aarch64'
insmod: can't insert 'kernel_module_drv.ko': invalid module format

We have tried to modify the kernel 'Local Version' tag with PetaLinux and remove the '-xilinx-v2018.3' extension but it doesn't work, the error still appears.

The PetaLinux project for the ZCU102 uses xilinx-zcu102-zu9-es2-rev1.0-v2018.3-final.bsp

Our current workaround for now is:

  • Create a project with PetaLinux.
  • Configure kernel with petalinux-config -c kernel
  • Add the following line to the file linux-xlnx_%.bbappend at /project-spec/meta-user/recipes-kernel/linux/
    • LINUX_VERSION_EXTENSION = ""

Would you have any recommendation to avoid this workaround?


Thanks,

Space Science & Engineering Lab, ssel.upct.es

0 Kudos
3 Replies
Highlighted
Voyager
Voyager
879 Views
Registered: ‎05-14-2017

You have a kernel named version mismatch.

The kernel module's version must match its kernel's version, the architecture as well (Zynq 7000 is different from Zynq Ultrascale+ MP).

The kernel localversion is configured via General Setup menu of the kernel configuration menuconfig:

Screenshot_2019-11-22_20-39-34.png

Regards,

s.

0 Kudos
Highlighted
Visitor
Visitor
823 Views
Registered: ‎05-16-2018

Hi,

Thanks for your answer. Unfortunately, we had already tried that and it didn't work.

As the nomenclature can be a little bit tricky I'm going to define the keynames I'll use in the message, just to be sure we're on the same page:

  • Kernel module: module that is compiled with xlnx_rebase_v4.14_2018.3  either for a Zynq MP or a Zynq 7000. Previously, the xlnx_rebase_v4.14_2018.3 itself is compiled for a Zynq MP or a Zynq 7000 by establishing the following variables:
    • Zynq MP:
      • ARCH=arm64 xilinx_zynqmp_defconfig
      • CROSS_COMPILE=aarch64-linux-gnu-gcc
    • Zynq 7000:
      • ARCH=arm xilinx_zynq_defconfig
      • CROSS_COMPILE=arm-linux-gnueabihf-gcc
  • Kernel OS: Linux Kernel built with PetaLinux either for a Zynq MP or Zynq 7000.

We had already tried to change the kernel OS's localversion via the General Setup menu of the kernel configuration menuconfig and remove the '-xilinx-v2018.3' tag. It didn't work, the mismatch still exists.

For now, we can only modify the kernel OS's localversion by modifying the linux-xlnx_%.bbappend file when creating the Linux for the Zynq MP.

However, when we build a kernel module and kernel OS for a Zynq 7000 we don't have to do any modification on this matter. The kernel OS's localversion has the '-xilinx-v2018.3' by default (checked in the kernel configuration menuconfig).

Our hypothesis is that the kernel module's version doesn't include the '-xilinx-v2018.3' tag when it's compiled for a Zynq MP but it does when it's compiled for a Zynq 7000.

It isn't very important as we have a workaround but we were wondering whether this is an expected behaviour when compiling for a Zynq MP or maybe there was something we weren't aware of.

Thanks,

SSEL

0 Kudos
Highlighted
Explorer
Explorer
767 Views
Registered: ‎03-21-2019

I had this issue when I used a pre-built 102 kernel, while my coworker set that same kernel as an ext-local-src. Make sure you either both use the one that's built in to petalinux, or you both use an externel one (even if you use the same kernel, it matters whether you specify it as ext-local-src or linux-xlnx in the config menu.)

0 Kudos