DX12 & OpenXR consistent crashing.

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.

  • d3d12: swapchain present failed (887a0005).

  • Device removed reason (887a0006).

  • d3d12: CreateResource for buffer failed.

  • d3d12: failed to create a buffer of size 65536

  • BufferD3D12 : Unexpected null accessor on Buffer

  • d3d12: DXGI_ERROR_DEVICE_REMOVED reason (887a0006).

  • d3d12: DRED CommandList: (null)

  • d3d12: DRED CommandQueue: (null)

  • d3d12: DRED BreadCrumb count: 0

  • d3d12: DRED Command History (last is suspect):0 0 0 0 0 0 0 0 0 0

[XR] [OpenXR Input]: Application space recovered
XRTextureManager::RequestCreateTexture
XRTextureManager::SetupRenderTextureFromXRRequest (id: 3 col: 000002763C13F400 d: 0000000000000000)
RenderTexture::Create (id: 3)
IVRDeviceCallback_CreateEyeTextureResources 000002763C13F400
d3d12: swapchain present failed (887a0005).
d3d12: swapchain present failed (887a0005).
Device removed reason (887a0006).
GfxDevice was not out of Local memory
Local memory usage:
Budget: 11927552000
CurrentUsage: 4969684992
AvailableForReservation: 67108864
CurrentReservation: 6097993728
GfxDevice was not out of Non-Local memory
Non-Local memory usage:
Budget: 33524613120
CurrentUsage: 227389440
AvailableForReservation: 0
CurrentReservation: 16896524288
Set -force-d3d12-debug for more information on device removal
d3d12 : CreateCommittedResource 'BufferD3D12::CreateBufferResource() Buffer' (65536 x 1) format 0 failed (887a0005).
    Device Remove Reason (HRESULT): 0x887a0006
    Device Memory Stats:
        Local AvailableForReservation: 5815 MB, Budget: 11375 MB, CurrentUsage: 4739 MB, CurrentReservation: 64 MB
        Non-local AvailableForReservation: 16113 MB, Budget: 31971 MB, CurrentUsage: 216 MB, CurrentReservation: 0 MB
d3d12: CreateResource for buffer failed.
d3d12: failed to create a buffer of size 65536
BufferD3D12 : Unexpected null accessor on Buffer
BufferD3D12 : Unexpected null accessor on Buffer
BufferD3D12 : Unexpected null accessor on Buffer
Crash!!!
[XR] [31636] [14:31:49.897][Info   ] ==== OpenXR Swapchain Details ====
[XR] [31636] [14:31:49.897][Info   ]
[XR] [31636] [14:31:49.897][Info   ] Render Mode: Single Pass Instanced
[XR] [31636] [14:31:49.897][Info   ] Depth Submission Mode: None
[XR] [31636] [14:31:49.897][Info   ]
[XR] [31636] [14:31:49.897][Info   ] Swapchain Formats:  [c:29] 91 2 10 24 40 55 45 20
[XR] [31636] [14:31:49.897][Info   ] Creating swapchain for view 0 with dimensions Width=1964 Height=2040 SampleCount=1
[XR] [31636] [14:31:49.897][Info   ]
[XR] [31636] [14:31:49.897][Info   ] ==== Last 20 non-XR_SUCCESS returns ====
[XR] [31636] [14:31:49.897][Info   ] [SUCCESS] xrGetReferenceSpaceBoundsRect: XR_SPACE_BOUNDS_UNAVAILABLE (2x)
[XR] [31636] [14:31:49.897][Info   ] [SUCCESS] xrPollEvent: XR_EVENT_UNAVAILABLE (2x)
[XR] [31636] [14:31:49.897][Info   ]
[XR] [31636] [14:31:49.897][Info   ] ==== Last 20 Events ====
[XR] [31636] [14:31:49.897][Info   ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_UNKNOWN->XR_SESSION_STATE_IDLE
[XR] [31636] [14:31:49.897][Info   ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_IDLE->XR_SESSION_STATE_READY
[XR] [31636] [14:31:49.897][Info   ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_READY->XR_SESSION_STATE_SYNCHRONIZED
[XR] [31636] [14:31:49.897][Info   ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_SYNCHRONIZED->XR_SESSION_STATE_VISIBLE
[XR] [31636] [14:31:49.897][Info   ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_VISIBLE->XR_SESSION_STATE_FOCUSED
[XR] [31636] [14:31:49.897][Info   ]
==== End Unity OpenXR Diagnostic Report ====

And then the last bit of the ‘seemingly’ relevant.

[XR] [OpenXR Input]: Application space recovered
XRTextureManager::RequestCreateTexture
XRTextureManager::SetupRenderTextureFromXRRequest (id: 3 col: 00000245AB6E1B10 d: 0000000000000000)
RenderTexture::Create (id: 3)
IVRDeviceCallback_CreateEyeTextureResources 00000245AB6E1B10
[XR] [OpenXR Input]: [xrLocateSpace] Failed to locate view space relative to app space at time <36155194747620103> [ErrorCode: XR_ERROR_TIME_INVALID]
[XR] [OpenXR Input]: [xrLocateSpace] Failed to locate space for ActionSet <oculustouchcontroller> Action <devicePose> SubPath </user/hand/left> at Time <> [ErrorCode: XR_ERROR_TIME_INVALID]
[XR] [OpenXR Input]: [xrLocateSpace] Failed to locate space for ActionSet <oculustouchcontroller> Action <pointer> SubPath </user/hand/left> at Time <> [ErrorCode: XR_ERROR_TIME_INVALID]
[XR] [OpenXR Input]: [xrLocateSpace] Failed to locate space for ActionSet <oculustouchcontroller> Action <devicePose> SubPath </user/hand/right> at Time <> [ErrorCode: XR_ERROR_TIME_INVALID]
[XR] [OpenXR Input]: [xrLocateSpace] Failed to locate space for ActionSet <oculustouchcontroller> Action <pointer> SubPath </user/hand/right> at Time <> [ErrorCode: XR_ERROR_TIME_INVALID]
TrimDiskCacheJob: Current cache size 495mb
Error on graphics thread: 1
XRTextureManager::RequestDestroyTexture
XRTextureManager::RequestDestroyTexture
XRTextureManager::RequestDestroyTexture
d3d12: swapchain present failed (887a0005).
d3d12: swapchain present failed (887a0005).
Device removed reason (887a0006).
GfxDevice was not out of Local memory
Local memory usage:
 Budget: 11927552000
 CurrentUsage: 4248125440
 AvailableForReservation: 67108864
 CurrentReservation: 6097993728
GfxDevice was not out of Non-Local memory
Non-Local memory usage:
 Budget: 33524613120
 CurrentUsage: 296316928
 AvailableForReservation: 0
 CurrentReservation: 16896524288
d3d12:     DXGI_ERROR_DEVICE_REMOVED reason (887a0006).
d3d12:     DRED CommandList: (null)
d3d12:     DRED CommandQueue: (null)
d3d12:     DRED BreadCrumb count: 0
d3d12:     DRED Command History (last is suspect):0 0 0 0 0 0 0 0 0 0

Hi @Freakish ,

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

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.

1 Like

@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.

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.

[[XR] [31636] [14:31:49.897][Info   ] Render Mode: Single Pass Instanced
[LIST=1]
[*][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.

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.

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.

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