-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
cpu_temp returns the error message: "Not supported" on Windows 10 #94
Comments
Support for $anything does not mean everything is supported on that platform, just that something is. There is no platform currently for which everything is supported. PRs welcome. |
Hi! This problem is still exists, any idea how to make it work on windows 10? If I need to use another crate or something it will fix for my case. Thanks a lot, |
I’m fairly certain the best way to get this information on Windows is through WMI and needs admin privileges, which limits its usability. |
Hey @adumbidiot, Do you know with it is the crate to connect with the WMI? Thanks a lot, |
https://docs.rs/wmi/latest/wmi/ is the only one I know of. |
@HackingAllYT @adumbidiot doing it with WMI will not work on most devices due to lack of support from cpu manufactures. The only library which reliably does the job is OpenHardwareMonitor (LibreHardwareMonitor is the continued fork). It directly accesses the WinRing0 driver and reads out the MSR CPU register. Doing it that way will work. There are two ways how you can do it in rust: LibreHardwareMonitor is written in C# but uses C-Bindings to access the WinRing0 driver. You can also do this in Rust. Secondly you can use the winRing0 crate for rust. Unfortunately it's no longer maintained and not production ready. But i managed to get the cpu_temp on windows with this crate. https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/tree/master/WinRing0 |
While installing a custom driver would probably give better results, it’s more invasive and can’t really be incorporated into a library like this one which is more focused on asking the OS for info instead of bypassing it. Furthermore, driver signing on Windows is pretty difficult, and I recall there being quite a few security vulnerabilities with the WinRing0 driver. Applications that can function with imprecise or missing temperature data probably should prefer WMI, since I think that’s the most reliable source of temperature info from the OS. Temperature retrieval on Windows is quite a mess. |
WMI supports only |
Upon running
cargo run
from terminal the call tosystem.cpu_temp()
returns the error message:Not supported
for Windows 10. Even though it says on the crates.io page that there should be support for Windows.Attached code where i tried to get cpu_temp:
The text was updated successfully, but these errors were encountered: