question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[WIP] Profiling GPU & CPU

See original GitHub issue

Major Goals

  1. What is causing the code to do more GPU calls and which GPU calls cause Frame Rate to drop.
  2. What is the most extensive job on GPU.
  3. Which parts of the code need to be optimized.
  4. Profiling on average cards like RX580, GTX 1050, GTX 1060 & etc.
  5. Profiling on different browsers.

Description of Issue:

Before I dive deep into the explanation of what is happening I would strongly recommend that one should go through the attached files.

The issue is primarily based on the tests performed using the CPU/GPU traces along with the Performance logger.

High CPU Usage

Currently, if we look at the screenshot attached below we can see clearly that there is a high CPU usage by the application during rendering and during the usage, the CPU usage increases drastically.

Performance Degradation in Update Avatar

On further diving deep into the function calls of what caused this high cpu usage during the rendering is caused by the UpdateAvatar function that actually calls interpolants which takes most of the CPU. This actually triggers the browsers to drop the frames which don’t make on time.

image

Preview Canvas

Furthermore, the issue doesn’t stop here there is a high render usage call which is made to the preview canvas on every frame, and on average end GPU machine/Mac’s this causes a massive drop in FPS. Turning off the preview canvas actually makes the application’s FPS to be increases by almost 10 FPS. Although the preview canvas is not required to re-render on each frame instead it’s required to be rendered on avatar update only.

Late Update of Avatar

The issue with the avatar’s system late update function triggers the on VRM Spring Bone which triggers the multiplyMatricess call. One call takes approx 387 MS to calculate the result that causes the entire frame to wait for its completion.

image

Browsers

  • Opera GX is giving access to more resources than Chrome
  • Chrome is limiting FPS.

Card Compatibility

Scene Card FPS Crash If Any
Street Rx580 30-60 if AMD Free Sync is on application crashes
Street GTX 1050 10-15 -
Street GTX 1060 10-15 -
Street Macbook Pro 2019 AMD 4GB 5-6 -
Street Macbook M1 15-20 -

Issue Attachments

Performance Profile of Grid Scene Trace Profile of Grid Scene

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
abeersaqibcommented, Nov 24, 2021

One interesting fact that I found it that there is a Gaming browser Opera GX that doesn’t cap the resources which are being capped mostly in chrome and lets you use your GPU to its full.

I am currently working on Avatars & Animations and checking GPU/Heap by switching on/off certain aspects.

1reaction
avaercommented, Nov 25, 2021

Opera GX might be a good thing to base our Electron-style package on. I know Chrome has a bunch of anti-gaming heuristics we are fighting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Profiling CPU and GPU time - jMonkeyEngine Hub
Profiling CPU and GPU time ... So as I hinted in the monthly WIP Sc thread I made a detailed profiler for the...
Read more >
Profiler User's Guide - NVIDIA Documentation Center
The Visual Profiler is a graphical profiling tool that displays a timeline of your application's CPU and GPU activity, and that includes an ......
Read more >
My WIP PC-011D build complete with delayed cpu and gpu : r/lianli
Awesome. Just recently finished mine with Z490 Vision D, i9 10900k and RTX3090 FE in O11D. The case is a treat to work...
Read more >
Scalene: A High-Performance, High-Precision Cpu, Gpu, And ...
Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python. ... wip. feature creep. clustering. startups. settings. similayer.
Read more >
[W.I.P]stereo_mode_use_shared_parser helps a lot with ...
[W.I.P]stereo_mode_use_shared_parser helps a lot with balancing CPU/GPU usage ... M-2000C X-55 VR profile / M-2000C custom SERVAL symbols ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found