NVIDIA Jetson Orin NX- Performance tuning by setting the CPU, GPU, and Frequency values manually
This section provides information on how to manage the number of active CPUs and the CPU, GPU, and External Memory Controller frequencies.
Manage CPU State
The Orin NX will always boot from one CPU denominated the master CPU which cannot be turned off. All other CPUs can be turned off. The CPUs are listed in the directory /sys/devices/system/cpu/ of your Orin AGX, as shown in the following example:
nvidia@ubuntu:~$ ls -v /sys/devices/system/cpu | grep cpu[0-5] cpu0 cpu1 cpu2 cpu3 cpu4 cpu5
Make sure to replace <cpu#> with one of the CPU devices available in your system, for instance, cpu4.
Check the state of a CPU
To check CPU state run the following command. Make sure to replace <cpu#> with one of the CPU devices available in your system, for instance, cpu4:
cat /sys/devices/system/cpu/<cpu#>/online
Turn on a CPU
Run the following command to turn on a slave CPU:
sudo sh -c "echo 1 > /sys/devices/system/cpu/<cpu#>/online"
Turn off a CPU
Run the following command to turn a slave CPU off:
sudo sh -c "echo 0 > /sys/devices/system/cpu/<cpu#>/online"
3D Frequency Scaling
Frequency scaling allows the Tegra to change the CPU frequency according to the load in order to reduce power consumption, 3D frequency scaling is enabled by default.
Disable
To disable 3D frequency scaling run the following command:
sudo sh -c "echo 0 > /sys/devices/17000000.ga10b/enable_3d_scaling"
Enable
To enable 3D frequency scaling run the following command:
sudo sh -c "echo 1 > /sys/devices/17000000.ga10b/enable_3d_scaling"
Change CPU Frequency
To print the CPU lower boundary, upper boundary, and current frequency run the following commands:
CPU=cpu1 #The number can be changed cat /sys/devices/system/cpu/$CPU/cpufreq/cpuinfo_min_freq cat /sys/devices/system/cpu/$CPU/cpufreq/cpuinfo_max_freq cat /sys/devices/system/cpu/$CPU/cpufreq/cpuinfo_cur_freq
To change the CPU upper boundary run the following command:
CPU_FREQ=115200 CPU=cpu1 #The number can be changed sudo sh -c "echo $CPU_FREQ > /sys/devices/system/cpu/$CPU/cpufreq/scaling_max_freq"
To change the CPU lower boundary run the following command:
CPU_FREQ=2265600 CPU=cpu1 #The number can be changed sudo sh -c "echo $CPU_FREQ > /sys/devices/system/cpu/$CPU/cpufreq/scaling_min_freq"
To set the static CPU frequency run the following commands:
CPU_FREQ=2265600 CPU=cpu1 #The number can be changed sudo sh -c "echo $CPU_FREQ > /sys/devices/system/cpu/$CPU/cpufreq/scaling_min_freq" sudo sh -c "echo $CPU_FREQ > /sys/devices/system/cpu/$CPU/cpufreq/scaling_max_freq"
Where CPU_FREQ must be among the values in
/sys/devices/system/cpu/$CPU/cpufreq/scaling_available_frequencies
Change GPU Frequency
To print the GPU lower boundary, upper boundary, and current frequency run the following commands:
cat /sys/devices/17000000.ga10b/devfreq/17000000.ga10b/min_freq cat /sys/devices/17000000.ga10b/devfreq/17000000.ga10b/max_freq cat /sys/devices/17000000.ga10b/devfreq/17000000.ga10b/cur_freq
To change the GPU upper boundary run the following command:
GPU_FREQ=675750000 sudo sh -c "echo $GPU_FREQ > /sys/devices/17000000.ga10b/devfreq/17000000.ga10b/max_freq"
To change the GPU lower boundary run the following command:
GPU_FREQ=114750000 sudo sh -c "echo $GPU_FREQ > /sys/devices/17000000.ga10b/devfreq/17000000.ga10b/min_freq"
To set the static GPU frequency run the following command:
GPU_FREQ=675750000 sudo sh -c "echo $GPU_FREQ > /sys/devices/17000000.ga10b/devfreq/17000000.ga10b/min_freq" sudo sh -c "echo $GPU_FREQ > /sys/devices/17000000.ga10b/devfreq/17000000.ga10b/max_freq"
Where GPU_FREQ is the value available in:
/sys/devices/17000000.ga10b/devfreq/17000000.ga10b/available_frequencies
Change Memory Frequency
sudo sh -c "echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked" sudo sh -c "echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/state" sudo sh -c "echo 665600000 > /sys/kernel/debug/bpmp/debug/clk/emc/rate"
To print the EMC lower boundary, upper boundary, and current frequency run the following commands:
sudo cat /sys/kernel/debug/bpmp/debug/clk/emc/min_rate sudo cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate sudo cat /sys/kernel/debug/bpmp/debug/clk/emc/rate
To change the EMC upper boundary run the following command:
EMC_FREQ=2133000000 sudo sh -c "echo $EMC_FREQ > /sys/kernel/debug/bpmp/debug/clk/emc/max_rate"
To change the EMC lower boundary run the following command:
EMC_FREQ=204000000 sudo sh -c "echo $EMC_FREQ > /sys/kernel/debug/bpmp/debug/clk/emc/min_rate"
To set static EMC frequency run the following commands:
EMC_FREQ=2133000000 sudo sh -c "echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked" sudo sh -c "echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/state" sudo sh -c "echo $EMC_FREQ > /sys/kernel/debug/bpmp/debug/clk/emc/rate"
Where EMC_FREQ in kHz is the value available in:
/sys/kernel/debug/bpmp/debug/emc/tables/regular/