Skip to content

Commit

Permalink
add gpu frame time measurements
Browse files Browse the repository at this point in the history
  • Loading branch information
tappi287 committed Nov 14, 2023
1 parent 37e023b commit ca7a4cb
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app.spec
Expand Up @@ -27,7 +27,7 @@ a = Analysis(['app.py'],
binaries=[],
datas=[(eel_js, 'eel'), ('web', 'web'), ('rf2settings/default_presets', 'default_presets'),
('build/version.txt', '.'), ('license.txt', '.'), ('data', 'data'),
('bin/PresentMon-1.7.0-x64.exe', 'bin'), ],
('bin/PresentMon-1.9.2-x64.exe', 'bin'), ],
hiddenimports=['bottle_websocket', 'ssl', '_ssl'],
hookspath=['hooks'],
runtime_hooks=[],
Expand Down
Binary file removed bin/PresentMon-1.7.0-x64.exe
Binary file not shown.
Binary file added bin/PresentMon-1.9.2-x64.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion rf2settings/benchmark/benchmark.py
Expand Up @@ -300,7 +300,7 @@ def start_present_mon_logging(self) -> bool:
cmd = [AppSettings.present_mon_bin.as_posix(),
'-process_name', 'rFactor2.exe', '-output_file', str(WindowsPath(self.result_file)),
'-timed', str(int(self.benchmark_length)), '-no_top', '-qpc_time',
'-terminate_after_timed', '-stop_existing_session'] # '-no_track_display'
'-terminate_after_timed', '-stop_existing_session', '--track_gpu'] # '-no_track_display'
cwd = self.rf.location

if self.present_mon_process is None:
Expand Down
2 changes: 1 addition & 1 deletion rf2settings/benchmark/result.py
Expand Up @@ -39,7 +39,7 @@ def read_results(file: Path, details: bool = False):

def read_present_mon_result(file: Path, details: bool = False):
required_fields = {'msUntilDisplayed', 'QPCTime', 'msUntilRenderComplete', 'msBetweenDisplayChange',
'Dropped', 'msInPresentAPI', 'TimeInSeconds', 'msBetweenPresents'}
'Dropped', 'msInPresentAPI', 'TimeInSeconds', 'msBetweenPresents', 'msGPUActive'}
non_detail_fields = {'msBetweenPresents', }

data = dict()
Expand Down
2 changes: 1 addition & 1 deletion rf2settings/globals.py
Expand Up @@ -93,7 +93,7 @@ def get_presets_dir() -> Path:

def get_present_mon_bin() -> Path:
bin_dir = Path(get_current_modules_dir()) / 'bin'
present_mon_exe = bin_dir / 'PresentMon-1.7.0-x64.exe'
present_mon_exe = bin_dir / 'PresentMon-1.9.2-x64.exe'

for f in bin_dir.glob('PresentMon*.exe'):
if f:
Expand Down
3 changes: 1 addition & 2 deletions vue/src/App.vue
Expand Up @@ -137,8 +137,7 @@ export default {
let files = evt.dataTransfer.files
for (let i = 0; i < files.length; i++) {
let f = files[i]
for (const f of files) {
if (f.type !== 'application/json') {
this.MainPage.methods.makeToast(
'The dropped file is of the wrong type.', 'danger', 'File Import')
Expand Down
14 changes: 13 additions & 1 deletion vue/src/components/benchmark/BenchmarkResultArea.vue
Expand Up @@ -125,7 +125,12 @@ export default {
data: {},
backgroundColor: 'rgba(255,153,0,0.4)',
borderColor: 'rgba(250,124,86,0.8)'
}
},
{ label: 'GPU Frame time',
data: {},
backgroundColor: 'rgba(62,166,138,0.4)',
borderColor: 'rgba(90,196,139,0.8)'
},
]
},
}
Expand Down Expand Up @@ -183,6 +188,7 @@ export default {
r.data['fps98'] = fps98; r.data['fps99'] = fps99; r.data['fps002'] = fps002
r.data['fpsmean'] = fpsmean; r.data['fpsmedian'] = fpsmedian
r.data['msBetweenPresents'] = []
r.data['msGPUActive'] = []
r.data['fps'] = []
r.gfxPreset = undefined; r.sesPreset = undefined
})
Expand Down Expand Up @@ -213,6 +219,7 @@ export default {
this.chartData.xAxisSize = 50
this.chartData.datasets[0].data = [] // Frame times
this.chartData.datasets[1].data = [] // FPS
this.chartData.datasets[2].data = [] // GPU Frame times
for (let i = 0; i < r.data['TimeInSeconds'].length; i++) {
// X-Axis Time in s
Expand All @@ -223,6 +230,11 @@ export default {
// Y-Axis Frame Times
this.chartData.datasets[0].data.push(r.data['msBetweenPresents'][i])
this.chartData.datasets[1].data.push(r.data['fps'][i])
if (r.data['msGPUActive'] !== undefined) {
this.chartData.datasets[2].data.push(r.data['msGPUActive'][i])
} else {
this.chartData.datasets[2].data.push(0)
}
// Set Y-Axis size
this.chartData.yAxisSize = Number(
Expand Down

0 comments on commit ca7a4cb

Please sign in to comment.