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
Mode | Mode Name | Denver 2 | Frequency | ARM A57 | Frequency | GPU Frequency |
---|---|---|---|---|---|---|
0 | Max-N | 2 | 2.0 GHz | 4 | 2.0 GHz | 1.30 Ghz |
1 | Max-Q | 0 | 4 | 1.2 Ghz | 0.85 Ghz | |
2 | Max-P Core-All | 2 | 1.4 GHz | 4 | 1.4 GHz | 1.12 Ghz |
3 | Max-P ARM | 0 | 4 | 2.0 GHz | 1.12 Ghz | |
4 | Max-P Denver | 1 | 2.0 GHz | 1 | 2.0 GHz | 1.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.
19 Responses
“sudo nvpmodel -q –verbose” should be “sudo nvpmodel -q –-verbose”
Thank you very much for this helpful article.
You’re welcome, and thanks for the heads up. The HTML monster ate the extra dash, I had to trick it by putting it in a disguise. Thanks for reading!
Any way to get nvpmodel running on the TX1?
Not that I know of, NVIDIA only has it on the Jetson TX2.
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?
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!
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
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:
The only way to know is to ask NVIDIA for a clarification. The documentation for this tool is rather sparse. Thanks for reading!
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
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.
The doc from R28.2 says MAXP_CORE_DENVER mode enables CPU0 and CPU1 only.
The table here may be updated.
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.
Updated! Thanks @Honey_Patouceul and @Myzhar
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.
You can either additionally launch a node with the ZED wrapper, or create/modify one which launches which nodes you require.
What is the default mode for TX2
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.
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?