Recompile the kernel without any changes to source files causes errors

Hi. I am attempting to test PCIe using two Jetson AGX Xaviers. One will act as root port, and the other will act as end point.

I am currently using Jetpack 5.1, which uses R35.2.1 BSP. The following NVIDIA documentation for testing PCIe with the R35.2.1 BSP mentions that I have to recompile the kernel by adding “CONFIG_STRICT_DEVMEM=n” to the tegra_defconfig and recompile the kernel.

https://docs.nvidia.com/jetson/archives/r35.2.1/DeveloperGuide/text/SD/Communications/PcieEndpointMode.html

Therefore, I downloaded the kernel sources for R35.2.1, and followed the instructions in this guide:
https://docs.nvidia.com/jetson/archives/r35.2.1/DeveloperGuide/text/SD/Kernel/KernelCustomization.html

As mentioned in the guide, I downloaded the kernel sources, and extracted them. Then I set up the toolchain by downloading " Bootlin Toolchain gcc 9.3 ", and exported the environment variables “CROSS_COMPILE_AARCH64_PATH” and “CROSS_COMPILE_AARCH64”. ( I am using a Ubuntu 18.04 host machine )

Then without making any changes, I ran the command “./nvbuild.sh -o $PWD/kernel_out” to build the default kernel to verify the process before making any changes.

However, when I run the “./nvbuild.sh -o $PWD/kernel_out” command, I get some errors after some time, and the kernel fails to build. The log when I run the kernel build command is attached.
kernel_build_log (104.3 KB)

Can anyone help me out as to what I am doing wrong?

I did not make any changes. Simply downloaded and extracted the kernel sources, set up the toolchain, and built the kernel with its default settings.

Hi, I just made a clean build on r35.2.1, and did not encounter the same error as you did.
Can you delete the whole folder and start the process again?
We can take a deeper look into it if the error is still the same.

Hey @DaveYYY . Thanks for the reply. I tried deleting the whole folder and repeating the process. However, I am still getting errors.

The log file for this new test is attached below.
kernel_build_log_v2 (65.1 KB)

For reference, this is my workflow:

  1. Downloaded " Driver Package (BSP) Sources" for R35.2.1.
  2. Extracted the sources using: tar -xjf public_sources.tbz2
  3. Changed directory using: cd Linux_for_Tegra/source/public
  4. Extracted the kernel source file using: tar -xjf kernel_src.tbz2
  5. Installed the build utilities: sudo apt install build-essential bc
  6. Downloaded " Bootlin Toolchain gcc 9.3 "for R35.2.1.
  7. Made directory in home for the toolchain: mkdir $HOME/l4t-gcc
  8. Changed directory to the $HOME/l4t-gcc directory: cd $HOME/l4t-gcc
  9. Copied the downloaded toolchain archive to this directory.
  10. Extracted the toolchain archive to this directory: tar xf aarch64--glibc--stable-final.tar.gz
  11. Set the “CROSS_COMPILE” environment variable: export CROSS_COMPILE=$HOME/l4t-gcc/bin/aarch64-buildroot-linux-gnu-
  12. Set the “CROSS_COMPILE_AARCH64_PATH” environment variable: export CROSS_COMPILE_AARCH64_PATH=$HOME/l4t-gcc/
  13. Set the “CROSS_COMPILE_AARCH64” environment variable: export CROSS_COMPILE_AARCH64=$HOME/l4t-gcc/bin/aarch64-buildroot-linux-gnu-
  14. Changed back to the Linux_For_Tegra/source/public directory.
  15. Created directory for output kernel files: mkdir kernel_out
  16. Build the kernel using: ./nvbuild.sh -o $PWD/kernel_out

Hi, can you try either build on a different PC (maybe a fresh and clean Ubuntu system) or use R35.3.1?
It seems we are not able to re-produce this issue as of now.

@DaveYYY . Sorry for the late reply. I was away on holiday for a couple of days. Using another Ubuntu system worked. I am now able to build the kernel using default settings, and also after adding CONFIG_STRICT_DEVMEM=n” to the tegra_defconfig file. Thanks for the support!

1 Like

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