Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

DX12 & OpenXR consistent crashing.

Discussion in '2021.2 Beta' started by Freakish, Jul 31, 2021.

  1. Freakish

    Freakish

    Joined:
    Jun 3, 2015
    Posts:
    81
    I'm having a few crashes that are driving me crazy, wondering if this gives any insight to anyone, as to what is failing and where. Or where I should be looking for more info?

    It appears to be OpenXR and DX12 related. I have forced DX12 Debug from the commandline: It has shown a bit more info, but beyond my depth.

    Any help would be appreciated.





    1. d3d12: swapchain present failed (887a0005).
    2. Device removed reason (887a0006).
    3. d3d12: CreateResource for buffer failed.
    4. d3d12: failed to create a buffer of size 65536
    5. BufferD3D12 : Unexpected null accessor on Buffer
    6. d3d12: DXGI_ERROR_DEVICE_REMOVED reason (887a0006).
    7. d3d12: DRED CommandList: (null)
    8. d3d12: DRED CommandQueue: (null)
    9. d3d12: DRED BreadCrumb count: 0
    10. d3d12: DRED Command History (last is suspect):0 0 0 0 0 0 0 0 0 0

    Code (CSharp):
    1.  
    2. [XR] [OpenXR Input]: Application space recovered
    3. XRTextureManager::RequestCreateTexture
    4. XRTextureManager::SetupRenderTextureFromXRRequest (id: 3 col: 000002763C13F400 d: 0000000000000000)
    5. RenderTexture::Create (id: 3)
    6. IVRDeviceCallback_CreateEyeTextureResources 000002763C13F400
    7. d3d12: swapchain present failed (887a0005).
    8. d3d12: swapchain present failed (887a0005).
    9. Device removed reason (887a0006).
    10. GfxDevice was not out of Local memory
    11. Local memory usage:
    12. Budget: 11927552000
    13. CurrentUsage: 4969684992
    14. AvailableForReservation: 67108864
    15. CurrentReservation: 6097993728
    16. GfxDevice was not out of Non-Local memory
    17. Non-Local memory usage:
    18. Budget: 33524613120
    19. CurrentUsage: 227389440
    20. AvailableForReservation: 0
    21. CurrentReservation: 16896524288
    22. Set -force-d3d12-debug for more information on device removal
    23. d3d12 : CreateCommittedResource 'BufferD3D12::CreateBufferResource() Buffer' (65536 x 1) format 0 failed (887a0005).
    24.     Device Remove Reason (HRESULT): 0x887a0006
    25.     Device Memory Stats:
    26.         Local AvailableForReservation: 5815 MB, Budget: 11375 MB, CurrentUsage: 4739 MB, CurrentReservation: 64 MB
    27.         Non-local AvailableForReservation: 16113 MB, Budget: 31971 MB, CurrentUsage: 216 MB, CurrentReservation: 0 MB
    28. d3d12: CreateResource for buffer failed.
    29. d3d12: failed to create a buffer of size 65536
    30. BufferD3D12 : Unexpected null accessor on Buffer
    31. BufferD3D12 : Unexpected null accessor on Buffer
    32. BufferD3D12 : Unexpected null accessor on Buffer
    33. Crash!!!

    Code (csharp):
    1.  
    2. [XR] [31636] [14:31:49.897][Info   ] ==== OpenXR Swapchain Details ====
    3. [XR] [31636] [14:31:49.897][Info   ]
    4. [XR] [31636] [14:31:49.897][Info   ] Render Mode: Single Pass Instanced
    5. [XR] [31636] [14:31:49.897][Info   ] Depth Submission Mode: None
    6. [XR] [31636] [14:31:49.897][Info   ]
    7. [XR] [31636] [14:31:49.897][Info   ] Swapchain Formats:  [c:29] 91 2 10 24 40 55 45 20
    8. [XR] [31636] [14:31:49.897][Info   ] Creating swapchain for view 0 with dimensions Width=1964 Height=2040 SampleCount=1
    9. [XR] [31636] [14:31:49.897][Info   ]
    10. [XR] [31636] [14:31:49.897][Info   ] ==== Last 20 non-XR_SUCCESS returns ====
    11. [XR] [31636] [14:31:49.897][Info   ] [SUCCESS] xrGetReferenceSpaceBoundsRect: XR_SPACE_BOUNDS_UNAVAILABLE (2x)
    12. [XR] [31636] [14:31:49.897][Info   ] [SUCCESS] xrPollEvent: XR_EVENT_UNAVAILABLE (2x)
    13. [XR] [31636] [14:31:49.897][Info   ]
    14. [XR] [31636] [14:31:49.897][Info   ] ==== Last 20 Events ====
    15. [XR] [31636] [14:31:49.897][Info   ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_UNKNOWN->XR_SESSION_STATE_IDLE
    16. [XR] [31636] [14:31:49.897][Info   ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_IDLE->XR_SESSION_STATE_READY
    17. [XR] [31636] [14:31:49.897][Info   ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_READY->XR_SESSION_STATE_SYNCHRONIZED
    18. [XR] [31636] [14:31:49.897][Info   ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_SYNCHRONIZED->XR_SESSION_STATE_VISIBLE
    19. [XR] [31636] [14:31:49.897][Info   ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_VISIBLE->XR_SESSION_STATE_FOCUSED
    20. [XR] [31636] [14:31:49.897][Info   ]
    21. ==== End Unity OpenXR Diagnostic Report ====
    22.  
    And then the last bit of the 'seemingly' relevant.
    Code (csharp):
    1.  
    2. [XR] [OpenXR Input]: Application space recovered
    3. XRTextureManager::RequestCreateTexture
    4. XRTextureManager::SetupRenderTextureFromXRRequest (id: 3 col: 00000245AB6E1B10 d: 0000000000000000)
    5. RenderTexture::Create (id: 3)
    6. IVRDeviceCallback_CreateEyeTextureResources 00000245AB6E1B10
    7. [XR] [OpenXR Input]: [xrLocateSpace] Failed to locate view space relative to app space at time <36155194747620103> [ErrorCode: XR_ERROR_TIME_INVALID]
    8. [XR] [OpenXR Input]: [xrLocateSpace] Failed to locate space for ActionSet <oculustouchcontroller> Action <devicePose> SubPath </user/hand/left> at Time <> [ErrorCode: XR_ERROR_TIME_INVALID]
    9. [XR] [OpenXR Input]: [xrLocateSpace] Failed to locate space for ActionSet <oculustouchcontroller> Action <pointer> SubPath </user/hand/left> at Time <> [ErrorCode: XR_ERROR_TIME_INVALID]
    10. [XR] [OpenXR Input]: [xrLocateSpace] Failed to locate space for ActionSet <oculustouchcontroller> Action <devicePose> SubPath </user/hand/right> at Time <> [ErrorCode: XR_ERROR_TIME_INVALID]
    11. [XR] [OpenXR Input]: [xrLocateSpace] Failed to locate space for ActionSet <oculustouchcontroller> Action <pointer> SubPath </user/hand/right> at Time <> [ErrorCode: XR_ERROR_TIME_INVALID]
    12. TrimDiskCacheJob: Current cache size 495mb
    13. Error on graphics thread: 1
    14. XRTextureManager::RequestDestroyTexture
    15. XRTextureManager::RequestDestroyTexture
    16. XRTextureManager::RequestDestroyTexture
    17. d3d12: swapchain present failed (887a0005).
    18. d3d12: swapchain present failed (887a0005).
    19. Device removed reason (887a0006).
    20. GfxDevice was not out of Local memory
    21. Local memory usage:
    22.  Budget: 11927552000
    23.  CurrentUsage: 4248125440
    24.  AvailableForReservation: 67108864
    25.  CurrentReservation: 6097993728
    26. GfxDevice was not out of Non-Local memory
    27. Non-Local memory usage:
    28.  Budget: 33524613120
    29.  CurrentUsage: 296316928
    30.  AvailableForReservation: 0
    31.  CurrentReservation: 16896524288
    32. d3d12:     DXGI_ERROR_DEVICE_REMOVED reason (887a0006).
    33. d3d12:     DRED CommandList: (null)
    34. d3d12:     DRED CommandQueue: (null)
    35. d3d12:     DRED BreadCrumb count: 0
    36. d3d12:     DRED Command History (last is suspect):0 0 0 0 0 0 0 0 0 0
    37.  
    38.  
     
    Last edited: Aug 1, 2021
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Hi @Freakish,

    Could you please submit a bug report for this issue so we can have a look at your log files?
     
  3. Freakish

    Freakish

    Joined:
    Jun 3, 2015
    Posts:
    81
    I started a clean DX12, OpenXR project today and just submitted the crash (Case 1356281) from that.

    I did notice this time that it crashed 3 out of 4 times, if I clicked from the 'Game' Tab to the 'Scene' Tab during play mode.

    But it happens seemingly randomly otherwise. For example I have successfully setup and used multiple Grabbable items, teleport and snapturning, and tested them two dozen times without a single crash.... Just now had it work 6 times, and on the 7th time I pressed play, crash.

    Thanks a lot for taking a look, would appreciate any help.
     
    Last edited: Aug 7, 2021
    LeonhardP likes this.
  4. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    @Freakish What I found in past was that:

    - OpenXR works in DX11 without issues
    - OpenXR works in DX12 while using Oculus runtime (Depth Submission Mode can be set to any value and it will work)
    - OpenXR crashes in DX12 while using OpenVR/SteamVR runtime with Depth Submission Mode set to anything but None

    So first thing I'd test on your case is making sure Depth Submission Mode is set to "None". Not sure if you need this mode enabled for anything but things like Oculus ASW.
     
  5. Freakish

    Freakish

    Joined:
    Jun 3, 2015
    Posts:
    81
    Thanks rz_0lento.

    I never got any image displayed in the HMD (Oculus Q2 headset) when using any Depth Submission Mode set to anything other than none, I didn't get crashes, when set to anything else, but couldn't get an image in the Oculus HMD.

    So the crashes I'm experiencing do have the depth submission mode set to none.

    Code (csharp):
    1. [[XR] [31636] [14:31:49.897][Info   ] Render Mode: Single Pass Instanced
    2. [LIST=1]
    3. [*][XR] [31636] [14:31:49.897][Info   ] Depth Submission Mode: None']
    [/LIST]

    But thanks for the suggestions nonetheless. I will however perhaps try to see if I have less issues using the Oculus Runtime, and not the SteamVR which has been my standard for sometime now, to see if I can get more mileage that way.
     
  6. wm-VR

    wm-VR

    Joined:
    Aug 17, 2014
    Posts:
    123
    I have a similar issue here.

    I am running a HDRP + VR + OpenXR project.

    I need to render a few pictures with the path tracing feature for marketing purposes (will be deactivated in the build or in play mode, I don't need any RT features) but at the very moment I enable DX12 Unity crashes almost instantaneously, sometimes after a few clicks.
     
  7. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    287
    Unity 2022.3.0.1f + openXR + URP + ECS

    Just switched a project from a working Dx11 to a randomly crashing Dx12. Has there been any progress on the reported bug?

    I've bug reported without a sample project (IN-46781), but my editor log seems very similar.

    Code (CSharp):
    1. SteamInternal_SetMinidumpSteamID:  Caching Steam ID:  76561198028219486 [API loaded no]
    2. XRTextureManager::RequestCreateTexture
    3. XRTextureManager::SetupRenderTextureFromXRRequest (id: 3 col: 00000294B0D6AFF0 d: 0000000000000000 sr: 0000000000000000)
    4. RenderTexture::Create (id: 3)
    5. IVRDeviceCallback_CreateEyeTextureResources 00000294B0D6AFF0
    6. Scanning for USB devices : 18.506ms
    7. Asset Pipeline Refresh (id=a9a2ab14b964a0d47a53855dd6899123): Total: 0.025 seconds - Initiated by RefreshV2(NoUpdateAssetOptions)
    8. d3d12 : CreateCommittedResource 'BufferD3D12::CreateBufferResource() Buffer' (20160 x 1) format 0 failed (887a0005).
    9.     Device Remove Reason (HRESULT): 0x887a0006
    10.     Device Memory Stats:
    11.         Local AvailableForReservation: 3819 MB, Budget: 7383 MB, CurrentUsage: 2494 MB, CurrentReservation: 64 MB
    12.         Non-local AvailableForReservation: 3873 MB, Budget: 7490 MB, CurrentUsage: 326 MB, CurrentReservation: 0 MB
    13. d3d12: CreateResource for buffer failed.
    14. d3d12: failed to create a buffer of size 20160
    15. d3d12 : CreateCommittedResource 'BufferD3D12::CreateBufferResource() Buffer' (2520 x 1) format 0 failed (887a0005).
    16.     Device Remove Reason (HRESULT): 0x887a0006
    17.     Device Memory Stats:
    18.         Local AvailableForReservation: 3819 MB, Budget: 7383 MB, CurrentUsage: 2494 MB, CurrentReservation: 64 MB
    19.         Non-local AvailableForReservation: 3873 MB, Budget: 7490 MB, CurrentUsage: 326 MB, CurrentReservation: 0 MB
    20. d3d12: CreateResource for buffer failed.
    21. d3d12: failed to create a buffer of size 2520
    22. BufferD3D12 : Unexpected null accessor on Buffer
    23. Crash!!!