Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiling tests for Hagen #859

Merged
merged 59 commits into from
Oct 13, 2021
Merged
Changes from 4 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
9e5b6dd
start profiling
reinago Jul 29, 2021
b8de2cc
Call: profiling data getters
reinago Jul 29, 2021
75f2299
gpu profile queries
reinago Jul 29, 2021
c7b8b63
pipe profiling values to gui
braunms Jul 29, 2021
38dec04
weird stuff for gl perf, but cannot work like this
reinago Jul 29, 2021
6df368f
Merge remote-tracking branch 'reinago/profiling' into profiling
reinago Jul 29, 2021
6a8edc1
hiding GPU info since it's no use anyway ATM
reinago Jul 29, 2021
46a7637
moved profiling values from tooltip to context menu of calls
braunms Jul 29, 2021
85d1c26
Merge remote-tracking branch 'guido/profiling' into profiling
braunms Jul 29, 2021
9fe7c76
moved profiling info into call label
braunms Jul 30, 2021
86585f2
Merge remote-tracking branch 'origin/master' into profiling
reinago Jul 30, 2021
5fa5e47
operator precedence...
reinago Jul 30, 2021
106ae26
profiling info fine tuning
braunms Jul 30, 2021
5528b69
cheaper and less weird at runtime
reinago Aug 3, 2021
79f46cd
minor changes in gui call for profiling
braunms Aug 3, 2021
23eded0
fixed program flow a bit
reinago Aug 3, 2021
5278a6a
compile fix for disabled profiling
braunms Aug 4, 2021
d1c7844
moved implementation to PerformanceQueryManager
reinago Aug 4, 2021
c5b3408
merge, fixed ifdefs
reinago Aug 4, 2021
db97927
performance queries work
reinago Aug 4, 2021
f4b23c3
only remove gl calls
reinago Aug 4, 2021
a947b88
cleanup
reinago Aug 4, 2021
e6d7579
use HPET instead
reinago Aug 4, 2021
4f0bee1
Merge remote-tracking branch 'upstream/master' into profiling
braunms Aug 4, 2021
fe7bee2
Merge remote-tracking branch 'guido/profiling' into profiling
braunms Aug 4, 2021
8e47bf0
lazy init guard
reinago Aug 4, 2021
b7dd4cd
Merge remote-tracking branch 'origin/master' into profiling
reinago Aug 5, 2021
e7e4bc3
Merge branch 'master' into profiling
reinago Aug 31, 2021
f480853
performance averages and buffer refactored
reinago Aug 31, 2021
367d1c1
history also for GPU
reinago Sep 1, 2021
28dd755
cleanup / off-by-one
reinago Sep 1, 2021
e0ebe8a
prototype perf history graph
reinago Sep 2, 2021
0167667
even smaller footprint in code
reinago Sep 2, 2021
c2cd370
Merge remote-tracking branch 'reinago/profiling' into profiling
braunms Sep 2, 2021
c88e7ca
added implot as external dep
braunms Sep 2, 2021
20ce877
using implot fancyness
braunms Sep 2, 2021
c6af587
use current version (v0.11) of implot to have some bugs fixed
braunms Sep 3, 2021
9e16137
implot tweaking
reinago Sep 3, 2021
872d633
ContextToGL event callback fix for context outslot
reinago Sep 8, 2021
0a89b42
Merge branch 'master' into profiling
reinago Sep 8, 2021
b542e7c
cleanup
reinago Sep 8, 2021
06e2718
Profiling can be compiled out actually
reinago Sep 9, 2021
2198a98
I propose CallCapabilities
reinago Sep 9, 2021
b75874d
bug fixes
reinago Sep 9, 2021
cea528f
downgrade
reinago Sep 9, 2021
4a84100
cleanup
reinago Sep 9, 2021
f77c22a
another cleanup
reinago Sep 9, 2021
7894ace
Merge remote-tracking branch 'upstream/master' into profiling
braunms Sep 17, 2021
112af8f
fix merge
braunms Sep 17, 2021
0e51270
callrenderviewgl caps
reinago Sep 17, 2021
5547379
Merge branch 'master' into profiling
reinago Sep 23, 2021
4f9b23d
move GPU performance collection to its own service.
reinago Sep 23, 2021
4a55d08
cleanup
reinago Sep 23, 2021
7640f09
GL caps restored
reinago Sep 23, 2021
16a73a1
includes and ifdefs---
reinago Sep 24, 2021
c2b5cb2
cleanup
reinago Sep 29, 2021
eac3795
sneak in smaller screenies...?
reinago Sep 30, 2021
e2a3e93
dangling deps tripping ninja
reinago Oct 1, 2021
ca80e1a
adapted ospray plugin readme to reflect TBB changes
reinago Oct 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion core/include/mmcore/Call.h
Original file line number Diff line number Diff line change
@@ -171,11 +171,19 @@ namespace core {
public:
my_query_id();
~my_query_id();
uint32_t Get() {
my_query_id(const my_query_id&);
uint32_t Get() const {
return the_id;
}
bool Started() const {
return started;
}
void Start() {
started = true;
}
private:
uint32_t the_id = 0;
bool started = false;
};
std::array<std::vector<my_query_id>, 2> queries;
uint32_t query_start_buffer = 1;
35 changes: 23 additions & 12 deletions core/src/Call.cpp
Original file line number Diff line number Diff line change
@@ -54,12 +54,13 @@ Call::~Call(void) {
#ifdef PROFILING
Call::my_query_id::my_query_id() {
glGenQueries(1, &the_id);
glBeginQuery(GL_TIME_ELAPSED, the_id);
}
Call::my_query_id::~my_query_id() {
glDeleteQueries(1, &the_id);
}

Call::my_query_id::my_query_id(const my_query_id&) {
glGenQueries(1, &the_id);
}
#endif


@@ -98,22 +99,32 @@ bool Call::operator()(unsigned int func) {
num_gpu_time_samples.resize(paranoid_size, 0);

if (gl_1 || gl_2) {
queries[query_start_buffer].resize(paranoid_size);
queries[query_read_buffer].resize(paranoid_size);
glBeginQuery(GL_TIME_ELAPSED, queries[query_start_buffer][func].Get());
// you can only have one query per target in flight. no idea what to do really.

//queries[query_start_buffer].resize(paranoid_size);
//queries[query_read_buffer].resize(paranoid_size);
//auto& q = queries[query_start_buffer][func];
//glBeginQuery(GL_TIME_ELAPSED, q.Get());
//q.Start();
}
#endif
res = this->callee->InCall(this->funcMap[func], *this);
#ifdef PROFILING
const std::clock_t c_end = std::clock();
last_cpu_time[func] = 1000.0 * (c_end-c_start) / CLOCKS_PER_SEC;
avg_cpu_time[func] = (avg_cpu_time[func] * num_cpu_time_samples[func] + last_cpu_time[func]) / ++num_cpu_time_samples[func];
last_cpu_time[func] = 1000.0 * (static_cast<double>(c_end-c_start) / CLOCKS_PER_SEC);
avg_cpu_time[func] = (avg_cpu_time[func] * num_cpu_time_samples[func] + last_cpu_time[func]) / (++num_cpu_time_samples[func]);
if (gl_1 || gl_2) {
GLuint64 time;
glGetQueryObjectui64v(queries[query_read_buffer][func].Get(), GL_QUERY_RESULT, &time);
last_gpu_time[func] = time / 1000000.0;
avg_gpu_time[func] = (avg_gpu_time[func] * num_gpu_time_samples[func] + last_gpu_time[func]) / ++num_gpu_time_samples[func];
std::swap(query_start_buffer, query_read_buffer);
//GLuint64 time;
//auto& q = queries[query_read_buffer][func];
//if (q.Started()) {
// int done = 0;
// glGetQueryObjectiv(q.Get(), GL_QUERY_RESULT_AVAILABLE, &done);
// ASSERT(done);
// glGetQueryObjectui64v(q.Get(), GL_QUERY_RESULT, &time);
// last_gpu_time[func] = static_cast<double>(time / 1000000.0);
// avg_gpu_time[func] = (avg_gpu_time[func] * num_gpu_time_samples[func] + last_gpu_time[func]) / ++num_gpu_time_samples[func];
//}
//std::swap(query_start_buffer, query_read_buffer);
}
#endif
#ifdef RIG_RENDERCALLS_WITH_DEBUGGROUPS