Unified component temperature api with GPU support - #1706
Conversation
|
I'm gonna send a PR to fix the CI. Also: this PR introduces a change in paradigm: the temperature used to be only part of |
I'd personally think it would be great if the same was done for CPU, disks, motherboards as afaik this is the current best method for getting cpu temps (this is what I do in my app). Which feels more brittle then it needs to be when you have to list out potential component names rather than making sure sysinfo gives you it with more guarantees with a global_cpu_temperature() function. |
|
No, I like the way this is going, just that I (we?) will need to do it for all items. And also maybe remove |
11cc193 to
c250405
Compare
|
I can make cpu/disk/motherboard etc expose temperature fields in this PR as another commit (renamed to Unified component temperature api with gpu support) or would you like in a separate PR? |
|
By that you mean having a |
|
Please rebase on #1707 when you push the next commit(s) so CI can pass as well. |
29fab8f to
767a29b
Compare
|
Rebased and confirmed it works for nvidia, needed a separate library path lookup for my system (nixos) with isn't breaking. |
|
New commit adds support for cpu temperature directly on the CPU object are you happy with that? It includes the max and critical threshold, so I think fully covers what the component provided. |
b3ad2e9 to
ea9987d
Compare
|
I think this is as feature complete as I can make it now. I thought a lot on the ergonomics of the those functions trying to match your style and think this is implemented in the simplest way now. |
|
Thanks! Gonna try to come back to this "soon" (might be up to a few weeks ^^'). |
Add support for reading the GPU temperature for linux macos and windows.
For nvidia it uses the nvml library, for amd it reads the files directly.
I don't have the means to test macos or windows support (I can test windows soon), it is verified against their documentation and I made sure it compiles. If anyone else can test those it would be great, else I can remove that code and return None as an unsupported platform.