Giter VIP home page Giter VIP logo

hrdwr-monitor's Introduction

hrdwrd-monitor

image

This is very much experimental

Monitor hardware sensor data through a cool looking UI while you're gaming.

Demo

https://hrdwr-monitor.netlify.app

Note: the demo has been tested on chrome, firefox ans safari. Safari performance kinda sucks at the moment. See Known issues โ€” Don't try this on a phone, your eyes are going to bleed, remember this is a computer hardware monitoring tool.

Disclaimer

This project isn't pretending to be replacing the most advanced hardware monitoring tools like HWiNFO, Open Hardware Monitor. I wasn't happy with how any of these softwares looked like, and as a UI engineer, I wanted to build a web-based UI and use this data. I could have stopped at building a NodeJS server fetching the same remote server I use here but I've decided that I'd push this a little further and package it as a Rust app with a webview. This was a good excuse to build something with Rust.

I'm not proficient with Rust and system programming in general, I'm more of a web guy but I was curious to see how I could have access to hardware data from Rust. Turns out it was more complicated than I thought, there wasn't any simple high level API I could use. A lot of the existing libraries I've looked at were missing the GPU sensor information, such as temperature or VRAM usage and some may work with Nvidia cards but not AMDs (I have one). That's when I decided to rely on existing tools to expose hardware data over the network for now. See Usage for more details.

All of this to say that this isn't "ideal" as it requires folks to use other tools to feed data into this one and I'm calling for help to anyone who's got even the slighest idea how I could get this data directly from this app. There is an issue open to gather ideas to solve this: #1

Usage

This project currently has two hard dependencies that must be running on the host machine:

  • HMWiNfo@v736-4960
  • remotehwinfo@v0.5 โ€” This project reads sensor data from HMWiNfo and exposes it over the network.

Note that this only has been tested running specifically the aforementioned versions. Other versions may or may not work. Also HMWiNfo must have the following sensors enabled:

  • Total CPU Usage
  • CPU Package
  • GPU Temperature
  • Physical Memory Load
  • GPU Utilization
  • GPU Memory Controller Utilization

Also make sure to check "fixed order" and you may also need to reset to the original order since we're relying on sensor positioning to find specific sensor data (this isn't ideal but I'm not sure how else at the moment).

TODO: Add images or tutorial how to check these out in HMWiNfo

Contributing

This project uses nix and nix flakes to install dependencies locally in order to build the app.

You can run just dev to only run the client part, e.g the UI. By default, mock data will be used. To disable it, you can pass an argument to the command.

$ just dev # with mock data
$ just dev false # no mock data

This is a tauri app, so you can run yarn tauri dev to build the rust app, the client and package the whole thing. The app builds on windows and MacOS (haven't tested linux yet). On MacOS, the data will fake, I haven't gotten around getting actual sensors data on MacOS yet.

Here's a list of improvements I had in mind.

Improvements

  • Enable eslint/prettier
  • Build on CI
  • Make UsageGauge a bit more consistent design-wise with the thermal gauges (we're missing some gradient and glow)
  • Add number interpolation, e.g animate them when they change.
  • Add temp trending, is it going down or up based on the last 10 ticks?
  • Better loading state
  • Let users configure temp and load thresholds
  • Add FAN RPM. Build a live "streaming" chart for visualizing one line per fan (cpu, sys1, sys2, etc), e.g https://stackoverflow.com/questions/15283289/labeling-animated-line-graphs-using-d3
  • System status message updates should animate vertically (sliding up)
  • Update system status based on data thresholds, e.g should not be ok if reaching 100% of temps tresholds.

Known issues

  • The app currently builds on MacOS but the performance aren't great. This is because of the Safari webview, chrome doesn't have that issue. #2

hrdwr-monitor's People

Contributors

magellol avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

hrdwr-monitor's Issues

Poor performance on Safari Webview

The app currently builds on macos although the performance of the Safari webview is rather poor compared to edge webview or even plain chrome. I'm not sure why exactly but the animation doesn't run at 60fps.
Since we're fetching data and drill it down, the whole app re-renders at the same time and there is definitely room to improve that, perhaps that'll also help with the Safari issue.

This is lower priority because the app isn't meant for macos users, there aren't actual live sensor data. It's just to help development.

Read sensor data from rust

As mentioned in the readme section one of my concerns is that I rely on two hard dependencies that must run on the host machine to read sensor data (CPU, GPU, etc..) and I so far didn't find anything conclusive I could do in Rust specifically.

We can use this issue to gather and brainstorm ideas to pull this off from rust directly.

Current approach

The current approach requires running HWiNfo and remotehwinfo separately from this application. HWiNfo exposes sensor data over a shared memory access (don't quote me on that) and remotehwinfo makes it accessible over the network which this app pulls.

Dream

The dream would be to not having to rely on any external dependencies and use an intrinsic rust implementation to read the data but as I found out, this isn't straightforward.

Ideas

Here's a list of ideas I've tried and I want to keep trying to pull this off:

  • I've tried to use the systemstats crate but this doesn't expose anything related to GPU
  • I've looked at an alternative to NVML for AMD cards and I've found ROCm but there is no rust implementation/bindings at the moment.
  • I've tried to use windows-rs and the performance counter API but It didn't seem like thermal information was exposed. Note that I also tried the winapi crate but same issue.
  • I've entertained the idea of rewriting the backend using .NET and use LibreHardwareMonitor. I haven't explored this too deeply as I'd like to stay in Rust land if possible.
  • I've tried the psutil rust crate but same issue with GPU data not exposed.

At this point, my best idea is to rewrite using .NET but I'm very much not familiar with its ecosystem ๐Ÿคท

Any idea is welcome!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.