No display with PREEMPT_RT patches

After applying the PREEMPT_RT patches to the Jetson Linux 35.1 and flashing to the Orin dev kit the DP display no longer works. I tried to follow all the steps in the dev guide (Kernel Customization — Jetson Linux<br/>Developer Guide 34.1 documentation) as well as forum posts

Here are the steps I have used to build and flash the kernel.

ROOT=$PWD
JETSON="Jetson_Linux_R35.1.0_aarch64.tbz2"
SOURCES="public_sources.tbz2"
ROOTFS="Tegra_Linux_Sample-Root-Filesystem_R35.1.0_aarch64.tbz2"
TOOLCHAIN="aarch64--glibc--stable-final.tar.gz"
TOOLCHAIN_DIR=$ROOT/l4t-gcc

tar -xjf $JETSON

cd $ROOT/Linux_for_Tegra/rootfs
sudo tar -xjf $ROOT/$ROOTFS

cd $ROOT
tar -xjf $SOURCES

mkdir -p $TOOLCHAIN_DIR
tar -xzf $TOOLCHAIN -C $TOOLCHAIN_DIR

export CROSS_COMPILE_AARCH64_PATH=$TOOLCHAIN_DIR
export CROSS_COMPILE_AARCH64=$TOOLCHAIN_DIR/bin/aarch64-buildroot-linux-gnu-

cd $ROOT/Linux_for_Tegra/source/public
tar -xjf kernel_src.tbz2

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

mkdir -p kernel_out
./nvbuild.sh -o $PWD/kernel_out

cd $ROOT/Linux_for_Tegra
sudo ./apply_binaries.sh

cd $ROOT/Linux_for_Tegra
sudo cp source/public/kernel_out/drivers/gpu/nvgpu/nvgpu.ko rootfs/usr/lib/modules/5.10.104-tegra/kernel/drivers/gpu/nvgpu/nvgpu.ko
cp -r source/public/kernel_out/arch/arm64/boot/dts/nvidia/* kernel/dtb/.
cp -r source/public/kernel_out/arch/arm64/boot/Image kernel/Image

cd $ROOT/Linux_for_Tegra/source/public/kernel_out
sudo make INSTALL_MOD_PATH=$ROOT/Linux_for_Tegra/rootfs O= modules_install

cd $ROOT/Linux_for_Tegra/source/public
tar -xjf nvidia_kernel_display_driver_source.tbz2
cd NVIDIA-kernel-module-source-TempVersion

export LOCALVERSION="-tegra"
export IGNORE_PREEMPT_RT_PRESENCE=1
make \
    modules -j4 \
    SYSSRC=$ROOT/Linux_for_Tegra/source/public/kernel/kernel-5.10 \
    SYSOUT=$ROOT/Linux_for_Tegra/source/public/kernel_out \
    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

DRIVER_DIR=$ROOT/Linux_for_Tegra/rootfs/lib/modules/5.10.104-rt63-tegra/extra/opensrc-disp
sudo mkdir -p $DRIVER_DIR
cd $ROOT/Linux_for_Tegra/source/public/NVIDIA-kernel-module-source-TempVersion/kernel-open
sudo cp nvidia-modeset.ko nvidia.ko nvidia-drm.ko $DRIVER_DIR

cd $ROOT/Linux_for_Tegra
sudo ./flash.sh jetson-agx-orin-devkit mmcblk0p1

The kernel module dependency file is not updated with the display driver kernel modules copied to $DRIVER_DIR. It is possible to generate an updated dependency file on the host computer but I haven’t figured it out how to do it with depmod command. The other solution is to do the update on the target system as shown in the following steps.

  1. Follow the instruction in NVIDIA Jetson Orin - Serial Console to access the serial console connection via the micro usb-c port.
  2. Login in the serial console with the username and password created
  3. Run the command, sudo depmod -a, in the serial console to generate an updated module dependency file
  4. Restart the target system by pressing the reset button.

The target system should display ubuntu desktop GUI properly on the connected monitor after restart.

Thanks @wai.kwok.law. That was exactly the problem. After running the command sudo depmod -a and restarting the display came up and is now working with the RT kernel.

Thanks again for the help!!

I was able to update the dependency file on the host computer by looking at how the nv-apply-debs.sh script installs deb packages. Just running depmod -a with QEMU didn’t work as it still finds the kernel version of the host system. However, by using the -F option with the System.map file from the kernel_out directory and specifying the target kernel version the dependency file was updated and the display worked after flashing. The System.map file will need to be copied to Linux_for_Tegra/rootfs so it can be found after executing the chroot command.

Below are the steps I used to run depmod on the host computer.

echo "Installing QEMU binary in rootfs"
L4T_ROOTFS_DIR="$ROOT/Linux_for_Tegra/rootfs"
sudo cp "${KERNEL_OUT}/System.map" ${L4T_ROOTFS_DIR}
QEMU_BIN="/usr/bin/qemu-aarch64-static"
sudo install --owner=root --group=root "${QEMU_BIN}" "${L4T_ROOTFS_DIR}/usr/bin/"
pushd ${L4T_ROOTFS_DIR}
LC_ALL=C sudo chroot . depmod -a -F System.map 5.10.104-rt63-tegra
popd
echo "Removing QEMU binary from rootfs"
sudo rm -f "${L4T_ROOTFS_DIR}/usr/bin/qemu-aarch64-static"

Hope this helps.

1 Like

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