Jeston Xavier NX boot time optimization

Hi, everyone,

I just upgraded R35.3.1 as part of Jetpack 5.1.1 on the NX, but i found the NX boot time was too much.

The first step, systemd-analyze

Startup finished in 8.841s (kernel) + 16.506s (userspace) = 25.348s
graphical.target reached after 16.432s in userspace

Second step, i found dmesg

[   16.496885] zram: Added device: zram0
[   16.497834] zram: Added device: zram1
[   16.502652] zram: Added device: zram2
[   16.507019] zram: Added device: zram3
[   16.628290] zram0: detected capacity change from 0 to 898744320
[   16.714184] Adding 877676k swap on /dev/zram0.  Priority:5 extents:1 across:8
77676k SS
[   16.718299] zram1: detected capacity change from 0 to 898744320
[   16.766179] Adding 877676k swap on /dev/zram1.  Priority:5 extents:1 across:8
77676k SS
[   16.768275] zram2: detected capacity change from 0 to 898744320
[   16.810178] Adding 877676k swap on /dev/zram2.  Priority:5 extents:1 across:8
77676k SS
[   16.714184] Adding 877676k swap on /dev/zram0.  Priority:5 extents:1 across:8
77676k SS
[   16.718299] zram1: detected capacity change from 0 to 898744320
[   16.766179] Adding 877676k swap on /dev/zram1.  Priority:5 extents:1 across:8
77676k SS
[   16.768275] zram2: detected capacity change from 0 to 898744320
[   16.810178] Adding 877676k swap on /dev/zram2.  Priority:5 extents:1 across:8
77676k SS

[   16.812063] zram3: detected capacity change from 0 to 898744320
[   16.858266] Adding 877676k swap on /dev/zram3.  Priority:5 extents:1 across:8
77676k SS
[   25.045521] fuse: init (API version 7.32)

[   25.095205] tegradc 15200000.display: blank - powerdown
[   25.095224] tegradc 15210000.display: blank - powerdown
[   25.305029] nvidia: loading out-of-tree module taints kernel.
[   25.320396] NVRM: No NVIDIA GPU found.
[   39.906277] vdd-1v8-sd: disabling
[   39.906320] vdd-3v3-cvb: disabling
[   39.906333] vdd-1v8-cvb: disabling
[   39.906345] vdd-epb-1v0: disabling
[   39.906356] vdd-fan: disabling
[   39.906470] vdd_sys_en: disabling

Note:

[ 16.858266] Adding 877676k swap on /dev/zram3. Priority:5 extents:1 across:8
77676k SS
[ 25.045521] fuse: init (API version 7.32)

I want to know what happened and how to reduce these 8s.

Thank you,
Best regards,
Ultwcz1997

Hi ultwcz1997,

Are you using the devkit or custom board for Xavier NX?
Could you verify with the latest JP5.1.2(R35.4.1)?
There should be 4s boot time improved in UEFI.

It seems there’s other module init during this time.
Could you share the full dmesg as file here for further check?

Hi @KevinFFF:

Thank you.

Are you using the devkit or custom board for Xavier NX?

the devkit

Could you verify with the latest JP5.1.2(R35.4.1)?

Not yet, i will test for a later time. But now i want to know what happened at Userspace’s service

Full log
nx-log.txt (60.4 KB)

And plot service, it seems `nvphs.service costs about 7s

Hi @KevinFFF

Today i flashed r35.4.1 as part of Jetpack 5.1.2, but the problem still existed. the Userspace time is about 15s, i don’t know whether this value is correct, because i found the log time which in dmesg changed from [14.420112] to [27.430187] as the following

[   10.344538] systemd[1]: Finished Create System Users.
[   10.348439] systemd[1]: Finished Load Kernel Modules.
[   10.350062] systemd[1]: Condition check resulted in FUSE Control File System being skipped.
[   10.355361] systemd[1]: Mounting Kernel Configuration File System...
[   10.360536] systemd[1]: Started OP-TEE Client Supplicant.
[   10.367590] systemd[1]: Starting Apply Kernel Variables...
[   10.372477] systemd[1]: Starting Create Static Device Nodes in /dev...
[   10.380248] systemd[1]: Mounted Kernel Configuration File System.
[   10.477007] random: crng init done
[   10.477389] random: 44 urandom warning(s) missed due to ratelimiting
[   12.210146] imx219 9-0010: imx219_board_setup: error during i2c read probe (-121)
[   12.230752] imx219 9-0010: board setup failed
[   12.230976] imx219: probe of 9-0010 failed with error -121
[   12.245123] imx219 10-0010: imx219_board_setup: error during i2c read probe (-121)
[   12.253276] imx219 10-0010: board setup failed
[   12.253501] imx219: probe of 10-0010 failed with error -121
[   12.502157] using random self ethernet address
[   12.502310] using random host ethernet address
[   14.419870] using random self ethernet address
*** [   14.420112] using random host ethernet address
*** [   27.430187] CPU4: shutdown
[   27.492779] CPU5: shutdown
[   30.027585] nvidia: loading out-of-tree module taints kernel.

Ubuntu 20.04.6 LTS ubuntu ttyTCU0

ubuntu login: 

Full log
test-nx.txt (61.3 KB)

BTW, systemd-analyze

Startup finished in 8.839s (kernel) + 15.692s (userspace) = 24.531s
graphical.target reached after 14.965s in userspace

Thank you.

Hi, @KevinFFF

Is what I mentioned above a common phenomenon for Jetson Xavier NX, after I used the same version on the Jetson Orin NX 16GB, it didn’t take much time to boot the Userspace service.

I hope you can answer my question very much. I have tried to disable many services, such as nvpsh.service alsa*.service nv-l4t-bootloader-config.service kerneloop.service, and so on, but none of them solved where the extra 7~8 seconds was spent. Thank you very much.

For Jetson Orin NX
systemd-analyze

Startup finished in 10.048s (kernel) + 7.279s (userspace) = 17.328s
graphical.target reached after 7.207s in userspace

systemd-analyze blame

2.289s alsa-restore.service                  
1.216s dev-nvme0n1p1.device                  
1.019s nvpmodel.service                      
 998ms nv.service                            
 841ms accounts-daemon.service               
 829ms nv-l4t-usb-device-mode.service        
 817ms avahi-daemon.service                  
 739ms bluetooth.service                     
 675ms apport.service                        
 654ms NetworkManager.service                
 542ms polkit.service                        
 515ms dev-hugepages.mount                   
 503ms dev-mqueue.mount                      
 495ms run-rpc_pipefs.mount                  
 487ms sys-kernel-debug.mount                
 483ms sys-kernel-tracing.mount              
 459ms keyboard-setup.service                
 451ms kmod-static-nodes.service             
 449ms systemd-logind.service                
 439ms modprobe@chromeos_pstore.service      
 431ms nv-l4t-bootloader-config.service      
 418ms modprobe@efi_pstore.service           
 415ms modprobe@pstore_blk.service           
 411ms modprobe@pstore_zone.service          
 407ms modprobe@ramoops.service              
 404ms systemd-udev-trigger.service          
 400ms binfmt-support.service                
 399ms nvfb-udev.service                     
 396ms kerneloops.service     

Compare for Jetson Xavier NX
systemd-analyze

Startup finished in 8.312s (kernel) + 15.393s (userspace) = 23.706s
graphical.target reached after 14.697s in userspace

systemd-analyze blame

7.685s nvphs.service                         
7.345s nv-l4t-bootloader-config.service      
3.723s dev-mmcblk0p1.device                  
3.395s nv-l4t-usb-device-mode.service        
1.847s systemd-udev-trigger.service          
1.687s avahi-daemon.service                  
1.635s networkd-dispatcher.service           
1.365s apport.service                        
1.305s snapd.service                         
1.300s NetworkManager.service                
1.220s nvpower.service                       
1.209s udisks2.service                       
1.171s accounts-daemon.service               
1.044s resolvconf-pull-resolved.service      
1.027s nv.service                            
 953ms systemd-logind.service                
 953ms polkit.service                        
 803ms e2scrub_reap.service                  
 790ms wpa_supplicant.service                
 670ms nvpmodel.service                      
 636ms nv_nvsciipc_init.service              
 604ms nvfb-early.service                    
 521ms snapd.seeded.service                  
 511ms systemd-resolved.service              
 507ms user@124.service                      
 500ms user@1000.service                     
 498ms systemd-journald.service              
 463ms pppd-dns.service                      
 438ms kerneloops.service

This service could not be disabled because it is used for marking the boot complete and interacting with the bootloader.

Yes, your current result seems expected as my setup.

You could also check the /var/log/syslog for more details during boot up.
It seems it’s doing several configurations for network and GDM.

Hi, @KevinFFF

Sorry, I can’t find the answer to my problem, so I decided to give up.

Thank you.

You could also update to the latest R35.4.1.
There should be 4s boot time improvement from bootloader (UEFI).

Hi @KevinFFF,
I am sorry to reply later, I will update it, but I still expect to reduce userspace time. Because I found the TX2 and the Orin NX’s userspace time is too short compared to Xavier NX.

TX2 uses R32 and Orin NX uses R35.
There are many differences from the design and architecture.
You could also configure the kernel config to remove the unused modules.

Hi, @KevinFFF

Thank you for your reply, I will close this topic.

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