Jetson Xavier : kernel module size issue

Hi Team,

I have compiled kernel modules for Xavier and module folder size is very big around 971M and default module(pre-compiled in L4T) have only 67M size.

What could be the issue of this, i checked individually each module, every module have big size, and total number of module are same.

Normally modules are built with debug symbols. You can strip debug symbols out (very few people here will use a JTAG debugger or kgdb/kgdboc, but system logging might also benefit from symbols in the case of logging an error) and get a smaller file. The basic tool is “strip”, but there will be a different version if trying to strip a file of a foreign architecture. Native being on the same system running the file’s content, foreign being cross architecture, e.g., using your PC to strip a module you’ve just built which is targeted at aarch64/arm64. Keep this in mind when you read instructions for stripping modules here (you might need a different “strip” depending on where you run this):
https://devtalk.nvidia.com/default/topic/1066506/jetson-tx2/why-the-built-modules-based-on-nvidia-official-kernel-source-/post/5401303/#5401303

In that URL the path is just somewhere in the kernel source and someone is stripping the file there before copying in to place somewhere else. It doesn’t matter if the file is already installed or not, you just need to name the path to wherever the file is currently at.

1 Like

Thanks for Answer.

But in shared URL contains command for ‘strip’ single module (ko) , How to strip whole folder’s module(ko).

or need to strip one by one.

You would have to strip one at a time. It is possible to write a script to do so. Or perhaps a combination of find and xargs. You will probably find it easier to just strip one at a time, especially since many of the modules are already stripped.

Here is one example illustration URL for find plus xargs:
https://www.tecmint.com/xargs-command-examples/

Basically it feeds “xargs” with file names from “find”, and executes a command for each file name passed. A good test is to just echo a file name or (like in his example) run a command “wc” (word count) to understand how it works.