# API for \`nvpmodel\`?

**URL:** <https://forums.developer.nvidia.com/t/api-for-nvpmodel/193159>\
**Category:** Jetson Xavier NX\
**Tags:** kernel\
**Created:** [October 26, 2021, 9:53pm UTC](https://forums.developer.nvidia.com/t/api-for-nvpmodel/193159 "2021-10-26T21:53:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pwolfe1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@pwolfe1](https://forums.developer.nvidia.com/u/pwolfe1)\
**Post date:** [October 26, 2021, 9:53pm UTC](https://forums.developer.nvidia.com/t/api-for-nvpmodel/193159/1 "2021-10-26T21:53:52Z")

</div>

Hello!

I am working on an embedded system running Jetpack on the Xavier NX. I would like to be able to manage the power mode of the device from my C application based on application-level parameters. Is there any way to hook into the underlying API of `nvpmodel` to switch the power mode, or are using the GUI or the `nvpmodel` command line tool the only 2 options (they were all I could find in the documentation)?

Thanks,  
Patrick

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [October 27, 2021, 3:31am UTC](https://forums.developer.nvidia.com/t/api-for-nvpmodel/193159/3 "2021-10-27T03:31:49Z")

</div>

hello pwolfe1,

please check this session, [Supported Modes and Power Efficiency](https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3261/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/power_management_jetson_xavier.html#wwpID0E0XO0HA).  
you’re able to toggle different power modes with the kernel commands,  
thanks

---

<div class="post-metadata">

**Author:** ![pwolfe1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@pwolfe1](https://forums.developer.nvidia.com/u/pwolfe1)\
**Post date:** [October 27, 2021, 3:48am UTC](https://forums.developer.nvidia.com/t/api-for-nvpmodel/193159/4 "2021-10-27T03:48:13Z")

</div>

Hey Jerry! Thanks for the response. Is there an API I can call from C code rather than doing a shell call from my application? I may be missing something (apologies if so) but I only see documentation for `/usr/sbin/nvpmodel` commands and the GUI in that section.

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [October 27, 2021, 6:51am UTC](https://forums.developer.nvidia.com/t/api-for-nvpmodel/193159/5 "2021-10-27T06:51:48Z")

</div>

hello pwolfe1,

you may refer to [exec(3) - Linux manual page](https://man7.org/linux/man-pages/man3/exec.3.html)  
please have a try as following, `exec("/usr/sbin/nvpmodel"...)`

---

<div class="post-metadata">

**Author:** ![linuxdev](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/linuxdev/32/10243_2.png) [@linuxdev](https://forums.developer.nvidia.com/u/linuxdev)\
**Post date:** [October 27, 2021, 4:07pm UTC](https://forums.developer.nvidia.com/t/api-for-nvpmodel/193159/6 "2021-10-27T16:07:22Z")

</div>

Also realize that files in “`/sys`” can be directly opened for read and/or write (depending on the file). No separate shell. You’d simply need to know what files in “`/sys`” the `nvpmodel` program uses, and what arguments might be written.

---

<div class="post-metadata">

**Author:** ![pwolfe1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@pwolfe1](https://forums.developer.nvidia.com/u/pwolfe1)\
**Post date:** [October 27, 2021, 5:57pm UTC](https://forums.developer.nvidia.com/t/api-for-nvpmodel/193159/7 "2021-10-27T17:57:50Z")

</div>

Thanks, this is along the lines of what I’m looking for.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [November 17, 2021, 5:40am UTC](https://forums.developer.nvidia.com/t/api-for-nvpmodel/193159/9 "2021-11-17T05:40:53Z")

</div>

Closed on November 17, 2021, 5:40am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
