NVIDIA Jetson Xavier - Maximizing Performance

From RidgeRun Developer Wiki




Previous: JetPack 5.0.2‎/Performance Tuning/Tuning Power Index Next: Development in the Board






Activate CPUs

By default 4 out of 8 possible CPU cores are disabled on the Jetson Xavier. You can activate them with the following commands (you need root permissions):

sudo su
echo 1 > /sys/devices/system/cpu/cpu4/online
echo 1 > /sys/devices/system/cpu/cpu5/online
echo 1 > /sys/devices/system/cpu/cpu6/online
echo 1 > /sys/devices/system/cpu/cpu7/online
exit

You can also set the nvvpmodel (power model) to the maximum. To see the options:

nvpmodel -p --verbose | grep POWER_MODEL

which outputs:

NVPM VERB: POWER_MODEL: ID=0 NAME=MODE_15W_2CORE
NVPM VERB: POWER_MODEL: ID=1 NAME=MODE_15W_4CORE
NVPM VERB: POWER_MODEL: ID=2 NAME=MODE_15W_6CORE
NVPM VERB: POWER_MODEL: ID=3 NAME=MODE_10W_2CORE
NVPM VERB: POWER_MODEL: ID=4 NAME=MODE_10W_4CORE
NVPM VERB: POWER_MODEL: ID=5 NAME=MODE_10W_DESKTOP
NVPM VERB: POWER_MODEL: ID=6 NAME=MODE_20W_2CORE
NVPM VERB: POWER_MODEL: ID=7 NAME=MODE_20W_4CORE
NVPM VERB: POWER_MODEL: ID=8 NAME=MODE_20W_6CORE

To select the maximum, let's choose the ID=8:

nvpmodel -m 8

Activate Fans

We recommend also turning on the Xavier module fan if you turn on all CPUs:

The method to set the fan speed in JP 4.x is not longer working. You need to, instead, use the nvfancontrol daemon for this purpose: more info here.

However, it sets only to "cool", which is still managed by the temperature sensor in an open loop control. To set the fan at full speed, edit the /etc/nvfancontrol.conf with:

	FAN_PROFILE quiet {
...
	}
	FAN_PROFILE full {
		#TEMP 	HYST	PWM	RPM
		0	8 	255 	6000
		108	0 	255 	6000
	}
	FAN_PROFILE cool {
...
	FAN_DEFAULT_CONTROL open_loop
	FAN_DEFAULT_PROFILE full
	FAN_DEFAULT_GOVERNOR pid

then, execute the following commands:

sudo systemctl stop nvfancontrol
sudo rm /var/lib/nvfancontrol/status
sudo systemctl start nvfancontrol

And that's it.

Another observation: the monitor from jetson-stats (a.k.a. jtop) does not work with the fan :(

You must activate all CPUs before running jetson_clocks to overclock these CPUs too.

VIC clocking

By default, Jetson clocks command does not activate the full clock in VIC. To manually set them to the maximum clock (Jetson), first inspect which one is the highest:

cat /sys/devices/platform/13e10000.host1x/15340000.vic/devfreq/15340000.vic/available_frequencies

In the case of Jetson NX, it is: 601600000 Hz.

Then, set the manual control of the VIC:

# Set manual control to the max frequency
echo on > /sys/devices/platform/13e10000.host1x/15340000.vic/power/control
echo userspace > /sys/devices/platform/13e10000.host1x/15340000.vic/devfreq/15340000.vic/governor
echo 601600000 > /sys/devices/platform/13e10000.host1x/15340000.vic/devfreq/15340000.vic/max_freq
echo 601600000 > /sys/devices/platform/13e10000.host1x/15340000.vic/devfreq/15340000.vic/userspace/set_freq

# Current freq
cat /sys/devices/platform/13e10000.host1x/15340000.vic/devfreq/15340000.vic/cur_freq

Note: for JP 4.x, change /sys/devices/platform/13e10000.host1x by /sys/devices/13e10000.host1x

Jetson Clocks

Xavier provides the jetson_clocks script to maximize Jetson Xavier performance by setting static max frequency to CPU, GPU, and EMC clocks. The script can also be used to show current clock settings, store current clock settings into a file, and restore clock settings from a file.

Options

Usage:
jetson_clocks [options]
  options,
  --help, -h         show this help message
  --show             display current settings
  --fan              set PWM fan speed to maximal
  --store [file]     store current settings to a file (default: ${HOME}/l4t_dfs.conf)
  --restore [file]   restore saved settings from a file (default: ${HOME}/l4t_dfs.conf)
  run jetson_clocks without any option to set static max frequency to CPU, GPU and EMC clocks.
  • To show the current settings:
sudo jetson_clocks --show
  • To store the current settings:
sudo jetson_clocks --store
  • To maximize Jetson Xavier performance
sudo jetson_clocks
  • To restore the previous settings
sudo jetson_clocks --restore



Previous: JetPack 5.0.2‎/Performance Tuning/Tuning Power Index Next: Development in the Board