Skip to content
/ rpms Public

Renoir power metrics server - A service that creates an HTTP endpoint allowing to query power / performance metrics for AMD Renoir processors.

License

Notifications You must be signed in to change notification settings

moson-mo/rpms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rpms

Renoir power metrics server


A service that creates an HTTP/REST endpoint allowing to query power / performance metrics for AMD Renoir processors.
Note that the following kernel module needs to be installed ryzen_smu Installation instructions can be found there...

Purpose

Purpose is to make power/performance metrics available in an easy manner.
Metrics can be queried via simple HTTP calls.
You can ,for example, use it in the famous conky system monitoring tool by doing some curl calls...
Or create your own web application with some graphs.

A simple example of a client application can be found here: rpmui
Also see Examples for some other examples (cony, terminal, etc.).

How to install

Manual

Binaries are available from the releases page.
If you have go installed on your machine, you can install with go install github.com/moson-mo/rpms
Once installed you can create a systemd service to run system-startup (see rpms.service).

AUR package

If you're using Arch or an Arch-based Distribution, there is an AUR package available.
Use your favorite AUR helper to install.
F.e.: yay -S rpms

How to build

  • Install go from your package manager or download it from the Golang site.
  • Download with go get github.com/moson-mo/rpms
  • Change to package dir: cd $(go env GOPATH)/src/github.com/moson-mo/rpms/
  • Build with go build

How to use

The program needs to be run with root permissions. I recommend running it as a systemd service.

HTTP endpoints

Endpoint Method Description
/pmtab GET Returns full pm table in json format.
Use URL parameter ?format=plain to get a plain text version.
/pmval?metric=xyz GET Returns plain text value for a certain metric.
Example: /pmval?metric=SOCKET POWER
Use /pmtab to get a full list of available metrics.

Arguments

Argument Type Description
-acao string Sets the Access-Control-Allow-Origin header if you want to allow querying the API from a webserver.
The default value is null to allow queries from local resources like an html file. (default null)
-address string The network address for the HTTP server.
Define any to listen on all interfaces. (default 127.0.0.1)
-interval duration Query interval for reading data from the PM table. (default 1s)
-port int Port number for the REST API server. (default 8090)

Dependencies / Prerequisites

  • ryzen_smu - Linux kernel driver that exposes access to the SMU (System Management Unit) for AMD processors

Currently supported processors

  • Ryzen 7 (8-core) Renoir APU's - 4xx0 U/G/H/HS series

Please contribute and help to support more models: Ryzen 3 (4 core) and Ryzen 5 (6-core) Renoir would really be interesting.

Simply create a data dump of the pm table: Please post here


Available metrics

The PM table has a huge amount of different metrics available.
For example:

  • CPU speed / frequency (per core)
  • CPU power consumption (total / per core)
  • CPU voltage (per core)
  • CPU temperature (core, socket, gfx)
  • CPU temperature limits (core, socket, gfx)
  • CPU power limits (STAPM, SLOW, FAST...)
  • CPU usage (total / per core)
  • GPU speed / frequency
  • GPU power consumption
  • GPU voltage
  • GPU temperature
  • GPU usage
    and tons of other things... check tables.go for a list

Thanks to

  • Leonardo Gates for the work on the Ryzen SMU driver module
  • sbski for his reverse engineering work on the PM tables
  • The people contributing with PM table data dumps
  • The ones I forgot to mention here :)

About

Renoir power metrics server - A service that creates an HTTP endpoint allowing to query power / performance metrics for AMD Renoir processors.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages