JetsonHacks

Developing on NVIDIA® Jetson™ for AI on the Edge

NVPModel – NVIDIA Jetson AGX Xavier Developer Kit

You can use the command line tool nvpmodel to set the performance and energy usage characteristics of the NVIDIA Jetson AGX Developer Kit. Looky here:

Background

With the introduction of the Jetson TX2, the command line tool nvpmodel brought the ability to define a set of parameters to effectively define the performance for a given power envelope.

Jetson Tegra systems cover a wide range of performance and power requirements. Balancing the performance and power requirements is an important part of most product development cycles. Fortunately, NVIDIA has done the heavy lifting and done the calculations to figure out which processing components provide the best performance for a given energy budget in multiple configurations. At the very least, these configurations provide a great start to developing your own tuned configuration.

On the TX2, nvpmodel defines the number of CPUs on line and their clock frequencies, the GPU frequency, and the External Memory Controller (EMC) frequency. Remember that the EMC controls the speed of access to the external LPDDR4 memory.

The Jetson AGX Xavier is a much richer computing environment than the Jetson TX2. In addition to adding 4 more CPU cores, the Xavier adds Deep Learning Accelerators (DLA) and Visual Accelerators (VA). These new additions can also be configured with nvpmodel! nvpmodel defines 4 different power envelopes in 7 different modes. The power envelopes are 10 Watt, 15 Watt, 30 Watt, and “Forget power usage, speed is what I need!”.

Configuration

nvpmodel introduces seven different “modes” on the Jetson AGX Xavier. The following table breaks down the modes which describe which CPU, GPU, DLA and VA cores to use along with their clock frequency, and the memory controller frequency.

NVPMODEL CLOCK CONFIGURATION

Mode NameEDP10W15W30W30W30W30W
MAXNMODE_10WMODE_15WMODE_30W_ALLMODE_30W_6COREMODE_30W_4COREMODE_30W_2CORE
Power Budgetn/a10W15W30W30W30W30W
Mode ID0123456
Number of Online CPUs8248642
CPU Maximal Frequency
(MHz)
2265.6120012001200145017802100
GPU TPC4244444
GPU Maximal Frequency
(MHz)
1377520670900900900900
DLA Cores2222222
DLA Maximal Frequency
(MHz)
1395.25507501050105010501050
Vision Accelerator (VA) cores2011111
VA Maximal Frequency
(MHz)
10880550760760760760
Memory Maximal Frequency
(MHz)
2133106613331600160016001600
The default mode is 15W (MODE_15W, ID:2)

Table Abbreviation Notes:

  • GPU TPC – GPU Texture/Processor Cluster
  • DLA – Deep Learning Accelerator
  • VA – Vision Accelerator

Usage

To call nvpmodel:

$ sudo nvpmodel -m [mode]

where mode is the number of the mode that you want to use. For example:

$ sudo nvpmodel -m 0

places the Jetson into MAXN mode.

You can query which mode is currently being used:

$ sudo nvpmodel -q –verbose

The file /etc/nvpmodel.conf holds the different models. Developers can add their own models to add different modes suitable to their application.

Note: nvpmodel settings are persistent across sessions. That is, if the Xavier reboots, the nvpmodel settings remain in effect.

jetson_clocks.sh

If you have been developing on previous Jetson models, you probably are familiar with the script jetson_clocks.sh. On the Jetson Xavier, jetson_clocks.sh provides the best performance for the current nvpmodel mode. The nvpmodel configuration defines maximum and minimum clock values for any given mode, jetson_clocks.sh adjusts the clock value to the maximum value, and disables the Dynamic Voltage and Frequency Scaling (DFVS) governor. Oh, and sometimes adjusts the fan value when you decide to run flat out.

jetson_clocks.sh can also show the current settings for the CPU, GPU and EMC. This includes which cores are online, the minimum and maximum frequencies, and the current frequency.

$ sudo ${HOME}/jetson_clocks.sh –show

Note: If you are in the home directory, of course you can just use:

$ sudo ./jetson_clocks.sh –show

You can store the current clock settings for later use into a file using the store option. The restore option uses the file to set the clocks to the saved value.
To maximize the current mode performance for the Xavier:

$ sudo ${HOME}/jetson_clocks.sh –show

Note: The effects of jetson_clocks.sh is not persistent across sessions. In other words, if the machine reboots the previous jetson_clocks.sh settings are not in place.

Maximum Performance

To configure the Jetson Xavier and set the clocks for maximum performance:

$ sudo nvpmodel -m 0
$ sudo ${HOME}/jetson_clocks.sh

Conclusion

Using nvpmodel provides developers with a nice tool set to easily setup different energy usage and performance scenarios. Recommended.

Notes

Note: The mode names in the nvpmodel configuration file:

  • MAXN
  • MODE_10W
  • MODE_15W
  • MODE_30W_ALL
  • MODE_30W_6CORE
  • MODE_30W_4CORE
  • MODE_30W_2CORE

The table derives from a NVIDIA webinar given by Dustin Franklin. The notes for the webinar are available on Github.

Facebook
Twitter
LinkedIn
Reddit
Email
Print

4 Responses

  1. Thank you for your extremely helpfull videos, and particularly this one and the blog post!
    I have a question: is there a way to revert the effect of jetson_clocks.sh without rebooting? Fan is really load.

    1. Not that I know of other than to set the files directly (see the jetson_clocks script). However, remember why the fan is on in the first place; everything is going flat out and needs to be cooled.

      1. Thank you for your answer!

        I saved configuration with $ sudo ./jetson_clocks.sh –store default_clocks.cfg right after reboot, so that next time I can restore defaults from this file with $ sudo ./jetson_clocks.sh –restore default_clocks.cfg

        Do you think it’s a good idea to share this file with default configuration?

        Kind regards,
        Peter

Leave a Reply

Your email address will not be published. Required fields are marked *

Disclaimer

Some links here are affiliate links. If you purchase through these links I will receive a small commission at no additional cost to you. As an Amazon Associate, I earn from qualifying purchases.

Books, Ideas & Other Curiosities