• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
Question by Habowski · Mar 11, 2016 at 01:22 PM · optimizationprofilergpusimplecpu usage

GPU profiling time not adding up properly and GPU taking up lots of time

My basic questions: Why does the GPU processing time spike when performing simple things in the update method of a game object when there is literally nothing to render? And why is the total GPU processing time in the profiler so much higher than what it adds up to from the function call table and what is it doing during that missed time that takes so long?

More Info: I made a simple test project to demonstrate this effect, there is only a single empty game object with nothing else (no cameras or lights) and it has one thing in the update function that just runs a really long for loop that continually divides two numbers (takes ~100 ms to run) when I hit a key. When I hit the key processing time spikes in both the CPU and GPU (see pic, I hit it a bunch there but it happens if I do it just once too) but this is confusing to me as there's no reason for the GPU to be doing anything as far as I'm aware, there isn't even a camera or anything to display.

So then why does it spike higher than the CPU time even and more importantly I can't debug this because nothing appears in the GPU profiler table, it just has 1 call to RenderTexture.SetActive which takes 0 ms despite having deep profile on and it says the total GPU time was 228 ms. Even when not running the for loop the GPU time is at ~15 ms still, what is it doing during that time? One last thing worth mentioning is that this happens with V sync on or off.

This simple example correlates well to what I noticed in my main game and this added GPU time really does contribute significantly to a slow FPS.

(Also, in the pic where it looks like the CPU time dips down it actually goes up a ton to ~100 ms, not down to 0 as the plot would suggest).

I'm using Unity 5.3.3f1, any help greatly appreciated in trying to understand this, thanks!

alt text

profiler.png (110.1 kB)
Comment
MutatedSoftware

People who like this

1 Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image wuzibu · Jan 12, 2017 at 09:16 PM 0
Share

I feel you. There is not much happening besides rendering static sprites. But randomly these spikes appear in the category "other" and dont add up to the shown time below.

gpu-profiler.png (241.4 kB)

2 Replies

· Add your reply
  • Sort: 
avatar image

Answer by jmkraemer · Sep 03, 2016 at 02:51 AM

I'm running into a similar issue. Anyone else having this problem?

Comment
MutatedSoftware

People who like this

1 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by jbelmonte · Aug 29, 2017 at 03:58 PM

Some points which may shed light on confusion in the original post:

  1. script time is disabled in the profiler view. Note the box next to "Scripts" is black, so script time is not shown in the graph. You need to click on the box to enable it.

  2. "vsync" is CPU time waiting for vsync and/or GPU. It makes sense that when there is a long CPU stall this value will go to 0.

  3. GPU Usage is entirely "other". Unity isn't too clear on what that label means, but likely this is just the graphic driver waiting for vsync (hence it's nominally 16 ms in your case).

Summary: you've added a big CPU loop in your project as a test, but don't have the corresponding "Scripts" metric enabled in the profiler for the impact to be visible. The profiler output is fairly meaningless without that, and you're inferring the wrong things from it.

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to fully use the CPU or GPU 0 Answers

Need help profiling first game. Huge GPU spikes? 1 Answer

high CPU/GPU usage when vfx graph are in the scene but not playing 0 Answers

Physics2D increases activity when... not moving? 0 Answers

Android internal profiler CPU or GPU bound 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges