Nvidia_kernel_display_driver_source.tbz2 not support real-time kernels

I want to recompile the nvidia_kernel_display_driver_source code to support the real-time kernel.
I have executed the ‘./kernel-5.10/scripts/rt-patch.sh apply-patches’ command to apply the rt-patch.
When I recompile the nvidia_kernel_display_driver_source code in orin, the following error is generated

Because I used rt-patch, now it can’t be displayed properly。
How should this problem be solved?

Hi,
We don’t see other topics reporting issues about rt kernel patch. Could you share your steps for reference?

Hi 417383384,

We can’t reproduce your issue on r35.1 public sources.
Share our steps for you reference:

export kernel_out=/home/carol/Desktop/JEP/R35.1_Build/out-0920-RTPatch
export CROSS_COMPILE_AARCH64_PATH=~/Desktop/JEP/CROSS_COMPILE/Toolchain_gcc_9.3/
export CROSS_COMPILE_AARCH64=~/Desktop/JEP/CROSS_COMPILE/Toolchain_gcc_9.3/bin/aarch64-buildroot-linux-gnu-
cd ../Linux_for_Tegra/source/public/kernel/kernel-5.10/
sudo ./scripts/rt-patch.sh apply-patches
./nvbuild.sh -o $kernel_out 
cd out-0920-RTPatch/arch/arm64/boot
scp Image to Orin and replace /boot/Image

After reboot and check:

$ uname -a
Linux tegra-ubuntu 5.10.104-rt63-tegra #1 SMP PREEMPT RT Tue Sep 20 10:28:05 CST 2022 aarch64 aarch64 aarch64 GNU/Linux

Hi,carolyuu,
I have performed these operations and rt-patch has compiled successfully.
However, after replacing Image with /boot/Image, HDMI is not displayed properly, nvidia.ko related module files are not loaded, so I need to recompile the nvidia_kernel_display_driver_source code,Then an error is generated.

Hi,
So it is an issue specific to your custom board? Since there is no HDMI out on Orin developer kit.

yes,my custom board,
But the display needs to load the nvidia.ko and nvidia-modest.ko files, after using rt-patch, nvidia.ko and nvidia-modest.ko will show loading failure,Need to recompile the nvidia.ko file corresponding to the real-time kernel,
If the nvidia_kernel_display_driver_source code is recompiled successfully, the corresponding nvidia.ko will be generated, but now the error indicates that the real-time kernel is not supported.

Hi,
Doe it work for you to only overwrite

scp Image to Orin and replace /boot/Image

in your use-case? Or you must rebuild kernel driver?

Yes, i am working on custom carrier board, i have to rebuild kernel driver.

Hi,
We have confirmed the issue. The display driver fails to be compiled after applying RT kernel patch. It is under debugging. Will update.

Hello, has the problem been solved?

Hi 417383384,

Please follow below steps to build “nvidia_kernel_display_driver_source.tbz2” with RT-Patch on host PC and try again.

$ export ARCH=arm64
$ export LOCALVERSION="-tegra"
$ export CROSS_COMPILE=~/Desktop/JEP/Image/CROSS_COMPILE/Toolchain_gcc_9.3/bin/aarch64-buildroot-linux-gnu-
$ cd NVIDIA-kernel-module-source-TempVersion/
$ make modules -j4 TARGET_ARCH=aarch64 SYSSRC=/home/carol/Desktop/Orin+Xavier_R35.1_Build/Linux_for_Tegra/source/public/kernel/kernel-5.10 SYSOUT=/home/carol/Desktop/Orin+Xavier_R35.1_Build/out-1020-RT CC=~/Desktop/CROSS_COMPILE/Toolchain_gcc_9.3/bin/aarch64-linux-gcc LD=~/Desktop/CROSS_COMPILE/Toolchain_gcc_9.3/bin/aarch64-linux-ld AR=~/Desktop/CROSS_COMPILE/Toolchain_gcc_9.3/bin/aarch64-linux-ar CXX=~/Desktop/CROSS_COMPILE/Toolchain_gcc_9.3/bin/aarch64-linux-g++ OBJCOPY=~/Desktop/CROSS_COMPILE/Toolchain_gcc_9.3/bin/aarch64-linux-objcopy
1 Like

Thank you for your reply.
Have you tried these commands, please. I have a lot of errors in this test

Hi 417383384,

Yes, we confirmed this steps can pass.
Please use clean build to try it. Thanks!

你好,下面是我的步骤:
1、解压kernel_src.tbz2,然后编译。

export CROSS_COMPILE_AARCH64_PATH=/opt/aarch64--glibc--stable-2020.08-1/
export CROSS_COMPILE_AARCH64=/opt/aarch64--glibc--stable-2020.08-1/bin/aarch64-buildroot-linux-gnu-
cd kernel/
./nvbuild.sh -o /home/li/tmp/a04_source/a04_jetpack5_0/kernel/kernel_out

2、解压nvidia_kernel_display_driver_source.tbz2,然后编译

 export ARCH=arm64
 export LOCALVERSION="-tegra"
 export CROSS_COMPILE=/opt/aarch64--glibc--stable-2020.08-1/bin/aarch64-buildroot-linux-gnu-
 cd NVIDIA-kernel-module-source-TempVersion
 make modules -j4 TARGET_ARCH=aarch64 SYSSRC=/home/li/tmp/a04_source/a04_jetpack5_0/kernel/kernel/kernel-5.10 SYSOUT=/home/li/tmp/a04_source/a04_jetpack5_0/display_out CC=/opt/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-gcc LD=/opt/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-ld AR=/opt/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-ar CXX=/opt/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-g++ OBJCOPY=/opt/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-objcopy

出现如下错误:

3、拷贝auto.conf文件

 mkdir kernel/kernel-5.10/include/config
 cp kernel_out/include/config/auto.conf kernel/kernel-5.10/include/config/

还是有编译错误
4、拷贝文件到kernel/kernel-5.10

cp kernel_out/*  kernel/kernel-5.10/

5、继续编译,错误如下:

请问应该如何解决这个问题。

你好,之前这位朋友@DaneLLL说已经发现了相关问题,请问解决了吗,源码有更新吗?

Hi 417383384,

Please re-tar the source packages and clean build to try again with below steps:

Build kernel:
$ export CROSS_COMPILE_AARCH64_PATH=<toolchain-path>
$ export CROSS_COMPILE_AARCH64=<toolchain-path>/bin/aarch64-buildroot-linux-gnu-
$ ./kernel-5.10/scripts/rt-patch.sh apply-patches
$ mkdir kernel_out
$ ./nvbuild.sh -o $PWD/kernel_out

Build display kernel:
$ export LOCALVERSION="-tegra"
$ export IGNORE_PREEMPT_RT_PRESENCE=1
$ make \
      modules \
      SYSSRC=<KERNELSRC> \
      SYSOUT=<KERNEL_OUTDIR> \
      CC=$(CROSS_COMPILE_AARCH64)gcc \
      LD=$(CROSS_COMPILE_AARCH64)ld.bfd \
      AR=$(CROSS_COMPILE_AARCH64)ar \
      CXX=$(CROSS_COMPILE_AARCH64)g++ \
      OBJCOPY=$(CROSS_COMPILE_AARCH64)objcopy \
      TARGET_ARCH=aarch64 \
      ARCH=arm64
1 Like

你好。我这试着还是不行,你那有编译好的nvidia.ko, nvidia-drm.ko, nvidia-modeset.ko驱动文件吗,直接发我一份吧,谢谢。

Hi,
We have verified the steps and it is working. What error is seen in your environment?

Maybe you can re-download all packages and try again. To construct a whole-new environment.

你好,我已经是下载的最新的source了,还是有下面的错误,如果你这有编译好的ko驱动文件,直接发我一份吧,谢谢。
image

你好,我这编译正常了,感谢。

1 Like