JP 5.0.2 GA Correct way to build kernel and modules? nvgpu.ko errors!

Hello together,

I have followed this guide:

I am using the manual sources.
Using the works. A kernel is compiled.
Instead of creating a kernel supplements tar as described in step 7 I install the modules as follows:

rm -rf $ROOT_DIR/usr/lib/modules/$KERNEL_VERSION/kernel
make -C $SOURCE_DIR/kernel/kernel-* INSTALL_MOD_STRIP=1 LOCALVERSION="-tegra" ARCH=arm64 O=$KERNEL_DIR modules_install INSTALL_MOD_PATH=$ROOT_DIR/usr

This all works perfectly fine. We added custom kernel modules and everything runs properly.
Now since we have noticed that a lot unneccesary stuff is included in the kernel config I for example disabled the “Network Device Support → Wireless LAN” option in the kernel. Everything else is kept the same.

As soon as I run the generated kernel and modules on the device I get the following warnings from nvgpu.ko:

[   10.174511] nvidia: loading out-of-tree module taints kernel.
[   10.177739] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[   10.178623] nvidia: disagrees about version of symbol nvhost_get_default_device
[   10.178784] nvidia: Unknown symbol nvhost_get_default_device (err -22)
[   10.178974] nvidia: disagrees about version of symbol fget
[   10.179093] nvidia: Unknown symbol fget (err -22)
[   10.179252] nvidia: disagrees about version of symbol fd_install
[   10.179397] nvidia: Unknown symbol fd_install (err -22)
[   10.179674] nvidia: disagrees about version of symbol wake_up_process
[   10.179815] nvidia: Unknown symbol wake_up_process (err -22)
[   10.180092] nvidia: disagrees about version of symbol iterate_fd
[   10.180257] nvidia: Unknown symbol iterate_fd (err -22)
[   10.180563] nvidia: disagrees about version of symbol __close_fd
[   10.180745] nvidia: Unknown symbol __close_fd (err -22)
[   10.181399] nvidia: disagrees about version of symbol nvhost_syncpt_unit_interface_get_aperture
[   10.181644] nvidia: Unknown symbol nvhost_syncpt_unit_interface_get_aperture (err -22)

Is there anything special about the build of nvgpu.ko that it does not get informed about my kernel config changes?


Is nvgpu.ko also got rebuilt and replaced on your side?

Hey @WayneWWW

yes it seems to be rebuilt. The date changes and I noticed that the guide point 5 mentions this:

Replace Linux_for_Tegra/rootfs/usr/lib/modules/$(uname -r)/kernel/drivers/gpu/nvgpu/nvgpu.ko with a copy of this file:


I had a step to copy it finally in my code initially but after the file was still 245MB I noticed that the module install step:

make -C $SOURCE_DIR/kernel/kernel-* INSTALL_MOD_STRIP=1 LOCALVERSION="-tegra" ARCH=arm64 O=$KERNEL_DIR modules_install INSTALL_MOD_PATH=$ROOT_DIR/usr

…copies it too, so I tested with copying and without copying, and also without the INSTALL_MOD_STRIP=1 option. No matter what I do, as soon as I remove the wifi modules the nvgpu.ko complains that there are missing symbols.

Could you build the kernel + nvgpu without any of your patch first and see if nvgpu is working fine under such situation?

Hey @WayneWWW will do that. Give me a few minutes. Will report back.

BTW, 5.0.2 is already not a DP version. Not sure why topic still has DP in it.

@kayccc Seems I can’t edit it, can you please do that? Got used to the DP


Unfortunately still the same result with the plain kernel from the public sources.
I entirely removed the output and source directory for the build to make sure that there are no leftovers.

Here is the script part that is responsible to build, I hope you can figure the variables:

echo "Copying kernel config"
cp $CONFIG_DIR/$KERNELCONFIG_NAME $SOURCE_DIR/kernel/kernel-*/arch/arm64/configs/tegra_defconfig

export CROSS_COMPILE=$TOOLCHAIN_DIR/$TOOLCHAIN_VERSION/bin/aarch64-buildroot-linux-gnu-

echo "Building Kernel"

echo "Replacing kernel"
cp $KERNEL_DIR/arch/arm64/boot/Image $L4T_DIR/kernel/Image

echo "Replacing kernel modules"
echo "Cleaning modules"
rm -rf $ROOT_DIR/usr/lib/modules/$KERNEL_VERSION/kernel

echo "Installing modules"
make -C $SOURCE_DIR/kernel/kernel-* INSTALL_MOD_STRIP=1 LOCALVERSION="-tegra" ARCH=arm64 O=$KERNEL_DIR modules_install INSTALL_MOD_PATH=$ROOT_DIR/usr

And the config I used now, this is the minimal I had in use, now the missing symbols are even more.
kernel_config (165.5 KB)

Does your “plain kernel” mean this is pure from source code tarball even without changing anything in defconfig?


To answer your previous question. Plain kernel means no patches, just the nvidia source code, but with my config. I already told you before that with the default config everything is alright but as soon as you modify the kernel config the issue appears. But it will be clearer now:

I have made an error during my initial analysis.
Since I did not know which kernel module the “nvidia” message belonged to I deleted the nvgpu.ko as it described itself as nvidia. But that was a mistake. The actual module in fact is called “nvidia.ko”

It is placed here:

I do not have that module anywhere in my build folder except in the rootfs. I assume it gets created by the It is already present in my minimal rootfs which is derived from ubuntu base +

All the modules in that folder do not match my build kernel of course. It does not get built by

The source code of nvidia.ko and nvidia-modset.ko is in the public source code tarball.

Also, when I said “pure jetapck”, I mean your whole BSP is from jetpack. Build the kernel based on this environment.

Make sure this base case can pass first.

Again: Everything works as long as I do not edit the kernel config.

Seems we are back to this older question from the DP 5.0.1:

We already identified the issue. My rootfs includes the extra folder from the l4t but my kernel does not match it.
As long as I use the wrong nvidia.ko I’ll have that issue.

If the source for the nvidia.ko is included in the public sources, how can I build the modules in the extra folder? doesn’t.

Have you identified which line you added in kernel defconfig is causing the problem?

Please follow the guidance here. This part is missing in document. We will add it back.
The toolchain version may need correction.

  1. The NVIDIA-kernel-module-source-<Version>.tar.xz source code is supplied as a .xz file. Untar the file. Its location is <NV_WORKSPACE>/drive-linux_src/.
  2. Export the required variables as per the Linux kernel compilation steps:
export ARCH=arm64
export LOCALVERSION="-tegra"
export CROSS_COMPILE=<NV_WORKSPACE>/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-
  1. cd <NV_WORKSPACE>/drive-linux_src/NVIDIA-kernel-module-source-<Version>
  3. Make the modules with following command:
make \
    modules \
    CC=<NV_WORKSPACE>/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-gcc \
    LD=<NV_WORKSPACE>/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-ld.bfd \
    AR=<NV_WORKSPACE>/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-ar \
    CXX=<NV_WORKSPACE>/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-g++ \
    OBJCOPY=<NV_WORKSPACE>/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-objcopy \
    TARGET_ARCH=aarch64 \
  1. Modules are built under <NV_WORKSPACE>/drive-linux_src/NVIDIA-kernel-module-source-<Version>/kernel-open.

I assume you mean this file inside the public sources?

It contains folders with the names of the three modules.

The NVIDIA-kernel-module-source-<Version>.tar.xz does not exist in the source tar.


The folder name does not matter. Please read the readme file inside this tarball and modify the make parameters as my comments.

I just wanted to make sure that I use the correct tar file as source for building and not some other since you mentioned a totally different file.

Yes, that tarball is correct.

@WayneWWW thanks for the help.

With the self compiled extra modules all warnings are gone!

1 Like

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