How to batch export `stat GPU` data to a file for multiple assets?

Hello,

I have a quick question.

I’m trying to get the average `stat GPU` values for about 10 assets in UE5.5, and I’m looking for the best way to do it.

Here’s what I’m trying to achieve:

1. I need to export the `stat GPU` data to a text file or some other file that I can easily parse to get the values. I’ve found that tools like `ue4stats` and `profViz` aren’t quite right for this, as it’s difficult to aggregate the data from them.

2. I also want to automate the process by using a batch file to launch each asset and run the stats command.

Does anyone have any advice on how I could set this up? Any help would be appreciated!

Thanks

[Image Removed]This is an example of stat GPU. I want to export values such as Lights, shadow denoiser etc..

Consider Looking at the csvprofiler & the cvar: GPUCsvStatsEnabled. outputted csv files very easy to aggregate. run the command csvprofile start … then stop.

how you launch and script the loading your assets you will have to solve separately.

Hey Yiwen,

Sam’s recommendation here is a good start, CSVProfiler is intended as a low overhead profiler and can give you good per frame statistics, so if the data in there is what you need it’s likely a good choice.

As an alternative you can also capture an Insights trace, which should contain even more information and we recommend it as our main profiler, especially if you want to run automated tests.

Insights has a few ways to export information from a trace, you can check this article on the different exports available. The TimingInsights.ExportTimerStatistics command would likely be the best candidate to export all (or a subset of your choice) of the timers from the cpu or gpu tracks in insights.

Insights has additional features that make this easier, for example you can emit named “timing regions” in your code to specify which parts of the trace map to which of your tests/assets. Then you can use a single trace file for all tests. The export command supports exporting only a subset of a trace by region name, so you can still export the statistics for each individual test/asset.

This article from UnrealFest Bali this year explains our own APT (Automated Performance Testing) framework, which is designed to automate such tests from start to finish and produce results and insights or csv files. This might be a good reference for how to setup such an automated testing approach.

Kind Regards,

Sebastian

Hi Sam and Sebastian

Thank you for the detailed information. I was able to successfully obtain the GPU statistics using the method you shared.

I appreciate your help.

Thanks

Yiwen.