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

Tracking: Make puffin integrate with GPU, async tasks, and thread profiling data. #104

Open
TimonPost opened this issue Oct 19, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@TimonPost
Copy link
Member

Besides the main frame in the game loop, a game engine can have asynchronous tasks, threads, or GPU-related work during a frame. Currently, puffin categorizes all scopes under the same puffin frame, which is a problem when it comes to those three situations.

  • GPU work is executed in parallel to the frame.
  • Asynchronous tasks might take multiple frames to complete.
  • Threads are not dependent on frames at all.

This results in a problem described in #59 where the frame time of GPU and CPU is added up when in reality it should not be and where the timing of CPU and GPU need to be aligned. In some of Embark's internal code bases, we have large spikes for threads that take a significant amount of time which in turn make the slowest frame summary window dysfunctional because the normal frames are relatively low compared to them.

Potential suggested solutions:

  • Separate timelines of CPU/GPU with potentially relating both timelines together. Potentially do this by reporting CPU and GPU to different places. Then use two different profilers UIs to visualize them.
  • Simple effort to go around the frame time calculation is to only measure the main thread.
@TimonPost TimonPost added the enhancement New feature or request label Oct 19, 2022
@TimonPost TimonPost changed the title Tracking: Make puffin integrate with GPU, async, thread profiling data. Tracking: Make puffin integrate with GPU, async tasks, thread profiling data. Oct 19, 2022
@TimonPost TimonPost changed the title Tracking: Make puffin integrate with GPU, async tasks, thread profiling data. Tracking: Make puffin integrate with GPU, async tasks, and thread profiling data. Oct 19, 2022
@TimonPost TimonPost self-assigned this Oct 19, 2022
@gwen-lg
Copy link
Contributor

gwen-lg commented Oct 19, 2022

It's a problem than I encounter in my test with puffin-test-app and is threaded loading simulation.

Would it be possible to differentiate threads at puffin level ?
Some would be marked to frame tick, some would be marked to be frame tick independent.
Then puffin and ui could handle it ... I don't know how ^^

On your project(s), only main thread is sync on frame ? Or few other thread can be synchronized on frames ?
Concerning GPU, compute tasks are unsynchronized to frame, be display tasks are generally synchronized to frame (but with a shitf), no ?

Concerning UI, I have seen some profiler than can display multiple frames continuously in the Flamegraph. It's a possible solution for display management ?

@repi
Copy link
Contributor

repi commented Oct 20, 2022

Believe the timeline simply just needs to show continuous time, and where users of puffin can add multiple frame scopes with the "main" frame being what is typically blocking the overall frame time on a main thread, and "GPU" frame time being another common usage. So you can jump between frames and focus on them, and show what are stalls / histogram for them, but you can also scroll freely across time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants