Hi, I’m trying out the PREEMPT-RT(4.9.140-rt93) kernel that comes with the L4T Driver Package (BSP) Sources (R32.4.2).
The patch worked fine, and I found little trouble running real-time programs on Jetson AGX Xavier.
However when I try to use the nvpmodel -m{option} command to change the power settings, the board freezes immediately, and I have to restart the board manually.
It appears that out of the 7 options provided with nvpmodel.conf in /etc/nvpmodel.conf, only two of them are working correctly. The working ones are options 0 and 3, both of which do not turn off any of the Denver CPU cores completely. Other options result in board freeze.
I am guessing that the issue occurs when I try to shut down an entire Denver core.
For example, I tried turning off cpu0 and cpu1 separately, which worked fine.
(okay) echo 1 > /sys/devices/system/cpu/cpu0/online echo 0 > /sys/devices/system/cpu/cpu1/online
(okay) echo 0 > /sys/devices/system/cpu/cpu0/online echo 1 > /sys/devices/system/cpu/cpu1/online
However, if I try to turn both of them off, the board once again freezes.
(not okay) echo 0 > /sys/devices/system/cpu/cpu0/online echo 0 > /sys/devices/system/cpu/cpu1/online
Turning off cores from different Denver module was okay.
(okay) echo 0 > /sys/devices/system/cpu/cpu0/online echo 0 > /sys/devices/system/cpu/cpu2/online
For a non-RT (vanilla) AGX Xavier, all nvpmodel options were functioning correctly.
I do not think this behavior is related directly to PREEMPT-RT, since the problem only happens within a Denver module.
Is there a fix for this behavior?
However when it hangs during booting,
it gets stuck somewhere between [ 20.107172] CPU4: shutdown and [ 20.550680] psci: CPU7 killed.,
which is exactly the same problem I get when using nvpmodel -m{option}.
It’s funny that every time I need to restart, I have to rely on chance and press reboot several times to get all 4 cores down.
Carolyuu, Wayne, thank you for having interest in this issue, it is helping me a lot.
I tried as carolyuu’s suggested, but this time the board would not boot at all.
...
[ OK ] Started crash report submission daemon.
Starting Tool to automatically collect and submit kernel crash signatures...
Starting Ubuntu FAN network setup...
Starting Permit User Sessions...
[FAILED] Failed to start nvpmodel service.
See 'systemctl status nvpmodel.service' for details.
[ OK ] Started containerd container runtime.
...
Maybe I am still applying the rt-patch the wrong way.
Please point out the error if I’m doing something differently.
I flashed the board with the image created from the latest driver package and root file system:
(Driver Package)
$ wget https://developer.nvidia.com/embedded/L4T/r32_Release_v4.3/t186ref_release_aarch64/Tegra186_Linux_R32.4.3_aarch64.tbz2
$ sudo tar -xf Tegra186_Linux_R32.4.3_aarch64.tbz2
(RootFileSystem R32.4.3)
$ wget https://developer.nvidia.com/embedded/L4T/r32_Release_v4.3/t186ref_release_aarch64/Tegra_Linux_Sample-Root-Filesystem_R32.4.3_aarch64.tbz2
$ sudo tar -xf Tegra_Linux_Sample-Root-Filesystem_R32.4.3_aarch64.tbz2 -C $HOME/nvidia/Linux_for_Tegra/rootfs
$ cd $HOME/nvidia/Linux_for_Tegra
$ sudo ./apply_binaries.sh
After that I followed carolyuu’s guide to replace the kernel image:
For this, I used the latest public source r32.4.3.
I tried as you suggested, but booting stops due to load kernel error.
...
[FAILED] Failed to start Load Kernel Modules.
See 'systemctl status systemd-modules-load.service' for details.
...
Maybe this is because grub is loading a wrong kernel image? export LOCALVERSION=-tegra
Do I need to change any settings in the rootfs or in the bootloader to correctly load the kernel image?
The only thing I did was ./apply_bianaries.sh in the DriverPackage, and ./scripts/rt-patch.sh apply-patches in the rt public source, then compile and copy image as written above.
Thanks! Problem solved after copying the new modules.
nvpmodel now works for all modes! (needs reboot for certain modes)
Although it works well now, it will be very helpful to me, if you could elaborate why the problem happened for my initial case.
As I see it, by applying rt patch using ./scripts/rt-patch.sh apply-patches as you suggested, the kernel config is set as: