Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Vulkan bug? Quest 2 + URP + Graphics Jobs + NO Multithreaded Rendering = slow

Discussion in 'General Graphics' started by funkyCoty, Dec 7, 2021.

  1. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    719
    Hey there. We're working on a Quest 2 project which is using Vulkan. Quest 2 only gives developers access to three (3) cores. By default, Unity creates a main thread, a render thread, and two job threads. That's 4 threads. To avoid two threads fighting for time over one core; I figured it would make sense to disable Multithreaded Rendering and keep Graphics Jobs enabled, since the job threads are there either way.

    On Unity 2021.2.1f1, I had this working and everything was great. One of our developers recently updated the XR plugins in our project, and suddenly our framerate was halved! Profiling I saw something interesting. I don't remember seeing this before, but now there's a Vulkan Submission Thread! This is with graphics jobs enabled, multithreaded rendering off.

    upload_2021-12-7_15-20-40.png

    I'm assuming the main thread is intended to wait on the previous frame's submission thread commands to finish, but I think the bug here is that the main thread is waiting on the current frame's submission thread to finish. Just waiting away :(

    So, to experiment I disabled the Graphics Jobs option and re-enabled the multithreaded rendering option. Framerate doubled again! However, it's inconsistent (I believe it's the issue with having four threads on a device with only three cores).

    On a similar scene / camera angle / amount of work, here's a profile timeline view:

    upload_2021-12-7_15-22-43.png
    upload_2021-12-7_15-23-35.png

    Here's our current info:

    XR Plugin Management: 4.2.0
    Oculus XR Plugin: 3.0.0-pre.1
    OpenXR Plugin: 1.3.1
    Unity 2021.2.1f1

    Any help from Unity would be greatly appreciated here!
     

    Attached Files:

    Pawige, reddo and mrstruijk like this.
  2. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    719
  3. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    479
    If there is a Vulkan submission thread you have „Graphics Jobs” enabled.
    It should probably be disabled because it implicitly disables Adreno LRZ/HSR.
     
  4. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    719
    Is this documented anywhere?
     
  5. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    479
  6. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    719
  7. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    92
    Do you have any updates / further information on this ? What solution did you guys settle on ?
     
  8. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    719
    On Unity 2021.2.19f1, enabling Graphics Jobs = framerate halves on quest 2. GPU utilization sits at 50% when it's like this. I don't know why, and I have no further info in that area. I've just left Multithreaded Rendering enabled with Graphics Jobs disabled for now, and tried to keep the game's performance with enough overhead to deal with the occasional CPU spike. GPU utilization sits around 95% when it's like this.
     
    zalogic and tspk91 like this.
  9. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    131
    I'm having the same issues (graphic jobs tanks GPU performance) with 2021.3.9f1 and 2021.3.10f1. This thread is a life saver! Any updates on this?
     
  10. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    719
    I wish. No, I'm still using the settings I posted above ^
    Would be great if someone from Unity could chime in on a possible solution. One posted above that the performance may be due to LRZ being disabled, but I don't know for sure if that's true or if there's simply an internal unity bug on quest.
     
  11. Cloudwalker_

    Cloudwalker_

    Joined:
    Jan 3, 2014
    Posts:
    140
    Any updates ln this ?
     
  12. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,974
    tspk91 likes this.