Announcement

Collapse
No announcement yet.

Am I CPU bound?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Am I CPU bound?

    I finished my Android game, and I am now looking to optimize.

    On a lower end device, I get varying FPS (from 20-50).
    As an example, at one point on the device I had the following:

    Frame:31ms
    Game:12ms
    Draw:24ms
    Draws:203
    Prims:83k

    Seeing how the frame is greater than both game and draw, I would assume I am GPU bound. However, these stats were captured using r.screenPercentage 1 (And yes, the command did indeed work).

    So does this mean I am bound by the draw thread? If so, why is the frame greater to and not equal to draw?

    (Second part to question)
    How do I profile the issue? There is extremely little information on profiling the draw thread. The only things I have found have been :
    1) Draw calls (I max out at 200, so I doubt that's a problem)
    2) Object count (Not sure but I don't think my count goes above 1-2 hundred).

    Hopefully I get some answers, I really want to finish this project and release it!

    #2
    What is your GPU time? (Stat unit should show this)

    Frame is basically max of
    Game
    Draw
    GPU

    Draw can benefit greatly from culling.
    Tim Hobson recently updated docs around it https://docs.unrealengine.com/en-us/...llingReference
    Definitely worth a read.

    Some things you can try for testing - set Min Draw Distance to something really low.


    https://www.casualdistractiongames.com

    Comment


      #3
      Originally posted by OptimisticMonkey View Post
      What is your GPU time? (Stat unit should show this)

      Frame is basically max of
      Game
      Draw
      GPU

      Draw can benefit greatly from culling.
      Tim Hobson recently updated docs around it https://docs.unrealengine.com/en-us/...llingReference
      Definitely worth a read.

      Some things you can try for testing - set Min Draw Distance to something really low.

      I'm on Android so it doesn't show the GPU time.

      Could it be a GPU limitation despite having the screen percentage being set at 1%?

      Also, I can't use culling on mobile. But I am using pre computed visibility.

      Comment


        #4
        Okay, so I ran the command 'show staticmeshes' and I still get around the same performance. I can't stay above 40fps. And even with the static meshes disabled, my frame time is 60% more than my game and draw times.

        What's going on here?

        Comment


          #5
          Originally posted by OptimisticMonkey View Post
          What is your GPU time? (Stat unit should show this)

          Frame is basically max of
          Game
          Draw
          GPU

          Draw can benefit greatly from culling.
          Tim Hobson recently updated docs around it https://docs.unrealengine.com/en-us/...llingReference
          Definitely worth a read.

          Some things you can try for testing - set Min Draw Distance to something really low.

          Could it simply be a problem with the phone?

          Comment


            #6
            Hi. Maybe you make some static mesh actors in your level.if yes then change the static mesh actors settings .change the min and Max draw distance.

            I think android phone are bound per view 30k vertices.

            Comment


              #7
              Yes your Draw stat is too high. Draw is CPU render thread.
              GPU has to wait for game and draw thread.

              Your framerate will only be as fast as the slowest stat. Since your Draw = 24ms = 40 FPS

              Comment


                #8
                Originally posted by Gallonmate View Post
                Yes your Draw stat is too high. Draw is CPU render thread.
                GPU has to wait for game and draw thread.

                Your framerate will only be as fast as the slowest stat. Since your Draw = 24ms = 40 FPS
                But if the draw is taking the longest, shouldn't the frame be equal to it and not 31ms?

                Comment


                  #9
                  Frame time is basically GPU time. GPU time is always after Draw and Game. GPU can only go as fast as draw. But GPU has additional stuff to do, so with an already high draw, things are now even slower.

                  Fix your draw time.

                  Comment


                    #10
                    Originally posted by Gallonmate View Post
                    Frame time is basically GPU time. GPU time is always after Draw and Game. GPU can only go as fast as draw. But GPU has additional stuff to do, so with an already high draw, things are now even slower.

                    Fix your draw time.
                    My draw calls aren't ridiculously high, and the poly count is within an acceptable range (I think).

                    What are some things that could cause the draw thread to be slow?

                    Comment


                      #11
                      What kind of phone is it?

                      As I said before, you could set the Min Draw Distance to something ridiculously low on your meshes. This will cull most of your meshes. See if this improves your framerate.


                      https://www.casualdistractiongames.com

                      Comment


                        #12
                        Originally posted by OptimisticMonkey View Post
                        What kind of phone is it?

                        As I said before, you could set the Min Draw Distance to something ridiculously low on your meshes. This will cull most of your meshes. See if this improves your framerate.

                        Culling doesn't work on mobile. However, I set most (90%) of my meshes to hidden in game, and the performance is still terrible.

                        What about collision complexity? Could that effect performance dramatically? Because most of my static meshes do have complex collision on them. I haven't been able to find an answer to this question online. I've been trying to find a way to test if the collision is an issue. Still haven't come up with anything.

                        Comment


                          #13
                          Originally posted by frog8fly View Post

                          Culling doesn't work on mobile. However, I set most (90%) of my meshes to hidden in game, and the performance is still terrible.

                          What about collision complexity? Could that effect performance dramatically? Because most of my static meshes do have complex collision on them. I haven't been able to find an answer to this question online. I've been trying to find a way to test if the collision is an issue. Still haven't come up with anything.
                          As the others said you should post your hardware you are testing with

                          Collision is indeed a huge CPU drain on mobile - you definitely need to go through and manually turn collision off for everything that does not need it. On the objects that do need it see if you can reduce the collision to simple shapes and reduce to only query or physics collision.

                          Also mobile culling is now supported.

                          Hardware occlusion on 4.20 with OpenGL 3.1 for supported phones (I would use 4.21 as there were bugs with it in 4.20)

                          and software occlusion on 4.21 with OpenGL 2:

                          New: Exposed “Support Software Occlusion Culling” option to Project Settings to simply setup of Software Occlusion Culling. You can find it under Project Settings > Rendering > Mobile section.
                          From: https://docs.unrealengine.com/en-us/Builds/4_21
                          Headgear - VR/AR solutions

                          VR Game Release: We Come In Peace... Oculus GearVR | Google Play Daydream

                          Comment

                          Working...
                          X