Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
avatar image
0
Question by JesterGameCraft · Dec 07, 2017 at 06:08 PM · iosfpsxcodeprofileropengl

CPU Usage Not Constant on iOS 11.2 (Metal) in Profiler and Xcode FPS CPU time != Profiler

Greetings...

.

I've been trying to get a consistent/constant baseline for CPU usage on iPad Pro 9" with Metal enabled. I had a look at this Bug: https://issuetracker.unity3d.com/issues/ios-gfx-dot-waitforpresent-spikes-on-metal-every-few-minutes which I suspect is responsible but it talks specifically about GFX.WaitForPresent and I'm seeing spikes in Physics, Other and Renderer. I have not filed a bug at this point, first wanted to ask it here. Thank You in advance to anyone providing insight.

.

Background: I have an empty scene with a plane and a cube, rigid body on the cube it's just sitting on the plane with a box collider. Lights are disabled, skybox disabled, background track is looping/playing, frame rate is set to 60. When I run this on the iPad and open up the profiler I see frame rate on the CPU reported below 250FPS (that's great!) but then I see spikes that reach to 100FPS (for no reason), some even to 60FPS or even 30FPS (although the latter does not happen often). The graph pattern is such that CPU usage goes low to ~250FPS then after a moment (2-3sec) it rises to a spike. Sometimes the spikes happen in the middle of the 250FPS section (if you take my meaning). When I remove metal and use OpenGL 2.0 I see a constant CPU usage, with metal I see this pattern of spikes and low usage (all over the place). With metal I see this even if I enable the Experimental renderer for metal in the Player settings. My concern is that when I start to add more and more functionality to the game these spikes will grow bigger proportionally.

.

  • Am I the only person seeing this on iOS metal? Or is this understood and accepted behaviour?

.

The bug listed above states that iOS throttles the CPU usage to keep power usage small, then when a frame takes a bit longer to render it get's caught and we see a spike. In essence it's like working with a slower CPU for one or two frames. However what I'm seeing in the profiler seems to be all over the place disarray. Another thing I noticed was in Xcode Debug Navigator->FPS. When using OpenGL 2.0 with a device that is not Metal capable it shows the CPU usage that aligns with what Profiler is showing. If I run OpenGL on my iPad that is Metal the CPU in Xcode is 0 (not reported). I assume that this is an Apple bug or it just can't report in this circumstance. Lastly when I use Metal on the iPad Pro the CPU is always reported at around 16.6ms (which is the maximum for 60 FPS that my game is set at). Doesn't matter what is going on in the scene the CPU hovers around this area and never goes lower then that. This is not consistent with OpenGL 2.0 reporting with a GL device as noted above.

.

  • Why is the CPU usage reported in Profiler (connected to device) so different to what Xcode is reporting? It seems Xcode is reporting max that I can have while profiler is showing the real value. Anyone else seeing this? Is this Apple or Unity issue?

.

If anyone can shed any answers or at least confirm what I'm seeing I would very much appreciate it.

.

Thank You, Regards.

.

PS: Sorry about the dots between the paragraphs but the paragraphs are not being respected in my browser. I'm using Safari (latest). Also tried HTML tags but they don't work either.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by terence410 · Jul 24, 2018 at 01:22 PM

we experienced very similar issues. Which includes sample project made by Unity https://assetstore.unity.com/packages/essentials/tutorial-projects/2d-roguelike-29825

I think this is a pretty common problem, but funny that not many people share such experience and many will say it's probably caused by GC. But i wanted to emphasis that we already make the project without GC, but the problem still exist.

Comment
Add comment · 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.

Follow this Question

Answers Answers and Comments

130 People are following this question.

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

Related Questions

Set fps from default 30 to 60 on iOS and Unity 3.5.3? 1 Answer

Memory usage in xcode does not equal to the number in unity profiler 0 Answers

RenderTexture runtime error on app load on iOS 1 Answer

Cannot turn Unity iOS internal profiler off 0 Answers

Don't have iPhone_Profiler.h in iOS build 1 Answer


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