The game im making for iOS is having a lot of memory issues. so i started searching to see what could be the problem with instruments and with the OpenGL ES analyzer i came up with 2 occurrences where CPU wait on GPU for finish. I did some searches on it and im not exactly sure what it is still. nor am i sure how to fix it. can help me out with where to go with this?
what do you mean CPU waits for GPU to finish? Do you mean, that the CPU calculates what happens before the frame, then the GRP renders it?
well thats what the OpenGL ES analyzer showed. [CPU wait on GPU for finish] exact words. and i was wondering what could be the cause of it. is it my textures? or what?
Thats probably because the CPU is waiting for the GPU to finish rendering the frame
check Graham reply, and yes - it has nothing to do with memory issues
Answer by Graham-Dunnett
Mar 20, 2013 at 01:26 PM
Simple description: On iOS once Unity has finished all its work, it will hand over the scene to OpenGL to render. The work inside OpenGL happens on the CPU, and the CPU ends up giving instructions to the GPU about what to render. Once the GPU has finished rendering what's on the screen is what your app wanted. Control then passes back from the OpenGL driver to Unity.
Actual description: If the work the GPU has to do is big, then this way of working means the CPU is idle for a lot of the time. So, whilst the GPU is busy doing it's thing, control actually returns to Unity, and it then gets on working hard on the next frame. This is meant to allow the CPU and the GPU to be busy all the time.
Now, if Unity has prepared frame N, and the GPU is still working on frame N-1, then the CPU has to idle waiting for the GPU to finish. This scenario is called GPU bound, and is the situation that Instruments is reporting. The Unity built in (non-Pro) profiler reports this as cpu-waits-gpu. The time spent inside OpenGL is shows as cpu-ogles-drv.
Hello Graham Dunnett I have a very urgent project for pc platform and it requires cpu-gpu synchronization. I want ask some questions about it.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
14 People are following this question.
Several Memory Optimization Questions
iPhone Game Crashing During Application.Load
Why do textures take double memory on iOS and Android devices?
Problem when building to development iPhone
Unity IOS(IPad2) auto exit app after loaded too many images