Search Unity

Bug [OpenXR] Build log spammed with GfxDeviceD3D11Base::WaitForLastPresentationAndGetTimestamp()

Discussion in 'VR' started by unitydreamer29, Jun 17, 2021.

  1. unitydreamer29

    unitydreamer29

    Joined:
    Dec 27, 2020
    Posts:
    47
    Have an 8MB log full of:

    GfxDeviceD3D11Base::WaitForLastPresentationAndGetTimestamp() was called multiple times in a row without calling GfxDeviceD3D11Base:presentFrame(). This may result in a deadlock.

    Using OpenXR 1.2.2 with the Oculus Runtime, multi-pass, deferred rendering. I'm not seeing any issues in Editor.
     
  2. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Can you submit a bug through `Help -> Report a bug` and attach that log and any sample project you may have to recreate the issue? It is possible the log will tell us what we need but likely we will need a project that reproduces it. If you do please reply to this thread with the issue number you are assigned so we can make sure it gets assigned to the right team as quick as possible.
     
  3. unitydreamer29

    unitydreamer29

    Joined:
    Dec 27, 2020
    Posts:
    47
    @the_real_apoxol I was able to make this occur on a repro project. The issue number is 1346567.

    Seems like it only occurs when initializing XR manually instead of using the built in checkbox to Initialize on Startup, and then attempting to change resolution at runtime.
     
  4. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Awesome, thank you, we will take a look and see what is going on.
     
  5. unitydreamer29

    unitydreamer29

    Joined:
    Dec 27, 2020
    Posts:
    47
    Hey @the_real_apoxol any chance you guys were able to look at this project? After messing with it further, there may be other graphics settings which cause the error but I'm still narrowing it down.
     
  6. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Any additional information will be helpful.

    We have not had a chance to look at the project yet, but we just added an extra person to help look through the issues so hopefully we can soon.
     
  7. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Got a chance to look at this issue this morning and I believe I found the issue and a solution. The issue seems to stem from
    InitializeLoaderSync
    being called from within
    OnEnable
    . I changed your code move the following to
    Start
    right before the logic that starts the subsystems and it seems to work.

    Code (CSharp):
    1.             //If XR_Enabled, start setting up VR loader
    2.         if (XR_Enabled)
    3.         {
    4.             XR_Manager = XRGeneralSettings.Instance.Manager;
    5.             XR_Manager.InitializeLoaderSync();
    6.         }
    I made a test project that demonstrates this problem and will upload it to the bug report you filed to further help figure out why calling it from
    OnEnable
    causes those issues. Let me know if that works for you or not.
     
  8. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Also seems that updating to 4.0.7 of management fixes the issue as indicated in this case which seems to be the same issue you were running into. Hope that helps.
     
  9. unitydreamer29

    unitydreamer29

    Joined:
    Dec 27, 2020
    Posts:
    47
    Moving this solves the issue, thanks for your help! For some reason "activeLoader" is now null when using InitializeLoaderSync() in Start(), but at least the log spam and resolution glitches are gone.

    Code (CSharp):
    1.         //Attempt to get the XRDisplay from the loaded subsystem
    2.         if (XRGeneralSettings.Instance.Manager.activeLoader != null)
    3.             xrDisplay = XRGeneralSettings.Instance.Manager.activeLoader.GetLoadedSubsystem<XRDisplaySubsystem>();
    4.  
    5.         else
    6.             Debug.LogError("Active Loader is Null");
     
    the_real_apoxol likes this.
  10. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
  11. unitydreamer29

    unitydreamer29

    Joined:
    Dec 27, 2020
    Posts:
    47
    Great, it's no longer null. Thanks!
     
    the_real_apoxol likes this.
  12. RubenGarciaHernandez

    RubenGarciaHernandez

    Joined:
    Jan 13, 2022
    Posts:
    6
    I'm getting the same issue in a project using Hololens 2. XR Plugin Management 4.0.1, 4.0.7 and 4.2.1 were tested on Unity 2020.3.34f1, all have the message
    GfxDeviceD3D11Base::WaitForLastPresentationAndGetTimestamp() was called multiple times in a row without calling GfxDeviceD3D11Base:: PresentFrame(). This may result in a deadlock.
    with Windows XR Plugin 4.6.2.

    Updating to XR Plugin Management 4.2.1 and Windows XR Plugin 4.6.3 still showed the message GfxDeviceD3D11Base...
     
    Last edited: May 17, 2022