JetPack 5.1.1 fails to build kernel modules (with DKMS)


we are facing an issue when building kernel modules (e.g. with dkms) on our Jetson Xavier NX system with JetPack 5.1.1. Below there is a detailed description on how to reproduce the issue, it does not really matter which module is installed. If we are replacing the kernel sources with a fresh download of the sources files, then the module installation works.

The question is why the module build with the original JetPack image is broken and if there is a more straightforward way to fix it than downloading the sources again. We would like to avoid doing this for all our systems.

Thank you.

Steps to reproduce:
Target Hardware: Jetson Xavier NX [DevKit]
SDK Version JetPack 5.1.1

Test modules installation

sudo apt install zfs-dkms
sudo apt install xtables-addons-dkms

Error message in case of zfs-dkms

Setting up dkms (2.8.1-5ubuntu2) ...
Setting up zfs-dkms (0.8.3-1ubuntu12.15) ...
Loading new zfs-0.8.3 DKMS files...
It is likely that 5.10.104-tegra belongs to a chroot's host
Building for 5.10.104, 5.10.104-tegra and 5.4.0-164-generic
Module build for kernel 5.10.104 was skipped since the
kernel headers for this kernel does not seem to be installed.
Building initial module for 5.10.104-tegra
Error!  The /var/lib/dkms/zfs/0.8.3/5.10.104-tegra/aarch64/dkms.conf for module zfs includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch.  This indicates that it should not be built.

Work around :

1) Download public_sources.tbz2 on
2) Unzip kernel sources
3) Inside /lib/modules/"$(uname -r)" folder set the symbolic link to new kernel source folder
4) Inside kernel source folder 
	zcat /proc/config.gz | sudo tee YOUR_PATH_TO_KERNEL_SOURCES/.config >/dev/null
	sudo make -C /lib/modules/"$(uname -r)"/build modules_prepare

Still reproducing on JetPack 5.1.2


I think maybe that’s because Jetson uses kernel built by NVIDIA that has -tegra as a suffix, which is not considered in the dkms package provided by Ubuntu.
Would it still happen if you build the kernel again without adding -tegra?

Hello DaveYYY,

Thanks for the answer. I’m actually wondering if you mean that building kernel modules or using DKMS is not supported on the Jetson platform with the original image and kernel. Somehow I cannot imagine that.

Also, it works with other JetPack versions (we used JetPack 4.6 before) where the kernel is also named -tegra (in the case of JP4.6 it’s 4.9.253-tegra).

Additionally, if we replace the kernel sources of the original image with the downloaded ones (as described above), the build will work. And this does not change the name, it is still called -tegra.

Other kernel modules finish the build, but they cannot be loaded with an “exec format error”. It looks to me like there is something wrong with the kernel sources.

Is no one on your side using kernel modules or DKMS? I think it should be noticed when the kernel module build fails for several versions.


Can you give an example?
I think exec format error means something like running an x86 binary on arm platforms.

I’m not sure with DKMS, but for normal kernel modules that need to be built manually, we don’t see any issues.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.