Jetson/Performance

From eLinux.org
< Jetson
Revision as of 08:12, 8 August 2014 by Shervin.emami (talk | contribs) (Moved the performance related sections here from the power page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction

This page discusses various Tegra CPU & GPU performance topics. The power draw of the Tegra processor and the overall embedded board are very tightly related to the performance of the Tegra processor, so you will often want to choose carefully between which things should be running at high performance settings (for max speed) and which should be running at low performance settings (for low power draw & heat) or disabled completely. Read the power draw page for more details.

Controlling the performance

Note: Debugfs and non-upstream sysfs nodes aren't guaranteed to remain unchanged in future L4T releases.

Tegra K1 is designed for mobile use-cases and thus contains a significant number of power reduction systems to control when parts of the hardware should run faster or slower or be turned off, based on runtime use. This is good for most use cases, since the default settings will give high performance for many intense projects and low power draw for many light tasks. But you might want to force a lower or higher performance of some parts of the hardware such as to run benchmarks of the peak performance or enforce lower power draw.

How to run a command with root privileges temporarily or on every bootup

There are various commands listed below that you can run to reduce or increase the performance or power draw, and they must be executed with root privileges. To execute some of the commands with root privileges just until you reboot your device, you can simply run "su" to login as root user, run the commands, then run "exit" to return to regular user, eg:

sudo su
    (enter your password, typically "ubuntu" by default)
    # Run a command that requires root privileges
    echo Hello > /TEST.txt
    exit

To execute commands automatically on every bootup, you can put your commands into the "/etc/rc.local" bootup script. For example, run this on your board:

sudo nano /etc/rc.local

Then add this near the bottom of the file but before the "exit" line:

# Disable USB auto-suspend, since it disconnects some devices such as webcams on Jetson TK1.
echo -1 > /sys/module/usbcore/parameters/autosuspend 

Save the file by hitting Ctrl+X then Y then Enter, then reboot the device:

sudo reboot

Restricting to low-power core only

Restricting the CPU to the low-power companion core can significantly reduce peak power (if running on a power-limited battery pack, for example). The 5th companion core in Tegra K1 is still a Cortex-A15 core with NEON and 32KB L1 cache and 512KB L2 private cache, but obviously at lower performance than the 4 main cores. To use just the low-power core, run this as root:

echo 0 > /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable
echo LP > /sys/kernel/cluster/active

Maximizing CPU performance

Or you might want to disable CPU scaling and force the 4 main CPU cores to full performance:

echo 0 > /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable
echo 1 > /sys/devices/system/cpu/cpu0/online
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu2/online
echo 1 > /sys/devices/system/cpu/cpu3/online
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Controlling GPU performance

To manually control the clock frequencies of the GPU, first determine the rates supported (listed by sysfs in kHz):

 cat /sys/kernel/debug/clock/gbus/possible_rates
 72000 108000 180000 252000 324000 396000 468000 540000 612000 648000 684000 708000 756000 804000 852000 (kHz)

Then set a rate (eg. the maximum of 852000kHz), specified in Hz:

 echo 852000000 > /sys/kernel/debug/clock/override.gbus/rate
 echo 1 > /sys/kernel/debug/clock/override.gbus/state

Finally verify the rate:

 cat /sys/kernel/debug/clock/gbus/rate
 852000

The gbus sysfs nodes control the GPU's core clock. To control the GPU's memory clock, substitute emc for gbus.