NVMe Tuning
#1
I have tried to follow the Wiki section to set the power profile of the NVMe SSD.

        sudo nvme /dev/nvme0 id-ctrl /dev/nvme0 

returns:

        ps    0 : mp:3.30W operational enlat:0 exlat:0 rrt:0 rrl:0
                  rwt:0 rwl:0 idle_power:- active_power:-
        ps    1 : mp:2.70W operational enlat:0 exlat:0 rrt:1 rrl:1
                  rwt:1 rwl:1 idle_power:- active_power:-
        ps    2 : mp:2.30W operational enlat:0 exlat:0 rrt:2 rrl:2
                  rwt:2 rwl:2 idle_power:- active_power:-
        ps    3 : mp:0.0500W non-operational enlat:10000 exlat:45000 rrt:4 rrl:4
                  rwt:4 rwl:4 idle_power:- active_power:-
        ps    4 : mp:0.0050W non-operational enlat:10000 exlat:50000 rrt:4 rrl:4
                  rwt:4 rwl:4 idle_power:- active_power:-

Not really sure hot to decypher the output, but I'm assuming that ps 2 is the profile I want as its the lowest power with the drive operational.

I have tried setting this profile using 
        sudo nvme /set-feature /dev/nvme0 -f 2 -v 2

This seems to work until a reboot when it defaults back to profile 0.

Is there a command missing to save it to the NVMe?

Also after googling to try and find how to make NVMe setting persistant, I found some references to enabling Autonomous Power State Transistion rather than editing the power management. 
Which is the correct one to use APST (feature 0x0c) or Power Managment (feature 2) and how to make these setting persistent?
Linux n00b trying to learn.
Brute force and ignorance sometimes works!
| Pinebook Pro + Toshiba OCZ RC100 240GB |
#2
(01-09-2020, 03:22 PM)gandlers Wrote: I have tried to follow the Wiki section to set the power profile of the NVMe SSD.
...
This seems to work until a reboot when it defaults back to profile 0.

Is there a command missing to save it to the NVMe?
...

Yes, there does appear to be a command missing to make it persistant across reboots & power cycles.
I think this is what we are looking for;
Code:
-s, --save
   Save the attribute so that it persists through all power states and resets.

So the command in both the example and your case is probably;
Code:
$ sudo nvme set-feature /dev/nvme0 -f 2 -v 2 -s
Whence someone has tested that, I'll update the Wiki and remove the note about the non-persistant nature I just added.

(01-09-2020, 03:22 PM)gandlers Wrote: ...
Also after googling to try and find how to make NVMe setting persistant, I found some references to enabling Autonomous Power State Transistion rather than editing the power management.
Which is the correct one to use APST (feature 0x0c) or Power Managment (feature 2) and how to make these setting persistent?
I don't know anything about APST / Autonomous Power State Transistion.
--
Arwen Evenstar
Princess of Rivendale
#3
(01-10-2020, 08:49 AM)Arwen Wrote:
Code:
$ sudo nvme set-feature /dev/nvme0 -f 2 -v 2 -s

Whence someone has tested that, I'll update the Wiki and remove the note about the non-persistant nature I just added.

Arwen,

That's the secret ingredient, the -s switch was indeed required to save it.
Rebooting no longer sets it back to 0.

Many thanks  Big Grin
Linux n00b trying to learn.
Brute force and ignorance sometimes works!
| Pinebook Pro + Toshiba OCZ RC100 240GB |
#4
Great. You are welcome. Wiki updated.
--
Arwen Evenstar
Princess of Rivendale
#5
May I ask where you found the info regarding the missing switch?

I tried "man nvme", "sudo nvme --help" and obviously googled it but never found info regarding the switches.
I can't find info on the -H switch for example, but that appears to be a "make human readable" switch
Information about the feature-ids also seem to be a closely guarded secret. I would have expected there to be a list of NMVe FID's but google let me down on that one too!
Linux n00b trying to learn.
Brute force and ignorance sometimes works!
| Pinebook Pro + Toshiba OCZ RC100 240GB |
#6
This might be a different source than what Arwen found, but I found a page that explains the -s option here:  https://manpages.ubuntu.com/manpages/bio...ure.1.html  

I found this after reading your post this morning, and was going to reply suggesting -s, but when I tried it on my own desktop it didn't work so I didn't reply.  Luckily Arwin did.

I wonder why I'm getting an error but you are not.  When I run:


Quote:sudo nvme set-feature /dev/nvme0 -f 2 -v 2 -s

After I type my password it comes back:


Quote:NVMe Status:FEATURE_NOT_SAVEABLE(10d)

I don't have my PBP yet, this was on my 9 year old X86 desktop running Mint.  This isn't really a problem on my desktop though.
#7
(01-10-2020, 10:39 AM)gandlers Wrote: May I ask where you found the info regarding the missing switch?

I tried "man nvme", "sudo nvme --help" and obviously googled it but never found info regarding the switches.
I can't find info on the -H switch for example, but that appears to be a "make human readable" switch
Information about the feature-ids also seem to be a closely guarded secret. I would have expected there to be a list of NMVe FID's but google let me down on that one too!

In the NVMe package I have on my Linux desktop, the "man nvme" simply shows what other manual pages are available. So I found "man nvme-set-feature" which has the "-s" option.

I did not find any cross reference of what does what, but did not look too hard. I may have added the Wiki entry, but the actual commands are from someone else here in the forums.

(01-10-2020, 02:33 PM)Redbeard Wrote: This might be a different source than what Arwen found, but I found a page that explains the -s option here:  https://manpages.ubuntu.com/manpages/bio...ure.1.html  

I found this after reading your post this morning, and was going to reply suggesting -s, but when I tried it on my own desktop it didn't work so I didn't reply.  Luckily Arwen did.

I wonder why I'm getting an error but you are not.  When I run:
Quote:sudo nvme set-feature /dev/nvme0 -f 2 -v 2 -s


After I type my password it comes back:
Quote:NVMe Status:FEATURE_NOT_SAVEABLE(10d)


I don't have my PBP yet, this was on my 9 year old X86 desktop running Mint.  This isn't really a problem on my desktop though.

First, do you have a NVMe on your 9 year old X86 desktop?
Second, did you run the command, "sudo nvme id-ctrl /dev/nvme0", to get the power settings of your NVMe?

My desktop has 2 NVMe SSD drives, and only 1 has the ability to change it's power settings. The other does not. Thus, it would likely fail like yours.
--
Arwen Evenstar
Princess of Rivendale
#8
Cheers for the info guys.

Ah, there are other man pages (as highlighted in bold).

Now I know how that works I have the -s switch right here infront of me in my terminal window,
Linux n00b trying to learn.
Brute force and ignorance sometimes works!
| Pinebook Pro + Toshiba OCZ RC100 240GB |
#9
@gandlers, Live and learn.

Another useful Unix command to find manual pages, though I can't be certain it is on all Linux distros, is "apropos".
For example, I tried this just now;
Code:
> apropos sky        
skytentacles (6)     - 3D tentacles from the sky!
Which ended up being a X-Windows screen saver.
--
Arwen Evenstar
Princess of Rivendale
#10
@Arwin


Quote:First, do you have a NVMe on your 9 year old X86 desktop?

Yes.  I have an Intel 660p Series M.2 2280 1TB PCIe NVMe mounted in an adapter in a free PCIe slot.

Quote:Second, did you run the command, "sudo nvme id-ctrl /dev/nvme0", to get the power settings of your NVMe?

My desktop has 2 NVMe SSD drives, and only 1 has the ability to change it's power settings. The other does not. Thus, it would likely fail like yours.

Yes.  When I run "sudo nvme id-ctrl /dev/nvme0" it comes back with the following power settings:


Quote:ps    0 : mp:4.00W operational enlat:0 exlat:0 rrt:0 rrl:0
          rwt:0 rwl:0 idle_power:- active_power:-
ps    1 : mp:3.00W operational enlat:0 exlat:0 rrt:1 rrl:1
          rwt:1 rwl:1 idle_power:- active_power:-
ps    2 : mp:2.20W operational enlat:0 exlat:0 rrt:2 rrl:2
          rwt:2 rwl:2 idle_power:- active_power:-
ps    3 : mp:0.0300W non-operational enlat:5000 exlat:5000 rrt:3 rrl:3
          rwt:3 rwl:3 idle_power:- active_power:-
ps    4 : mp:0.0040W non-operational enlat:5000 exlat:9000 rrt:4 rrl:4
          rwt:4 rwl:4 idle_power:- active_power:-

What is strange is I can set the power value, so long as I don't use the -s option.  I've replaced my user name and my path at the terminal with "#############?" below: 
Quote:#############? sudo nvme set-feature /dev/nvme0 -f 2 -v 2
set-feature:02 (Power Management), value:0x000002
#############? sudo nvme get-feature /dev/nvme0 -f 2
get-feature:0x2 (Power Management), Current value:0x000002
#############? sudo nvme set-feature /dev/nvme0 -f 2 -v 2 -s
NVMe Status:FEATURE_NOT_SAVEABLE(10d)

As I noted above, this isn't really an issue for me.  But it did throw me off a bit.


Possibly Related Threads…
Thread Author Replies Views Last Post
  NVMe reukiodo 0 50 11-18-2024, 09:00 AM
Last Post: reukiodo
  NVMe drives not detected mattpenn 13 12,544 11-17-2024, 04:38 AM
Last Post: reukiodo
  New Working nVME gilwood 1 618 11-17-2024, 04:24 AM
Last Post: reukiodo
  NVME problems 2022 / Intel 660p 1TB Starbug 1 2,171 04-04-2023, 12:16 PM
Last Post: globaltree
Thumbs Up NVMe adapter, Great addition dachalife 2 2,361 11-28-2022, 12:56 PM
Last Post: dachalife
  NVme intall usage? tkudog 2 3,452 03-04-2022, 01:29 AM
Last Post: Tazdevl
  Anyone selling a spare NVMe adapter in Europe? tom.tomasz 1 2,233 01-03-2022, 07:57 AM
Last Post: tom.tomasz
  NVMe SSD testing methodology halogen 1 3,073 07-22-2021, 05:57 PM
Last Post: calinb
Question Battery stops charging and NVMe and other media disconnect randomly Eey0zu6O 4 5,735 07-09-2021, 08:45 PM
Last Post: moonwalkers
  nvme drive disappears after about an hour of uptime codebreaker 24 36,197 02-09-2021, 11:32 PM
Last Post: dsimic

Forum Jump:


Users browsing this thread: 9 Guest(s)