JetsonHacks

Developing on NVIDIA® Jetson™ for AI on the Edge

NVPModel – NVIDIA Jetson TX2 Development Kit

The introduction of the Jetson TX2 Development Kit brings with it the introduction of the new command line interface nvpmodel tool.

Background

Applications for the Jetson Tegra systems cover a wide range of performance and power requirements. As the Jetson family has become more sophisticated over the years, power and performance management is becoming an increasingly important issue.

Fortunately, NVIDIA is providing a new command line tool which takes out a lot of the guess work in configuring the CPU and GPU settings to maximize performance and energy usage under different scenarios.

There are natural performance/energy points which provide the best performance for the minimal amount of energy. NVIDIA has done the heavy lifting and done the calculations to figure out which of the core and clock frequencies provide the best performance for the energy budget.

Remember that the Jetson TX2 consists of a GPU along with a CPU cluster. The CPU cluster consists of a dual-core Denver 2 processor and a quad-core ARM Cortex-A57, connected by a high-performance coherent interconnect fabric. With 6 CPU cores and a GPU, you can understand how the average developer benefits by not having to run all the performance/energy tests themselves.

On the Jetson Tegra, CPUs may be online or offline (except CPU0, which is always on for obvious reasons). CPUs have minimum frequencies and maximum frequencies.

Usage

Nvpmodel introduces five different “modes” on the Jetson TX2. The following table breaks down the modes, which CPU cores are used, and the maximum frequency of the CPU and GPU being used.

nvpmodel mode definition

ModeMode NameDenver 2FrequencyARM A57FrequencyGPU Frequency
0Max-N22.0 GHz42.0 GHz1.30 Ghz
1Max-Q0 41.2 Ghz0.85 Ghz
2Max-P Core-All21.4 GHz41.4 GHz1.12 Ghz
3Max-P ARM0 42.0 GHz1.12 Ghz
4Max-P Denver12.0 GHz12.0 GHz1.12 Ghz

Max-Q mode provides equivalent performance to a Jetson TX1 at full clock modes, while Max-N provides almost twice the performance. This is due to a variety of factors, not just clock speeds. For example, the Jetson TX2 has a 128-bit wide memory bus versus the 64-bit wide TX1.

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 1

places the Jetson into Max-Q 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.

Conclusion

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

Facebook
Twitter
LinkedIn
Reddit
Email
Print

19 Responses

  1. “sudo nvpmodel -q –verbose” should be “sudo nvpmodel -q –-verbose”

    Thank you very much for this helpful article.

  2. How does the nvpmodel relate to the jetson_clocks.sh? It looks like you can use nvpmodel to enable all cores and then jetson_clocks.sh to set them all to max freq?
    Aside from power consumption is there a reason why it would be a bad idea to have a mode that enables all cpus and sets the min_freq of all cores to the max_freq value like jetson_clocks.sh does?

    1. My understanding is that nvpmodel is suited towards the power/performance curve of each combination of cores. This is for the case where cranking the clocks to the max frequency has a detrimental effect with regards to power usage while not providing much more performance.

      Running with jetson_clocks.sh should have a minimal detrimental effect on the life of the processor. The idea behind nvpmodel is to maximize the performance/power curve at both the high end and the low end of power consumption. Thanks for reading!

  3. I’m running R28.2-DP on my TX2, and nvpmodel -m4 leads to CPU0 and CPU1 to be online and displayed by /proc/cpuinfo, while the table here says only Denver cores (CPU1 and CPU2).
    Am I missing something ?
    Thanks

    1. I do not think you are missing anything. I believe that the table above lists what it is supposed to be, with maybe the exception that CPU0 is always online. There are plausible explanations:

      This could be for several reasons:

      • CPU0 is Denver in Mode 4 but is reported incorrectly.
      • CPU0, CPU1, and CPU2 are all on, but /proc/cpuinfo does not reflect it accurately
      • nvpmodel does not set the 2 Denver cores up correctly

      The only way to know is to ask NVIDIA for a clarification. The documentation for this tool is rather sparse. Thanks for reading!

      1. Looking at /etc/nvpmodel.conf, indeed CPU0 is never shutdown, and MAXP_CORE_DENVER mode only sets CPU1:

        CPU_ONLINE CORE_1 1
        CPU_ONLINE CORE_2 0
        CPU_ONLINE CORE_3 0
        CPU_ONLINE CORE_4 0
        CPU_ONLINE CORE_5 0

        1. CPU0 handles all the hardware interrupts, so I would not be surprised if it is hardwired and expected to always be “online” with special handling for wakeup on interrupt. I’m not quite sure about what to think about the 2 Denver cores, or where lies the discrepancy.

          1. The doc from R28.2 says MAXP_CORE_DENVER mode enables CPU0 and CPU1 only.
            The table here may be updated.

            1. I just noticed the same thing and Honey Patoucel is right.
              The table is not correct since ‘nvpmodel -m 4` enables the CPU0 ARM57 and only one DENVER core, the CPU1.

              1. I think of these Denver cores as of an unsuccesful experiment and including them instead of normal arm serves to save some manager’s ass. They’re weaker than arm cores so no other reason to exist.

  4. There is an error in the table with model 4. The ARM processor does not run on 2GHz he runs only on 345kHz. That shows my nvpmodel configuration.

  5. What does Q, N and P mean in the naming? Which mode would I take if I want as little throttling as possible and I don’t care about power consumption? If I just need max performance?

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