I’ve had a brownout today on my RK3588 Pocket Reform on low battery when doing an npm install on a bigger node project and as the GPU wasn’t involved, my conclusion was that the NVMe was drawing too much power in that moment. So I looked for ways to throttle NVMe power, and indeed, this command gives me a nice table of the SSD’s supported power states:
If I understand this correctly, the first 3 entries are non-sleep modes (“Op” column with a “+” entry. And Technology Power Features - NVM Express helpfully has a command to select the power state:
Feature 2 is the power state and value 2 is the power state ID from the table. So this should limit the power draw of the SSD to 3 Watts. And indeed, I’m able to npm install at 1% battery.
Does this also work for you and what SSD model do you have? I’d like to collect some data for reform-power-daemon.
I have a 1TB Taifast with Realtek RTS5765DL controller.
I can change power modes with nvme, but hdparm -tT shows no performance difference, and Hyper+Enter b shows no change in battery draw, so I cannot be sure it’s working as intended.
=== START OF INFORMATION SECTION ===
Model Number: WD Green SN350 1TB
and set the lowest power setting now, lets see if i notice any difference
> sudo nvme get-feature /dev/nvme0n1
get-feature:0x01 (Arbitration), Current value:0x00000004
get-feature:0x02 (Power Management), Current value:0x00000002
EDIT: Just as i feard the seeting is not reboot save. yfi
So we maybe need to set it in the reform-power-deamon if we wanna use it in the future as a default option
> sudo nvme get-feature /dev/nvme0n1
get-feature:0x01 (Arbitration), Current value:0x00000004
get-feature:0x02 (Power Management), Current value:0x00000003
Since you’re collecting NVMe information, I have bit different result. States for my NVMe “SAMSUNG MZVL21T0HCLR-00BL2” 1TB are different from those above, as they all seems to have low power states. Note, it’s not installed in MNT machine, as my order is at the assembly process. It seems it lack low power mode, or at least this is what I’m getting from the readings.
$ sudo nvme list
[sudo] password for josch:
Node Generic SN Model Namespace Usage Format FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- --------
/dev/nvme0n1 /dev/ng0n1 21356G803663 WDC WDS100T2B0C-00PXH0 0x1 1.00 TB / 1.00 TB 512 B + 0 B 233010WD
$ sudo smartctl -c /dev/nvme0
Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 3.50W 2.90W - 0 0 0 0 0 0
1 + 2.70W 2.30W - 0 0 0 0 0 0
2 + 1.90W 1.80W - 0 0 0 0 0 0
3 - 0.0250W - - 3 3 3 3 3900 11000
4 - 0.0050W - - 4 4 4 4 5000 44000
$ sudo nvme set-feature /dev/nvme0 --feature-id=2 --value=2
set-feature:0x02 (Power Management), value:0x00000002, cdw12:00000000, save:0
$ sudo nvme get-feature /dev/nvme0n1 --feature-id=2
get-feature:0x02 (Power Management), Current value:0x00000002
Taifast P1000 1 TB (rk3588 pocket reform)
Only has a single state “0”. This is in contrast to the 1TB Taifast by @minute which has completely different output.
$ sudo nvme list
Node Generic SN Model Namespace Usage Format FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- --------
/dev/nvme0n1 /dev/ng0n1 ALJK2023112100000346 SSD 1TB 0x1 1.00 TB / 1.00 TB 512 B + 0 B W0613A3
$ sudo smartctl -c /dev/nvme0
Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 6.00W - - 0 0 0 0 0 0
$ sudo nvme set-feature /dev/nvme0 --feature-id=2 --value=2
NVMe status: Invalid Field in Command: A reserved coded value or an unsupported value in a defined field(0x2)
$ sudo nvme get-feature /dev/nvme0 --feature-id=2
get-feature:0x02 (Power Management), Current value:00000000
Verbatim Vi3000 (imx8mq classic reform)
The powermanagement value I set for this drive refuses to stick. Even though I set it to “2” it would sometimes show 3, sometimes 4, sometimes 0 and sometimes 2.
@jfred@grabo That’s the “Taifast P1000” SSD you got. I have one too and you can see that the output of the “SN” column is similar. Mine also only has a single power state.