Skip to content

Commit

Permalink
Add support for Raspberry Pi 5B
Browse files Browse the repository at this point in the history
  • Loading branch information
adelnoureddine committed Jan 8, 2024
1 parent 445d036 commit 3270dad
Show file tree
Hide file tree
Showing 4 changed files with 244 additions and 223 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ JoularJX depend on the following software or packages in order to get power read
- On Windows, JoularJX uses a custom power monitor program that uses Intel Power Gadget API on Windows, and therefore require installing the [Intel Power Gadget tool](https://www.intel.com/content/www/us/en/developer/articles/tool/power-gadget.html) and using a supported Intel CPU.
- On PC/server GNU/Linux, JoularJX uses Intel RAPL interface through powercap, and therefore requires running on an Intel CPU or an AMD Ryzen CPU.
- On macOS, JoularJX uses `powermetrics`, a tool bundled with macOS which requires running with `sudo` access. It is recommended to authorize the current users to run `/usr/bin/powermetrics` without requiring a password by making the proper modification to the `sudoers` file.
- On Raspberry Pi devices on GNU/Linux, JoularJX uses our own research-based regression models to estimate CPU power consumption with support for the following device models:
- On Raspberry Pi devices on GNU/Linux, JoularJX uses our own research-based regression models to estimate CPU power consumption with support for the following device models (we support all revisions of each model lineup. However, the model is generated and trained on a specific revision, listed between brackets, and the accuracy is best on this particular revision):
- Model Zero W (rev 1.1), for 32-bit OS
- Model 1 B (rev 2), for 32-bit OS
- Model 1 B+ (rev 1.2), for 32-bit OS
Expand All @@ -40,6 +40,7 @@ JoularJX depend on the following software or packages in order to get power read
- Model 3 B+ (rev 1.3), for 32-bit OS
- Model 4 B (rev 1.1, and rev 1.2), for both 32 bits and 64-bit OS
- Model 400 (rev 1.0), for 64-bit OS
- Model 5 B (rev 1.0), for 64 bits OS

We also support Asus Tinker Board (S).

Expand Down
12 changes: 10 additions & 2 deletions src/main/java/org/noureddine/joularjx/cpu/CpuFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ private static Optional<RaspberryPiModels> getRPiModelName(String osArch) {
List<String> allLines = Files.readAllLines(deviceTreeModelPath);
for (String currentLine : allLines) {
// SBC models and revisions
if (currentLine.contains("Raspberry Pi 400 Rev 1.0")) {
if (currentLine.contains("Raspberry Pi 5 Model B Rev 1.0")) {
if (osArch.contains("aarch64")) {
return Optional.of(RaspberryPiModels.RPI_5B_10_64);
}
} else if (currentLine.contains("Raspberry Pi 400 Rev 1.0")) {
if (osArch.contains("aarch64")) {
return Optional.of(RaspberryPiModels.RPI_400_10_64);
}
Expand Down Expand Up @@ -135,7 +139,11 @@ private static Optional<RaspberryPiModels> getRPiModelName(String osArch) {

// Support other revisions of supported SBC models
// By using existing power models of related revision
if (currentLine.contains("Raspberry Pi 400")) {
if (currentLine.contains("Raspberry Pi 5 Model B")) {
if (osArch.contains("aarch64")) {
return Optional.of(RaspberryPiModels.RPI_5B_10_64);
}
} else if (currentLine.contains("Raspberry Pi 400")) {
if (osArch.contains("aarch64")) {
return Optional.of(RaspberryPiModels.RPI_400_10_64);
}
Expand Down
Loading

0 comments on commit 3270dad

Please sign in to comment.