How to set a custom power consumption mode as the default mode

How do I configure a custom power consumption mode as the default in an image?
When compiling the image, I add custom power consumption mode 2 to the /etc/nvpmodel.conf file, set PM_CONFIG DEFAULT=2, and install it as a separate deb package patch into the image.

However, after the device is flashed and booted, the system power consumption mode remains 1 (120W). The custom power consumption mode only takes effect using the command nvpmodel -m 2. How can I use the custom power consumption mode by default when building the image?

Are you sure the nvpmodel content in this situation is really that one you want to use?
Are you sure nvpmodel behavior follows what you want before you reflash?

The following details are provided.

  1. Customize your flashing image based on the Thor SDK. The default setting is 120W, with PM_CONFIG DEFAULT=1.
  2. Add custom power mode 2 (60W) to the nvpmodel_p3834_0008.conf file and set PM_CONFIG DEFAULT=2.
    /etc/nvpmodel.conf → /etc/nvpmodel/nvpmodel_p3834_0008.conf
  3. Create a deb package for the second step and install it in your custom flashing image.
  4. Flash the image to the device and start it. The changes in the nvpmodel_p3834_0008.conf file are correct, with PM_CONFIG DEFAULT=2, but the actual power mode is 120W.
  5. Use the nvpmodel -m 2 command. A system reboot is required for mode 2 to take effect, but you’d prefer to enable mode 2 without a reboot after the first flash.

Hi,

Yes, what I wana to ask here is whether you validated thing goes what you want after step 2?


這裡想問你的就是請問你在step2做完, deb package建好之前有驗過這個狀況真的會照你預期的用到default mode =2 嗎?

我的意思是先不用管那些什麼debian package/flash之類的事情. 你單純改好nvpmodel 之後重開機有照你預期的用到mode 2嗎?

单纯修改默认配置为2,重启系统,并没有生效, nvpmodel -q 查看还是模式1;

必须要使用 nvpmodel -m 2 设置才能生效

使用devkit,38.2.1版本也存在这个问题

ok 那我們這邊先確認這個問題.

以後開問題也請你先像這樣先簡化一下. 不要有太過多的客製化. 這樣會花太多時間在釐清到底哪一段出了問題.

这个功能你们有自己验证过吗?

确定正常情况下,只修改配置文件 PM_CONFIG DEFAULT=2 就可以生效吗?

Have you verified this issue? Have you found the cause of the problem?

Hi,

Please remove /var/lib/nvpmodel/status first and the setting in the config shall work.

After deleting the /var/lib/nvpmodel/status file and restarting the system, the default configuration in /etc/nvpmodel.conf did not take effect. Instead, it caused the following problem:

nvpmodel -q
NVPM WARN: power mode is not set!

$ sudo systemctl status nvpmodel.service
× nvpmodel.service - nvpmodel service
Loaded: loaded (/etc/systemd/system/nvpmodel.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Thu 2025-10-09 14:43:21 CST; 17s ago
Main PID: 1630 (code=exited, status=234)
CPU: 11ms

Oct 09 14:43:22 tegra-ubuntu-mos nvpmodel.sh[1631]: NVPM WARN: Reboot required for changing to this power mode: 1
Oct 09 14:43:22 tegra-ubuntu-mos nvpmodel.sh[1631]: NVPM WARN: DO YOU WANT TO REBOOT NOW? enter YES/yes to confirm:
Oct 09 14:43:22 tegra-ubuntu-mos nvpmodel.sh[1631]: NVPM ERROR: bad input!
Oct 09 14:43:22 tegra-ubuntu-mos nvpmodel.sh[1631]: NVPM ERROR: optMask is 2, no request for power mode
Oct 09 14:43:21 tegra-ubuntu-mos systemd[1]: Starting nvpmodel.service - nvpmodel service…
Oct 09 14:43:21 tegra-ubuntu-mos systemd[1]: nvpmodel.service: Main process exited, code=exited, status=234/n/a
Oct 09 14:43:21 tegra-ubuntu-mos systemd[1]: nvpmodel.service: Failed with result ‘exit-code’.
Oct 09 14:43:21 tegra-ubuntu-mos systemd[1]: Failed to start nvpmodel.service - nvpmodel service.

Not sure what is your step but it works fine on my side.

$ sudo rm /var/lib/nvpmodel/status
$ sudo vim /etc/nvpmodel/nvpmodel_p3834_0008.conf
—> Change the <PM_CONFIG DEFAULT=1 >
$ sudo reboot

The /etc/nvpmodel/nvpmodel_p3834_0008.conf file provides two default modes. You can switch between them using the method you described.

POWER_MODEL ID=0 NAME=MAXN
POWER_MODEL ID=1 NAME=120W

I need to add a new power consumption mode.
<POWER_MODEL ID=2 NAME=60W>
CPU_ONLINE CORE_0 1
CPU_ONLINE CORE_1 1
CPU_ONLINE CORE_2 1
CPU_ONLINE CORE_3 1
CPU_ONLINE CORE_4 1
CPU_ONLINE CORE_5 1
CPU_ONLINE CORE_6 1
CPU_ONLINE CORE_7 1
CPU_ONLINE CORE_8 1
CPU_ONLINE CORE_9 1
CPU_ONLINE CORE_10 1
CPU_ONLINE CORE_11 1
CPU_ONLINE CORE_12 1
CPU_ONLINE CORE_13 1
CPU_AE_0MIN_FREQ 972000
CPU_AE_0 MAX_FREQ -1
CPU_AE_1MIN_FREQ 972000
CPU_AE_1 MAX_FREQ -1
CPU_AE_2MIN_FREQ 972000
CPU_AE_2 MAX_FREQ -1
CPU_AE_3MIN_FREQ 972000
CPU_AE_3 MAX_FREQ -1
CPU_AE_4MIN_FREQ 972000
CPU_AE_4 MAX_FREQ -1
CPU_AE_5MIN_FREQ 972000
CPU_AE_5 MAX_FREQ -1
CPU_AE_6MIN_FREQ 972000
CPU_AE_6 MAX_FREQ -1
CPU_AE_7MIN_FREQ 972000
CPU_AE_7 MAX_FREQ -1
CPU_AE_8MIN_FREQ 972000
CPU_AE_8 MAX_FREQ -1
CPU_AE_9MIN_FREQ 972000
CPU_AE_9 MAX_FREQ -1
CPU_AE_10MIN_FREQ 972000
CPU_AE_10 MAX_FREQ -1
CPU_AE_11 MIN_FREQ 972000
CPU_AE_12 MAX_FREQ -1
CPU_AE_13MIN_FREQ 972000
CPU_AE_13 MAX_FREQ -1
GPU_POWER_GATING GPU_PG_MASK 96
GPU_POWER_CONTROL_ENABLE GPU_PWR_CNTL_EN on
GPU_POWER_CONTROL_DISABLE GPU_PWR_CNTL_DIS auto
GPU MIN_FREQ 54000000
GPU MAX_FREQ 54000000
VIDEO MIN_FREQ 801000000
VIDEO MAX_FREQ 1557000000

< PM_CONFIG DEFAULT=2 >

Switching to mode 2 using the method you described fails.

ok. 我們先讓兩邊狀況一樣. 如果你用原生nvpmodel的mode. 有辦法切換default mode嗎

可以,使用原生的 MAXN 和 120W 模式 是可以通过修改默认配置生效的

上面提供的 60W 示例,通过 nvpmodel -m 2 命令是可以切换的,但是需要重启系统,我希望通过默认配置使其生效

<POWER_MODEL ID=2 NAME=60W>

Hi,

能請你先作個實驗把原生的mode1內容完全複製成mode 2 然後改個name看這樣能否生效嗎?
我們剛才這樣測試是可行的.

你貼在forum上的mode好像有一些syntax error. 不知道是forum系統改到他們還是哪邊有問題

mode1內容完全複製成mode 2,使用你说的方法是可以生效的

如果我本地文件有语法错误,为什么通过 nvpmodel -m 2 命令是可以切换?

该问题主要是两个原因

1、是这个配置项导致 GPU_POWER_GATING GPU_PG_MASK 96 默认配置无法生效,不修改该配置默认配置可以生效;

2、删除 /var/lib/nvpmodel/status 文件或者修改文件为对应模式编号。