Apply RT patches to the kernel:

I am trying to install the drivers for NVIDIA Jetson™ Linux version 35.1 GA .
While going through the user manual , i cam across this step where we got to build the kernel .

To Build the Real-Time Kernel

Apply RT patches to the kernel:

./kernel-5.10/scripts/rt-patch.sh apply-patches

I tried to do it but the patches are no where to be found . How do i resolve this ?

Additionally
Another step which is :
" For the device tree, replace the files in Linux_for_Tegra/kernel/dtb/ with a copy from:

$kernel_out/arch/arm64/boot/dts/nvidia/ "
there wasnt any dts file present as well . Only the dtb file was present ?
I am fairly new to this .

Hi,

Is there any reason you have to use 35.1?
35.1 is very old and does not support Orin NX boards.

Did you download the kernel source tarball?

YES, of course.
This step is for you to install newly compiled device trees so it only contains DTB files.

Hello
Due to the image booting problems in the latest version , i intend to compare it with the 35.1 .
Yes i did install the kernel tarball.
the path until the ./kernel-5.10 exists. Inside the kernel-5.10 there are two files :

  1. kernel_supplements.tbz2
  2. .git file

the kernel_supplements.tbz2 file is empty . What is the reason for that ?

Jetson_Linux_R35.1.0_aarch64/Linux_for_Tegra/sources/kernel/kernel-5.10 this is the path for the above mentioned file

In another path which is Jetson_Linux_R35.1.0_aarch64/Linux_for_Tegra/kernel ,kernel_supplements.tbz2 contains some lib folder.There isnt any rt patch available when i searched
. Should i copy these files into the path where the kernel_supplements.tbz2 is empty ?

And also the dtb (from which we are supposed to be copying had two files ) and the destination had about 10 files . Again am i doing something wrong in this ?

Let me know

Please go with 35.5.
We won’t fix it even if there is any issue with 35.1.

I don’t really know what you did.
You are not supposed to get kernel_supplements.tbz2 under the kernel source folder.
You only get it after you compile all the kernel modules and make a tarball out of it.

Please be more clear on this.

The target dtb featured about 70 files with the extension of .dtbo &.dtb as the extension attached to each one of them .The files that are to be copied from the boot folder (it is supposed to be dts but there is only the dtb file that is present and it contains dtbo.sig and a dtb file . So replacing those 70+ files with those 2 files am i doing it right ?
Also kernel_supplements.tbz2 this is an empty file . The other boot file (which is the source ) contains the kernel_supplements.tbz2 file and has some content .
Are the rt patch files present in the source files
Driver Package (BSP) Sources & Sample Root Filesystem Sources?

I still have completely no idea what you are doing.
Better give a screenshots of files you are talking about.

  1. For the device tree, replace the files in Linux_for_Tegra/kernel/dtb/ with a copy from:

$kernel_out/arch/arm64/boot/dts/nvidia/

for this step the files presetn in the Linux_for_Tegra/kernel/dtb/ are shown below

and in the $kernel_out/arch/arm64/boot/dts/nvidia/ (in the instruction manual it is given as dts but only dtb is present as discussed earlier ), there are only two files this is shown below

Is this step execution correct from my end , where i replace many a files with just two ?

This is Linux_for_Tegra/boot/dtb/, not $kernel_out/arch/arm64/boot/dts/nvidia/ at all…
Are you really sure about what you are doing?

For the steps that involved the drivers in the nvgpu

and the image replacement

The corresponding steps were in the reference manual were
Replace Linux_for_Tegra/rootfs/usr/lib/modules/$(uname -r)/kernel/drivers/gpu/nvgpu/nvgpu.ko with a copy of this file:

$kernel_out/drivers/gpu/nvgpu/nvgpu.ko

Replace Linux_for_Tegra/kernel/Image with a copy of this file:

$kernel_out/arch/arm64/boot/Image

It was throughthe above files as indicated in the pictures that i replaced the files and sought to do the same with the dtb files

Here are the remaining files and the arch file isnt present in here

Can you lead me specifically onto this , please?

Do you know what $kernel_out means?

I do not know how possibly to set the $kernel_out environment variable .
Can you guide me on this ? I didnt know that until it was specifically pointed out in this thread

You don’t need to set it. It’s just whatever folder you want the compiled stuff to be stored in.
Read the document, please.
https://docs.nvidia.com/jetson/archives/r35.5.0/DeveloperGuide/SD/Kernel/KernelCustomization.html#to-build-the-kernel

For this step

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

$kernel_out/drivers/gpu/nvgpu/nvgpu.ko

I dont seem to find the nvgpu.ko file
instead i find three folders that go by the name
1.common
2.hal
3. os

The nvgpu.ko though is present in another file (Desktop/32 GB Volume/lib/modules/4.9.253-tegra/kernel/drivers/gpu/nvgpu) which is not the kernel_out file .

any solution to this ?

additionally when perfoming this step
$ ./nvbuild.sh -o $PWD/kernel_out
i get indicated of warning being read out as erros.I sthat a problem ?

Do you know what your $kernel_out it now?

Yes . Thanks for pointing it out earlier .
I have the kernel out set up

The only problem is the nvgpu.ko instead i find something else listed This is shown in the below picture

Two questions:

  1. Why are you talking about stuff related to kernel 4.9, which is JetPack 4? I have no idea what your 32GB Volume is.
  2. Put the log here.

Here are the instructions to get the kernel working with the patch
https://docs.nvidia.com/jetson/archives/r35.3.1/DeveloperGuide/text/SD/Kernel/KernelCustomization.html
This is the reason i spoke of it as i am trying to follow the instructions

here is the log

uilding kernel-5.10 sources
make: Entering directory ‘/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel/kernel-5.10’
make[1]: Entering directory ‘/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel_out’
GEN Makefile

No change to .config

make[1]: Leaving directory ‘/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel_out’
make: Leaving directory ‘/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel/kernel-5.10’
make[1]: Entering directory ‘/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel_out’
GEN Makefile
make[1]: Leaving directory ‘/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel_out’
CALL /home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/atomic/check-atomics.sh
CALL /home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/checksyscalls.sh
CHK include/generated/compile.h
CC drivers/media/platform/tegra/camera/csi/csi2_fops.o
/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel/nvidia/drivers/media/platform/tegra/camera/csi/csi2_fops.c: In function ‘csi2_start_streaming’:
/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel/nvidia/drivers/media/platform/tegra/camera/csi/csi2_fops.c:295:25: error: this ‘if’ clause does not guard… [-Werror=misleading-indentation]
295 | if (err)
| ^~
/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel/nvidia/drivers/media/platform/tegra/camera/csi/csi2_fops.c:298:33: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
298 | cil_settletime = 0;
| ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[7]: *** [/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/Makefile.build:281: drivers/media/platform/tegra/camera/csi/csi2_fops.o] Error 1
make[6]: *** [/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/Makefile.build:498: drivers/media/platform/tegra/camera/csi] Error 2
make[6]: *** Waiting for unfinished jobs…
CC drivers/media/platform/tegra/camera/camera_gpio.o
CC drivers/media/platform/tegra/camera/nvcsi/csi5_fops.o
AR drivers/media/platform/tegra/camera/nvcsi/built-in.a
CC drivers/media/platform/tegra/camera/camera_version_utils.o
CC drivers/media/platform/tegra/camera/sensor_common.o
CC drivers/media/platform/tegra/camera/camera_common.o
CC drivers/media/platform/tegra/camera/tegracam_ctrls.o
make[5]: *** [/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/Makefile.build:498: drivers/media/platform/tegra/camera] Error 2
make[4]: *** [/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/Makefile.build:498: drivers/media/platform/tegra] Error 2
make[3]: *** [/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/Makefile.build:498: drivers/media/platform] Error 2
make[2]: *** [/home/dnc/Downloads/35.3.1/public_sources/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/Makefile.build:498: drivers/media] Error 2
make[2]: *** Waiting for unfinished jobs…

I belive you were not using the correct compiler version.
They are supposed to be built without any error.

Oh okay

I was doing the command execution based on the bootlin gcc 11.3

When i installed the Bootlin toolchain source , 2020.08-01 , these were the files present as is indicated within the image below


How do i get the specific versions ie *
GCC version: 9.3.0

  • Binutils version: 2.33.1
  • Glibc version: 2.31

Is there a way to get these from the above files?

You are using 35.3.1 then you check the page for 35.3.1, as simple as it is.