-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Linux] Add NVMe PCI address or name in sensors_temperatures keys #1902
Comments
What's the output of |
Hi. Here the full output (also containing wifi, CPU and acpitz)
Thanks. |
Also please the full output of |
Here it is :
|
Mmm... what should change is the dictionary key (so in your case we'd have 2 separate |
Hi. Well, I'm rusted in C, so I'll have some difficulties helping to rewrite the script drawing inspiration from what they are doing on the lm-sensors project. Thanks. |
I faced the same problem (although I at the moment have only one nvme device in the computer where I'm debugging, I'd still like to have a more specific device name), and ended up here. So lm-sensors calls my nvme device Essentially, in my system:
The process by lm-sensors to find the name is something like:
Source: added some printfs to understand the process in lm-sensors/lm-sensors@master...JiK:lm-sensors:debug-sysfs Full output:
|
Summary
Description
When calling
psutil.sensors_temperatures()['nvme']
, all NVMe drives of the system are in a single list, without any way of telling which line goes to which drive.Here's an example from my own PC :
After checking with the
sensors
command, I can tell the first 3 lines are one drive (/dev/nvme0) and the last line is the second drive (/dev/nvme1).After searching around in sysfs, I found psutil uses the name property, which is too generic in this case.
Maybe, we could use either the full PCI Address as another value in shwtemp object (like "pciaddress", only for NVMe drives)
The PCI address is at this path :
Psutil return would look like this :
Or use the drive name (here "nvme0" and "nvme1" in the example above) as the key in
psutil.sensors_temperatures()
Psutil return would look like this :
And maybe keep the "nvme" key with all drives, to avoid a breaking change.
I just want to avoid too much code modification, so I think it's the more lightweight solutions we have.
Don't hesitate to comment and discuss.
If we agree on this feature, I'm willing to contribute and send a PR.
Thanks.
The text was updated successfully, but these errors were encountered: