flightlessmango / MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more. Discord: https://discordapp.com/invite/Gj5YmBb
MIT License
6.11k stars 263 forks source link

mangoplot not reading .csv files from mangohud #1362

Closed Kagukara closed 1 week ago

Kagukara commented 2 weeks ago

Describe the bug When trying to use mangoplot with the logging files produced from mangohud, mangoplot can't read them.

$ mangoplot ~/.config/MangoHud/mangologs/
Loading 2 benchmark files
The folder 
   /home/richard/.config/MangoHud/mangologs 
contains no CSV file (make sure they have the .csv extension)
$ tree ~/.config/MangoHud/mangologs/
/home/richard/.config/MangoHud/mangologs/
├── vkcube_2024-06-23_19-10-50.csv
└── vkcube_2024-06-23_19-10-50_summary.csv

1 directory, 2 files

List relevant hardware/software information

To Reproduce Steps to reproduce the behaviour:

  1. Open the terminal
  2. Type mangoplot ~/path/to/csv/folder
    • Replacing ~/path/to/csv/files with location to your folder with the .csv files.

Expected behaviour For mangoplot to read the .csv files mangohud produces from logging.

flightlessmango commented 2 weeks ago

ping @AdelKS

AdelKS commented 2 weeks ago

Hey can you drag and drop the file vkcube_2024-06-23_19-10-50.csv ? Append .txt to it so GitHub accepts it : vkcube_2024-06-23_19-10-50.csv.txt

Kagukara commented 2 weeks ago

vkcube_2024-06-23_19-10-50.txt

EDIT: Just realised I didn't append but instead replaced. I'll reupload the .csv with .txt appended when I get back to my PC.

vkcube_2024-06-23_19-10-50.csv.txt

AdelKS commented 1 week ago

@flightlessmango it is just that there are extra "header" rows in the csv files now, which moved the title row that starts with fps (we look for that one to know when the actual benchmark data starts) past the 4th row, we can look for the fps line in the first 100 rows instead of the first 4 and that fixes this issue

diff --git a/bin/mangoplot.py b/bin/mangoplot.py
index 7d82b3a..41d81f2 100755
--- a/bin/mangoplot.py
+++ b/bin/mangoplot.py
@@ -195,8 +195,9 @@ class BenchmarkFile:

             found_fps_column = False
             for row_number, row_content in enumerate(reader):
-                if row_number > 4:
-                    # if we're past the 4th row, break the loop
+                if row_number > 100:
+                    # did not find the row that starts with the
+                    # 'fps' column up until here.  give up.
                     break
flightlessmango commented 1 week ago

@AdelKS This issue stems from enabling the option log_versioning. It has more information than the usual one, but it's not fully supported every where, like in mangoplot and on flightlessmango.com. I would recommend we support both of them instead

AdelKS commented 1 week ago

Hey @flightlessmango yeah the patch I attached will make the code work with any mangohud CSV file who has the row that starts with the fps colum be anywhere in the first 100 rows, and then assumes every row after that to be actual data.

Kagukara commented 1 week ago

The patch above works for me.

Although I did have to edit this down from 10000 to 5000 to view shorter readings. https://github.com/flightlessmango/MangoHud/blob/8a31b967669576268d09e8efc604108c28ab3d87/bin/mangoplot.py#L344

flightlessmango commented 1 week ago

@AdelKS thanks! It's fixed here 6c665653ba28e9296e0f89d07faceeb859f52872