GithubHelp home page GithubHelp logo

sebastianbergner / ryzen-monitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from steckdenis/threadripper-monitor

0.0 0.0 0.0 33 KB

CPU usage and power consumption monitor for AMD Threadripper/Ryzen Desktop/Epyc and Ryzen Mobile processors

License: GNU General Public License v3.0

Python 100.00%

ryzen-monitor's Introduction

Ryzen Power and CPU Usage Monitor

Most system monitors on Linux have a hard time with 32 cores and 64 threads. This program, made especially for AMD Threadripper processors but also compatible with Desktop Ryzen, EPYC and Mobile Ryzen, displays the CPU use of all the cores (and threads), in a nice graphical format that matches the physical implementation of the cores (on EPYC, Threadripper and Ryzen processors with 4, 2 or 1 Zeppelin dies).

I'm not entirely sure if the Mobile Ryzen addition works entirely (as I could only test 4800H). Testing and providing information is appreciated ;)

Dependencies

  • Python 3
  • PyQt5
  • PyQtChart
  • Linux: rapl-read-ryzen
  • Windows: pywin32 and WMI

The Python dependencies are installable with pip, and come pre-packaged in wheels. RAPL has to be installed from its Github repository.

Installing RAPL

If it is not yet merged, be sure to use my branch of RAPL, available here. It fixes how SMT interacts with power consumption.

git clone https://github.com/djselbeck/rapl-read-ryzen.git
cd rapl-read-ryzen
gcc -std=c99 -O2 -o rapl ryzen.c -lm
sudo cp rapl /usr/bin
sudo chown root:root /usr/bin/rapl
sudo chmod +s /usr/bin/rapl

The last two lines make RAPL a set-uid root binary. Be aware of this, as it can have security implications. RAPL has to be run as root, because it has to access the CPU MSRs. There may be another way of allowing RAPL to be easily run as an user, for instance by changing permissions around, but I did not manage to do that as easily as making RAPL set-uid root.

Running

Once RAPL and the Python dependencies, the monitor is super easy to use:

python3 main.py

And you are greeted by a nice GUI with animated graphs of the CPU usage and power consumption. The main area of the window displays the 2 or 4 dies of your CPU, with their two CCXes, each having 2, 3 or 4 cores, each having 2 threads. Threads become darker blue as they are used. A red bar also displays the power usage of individual cores, in addition to the main graph that shows the total power use of the whole package, and all the cores combined.

For Threadripper WX variants, the orange dies are connected to memory (NUMA nodes 0 and 2, cores numbered 0 to 16 with Kernel 4.18), while the gray dies are compute-only. On EPYC, all four dies are supposed to be connected to memory, and are thus displayed in orange.

Caveats

  • Windows support is difficult to achieve and requires extra dependencies (see above). Currently, power consumption monitoring is not supported on Windows.
  • The CPU topology is detected by reading /proc/cpuinfo (or using WMI on Windows) and matching the name of the CPU. Future CPUs will need this program to be updated.
  • This program assumes that SMT is available and used. As such, it does not support the low-end Ryzen 1st gen processors without SMT
  • APUs are not yet supported. Some simple changes should be enough to add support for them, as they are basically dies with only one CCX.

ryzen-monitor's People

Contributors

steckdenis avatar sebastianbergner avatar joshlay avatar

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.