KhronosGroup / KhronosGroup/OpenXR-SDK-Source

Crash running Hello-XR on DirectX12

Open
#313 5 comments 0 reactions 0 assignees View on GitHub
runtime related synced to gitlab
Dominant language
Python
Stars
825
Forks
306
Avg merge
1d 23h
Merged PRs (30d)
1

Description

I'm trying to use Hello-XR as an example for my own DirectX12 implementation for OpenXR, and when running the Hello-XR example on a Vive Pro with SteamVR, the sample crashes trying to render a frame.

Steps to reproduce:
1. Checkout latest of this repo
2. `mkdir build ; cd build ; cmake ..`
3. Go to hello_xr->main.cpp and remove the try-catch to prevent it from catching the exception where the crash is
4. Go to hello_xr->properties->Debugging and add `-g D3D12` to Command Arguments
5. Build and run

Stack trace at crash:
![image](https://user-images.githubusercontent.com/22283943/171068281-5d8dd56a-3886-44c0-9819-6fab67dd4719.png)

Output:
```
[16:38:17.680][Info ] Press any key to shutdown...
[16:38:17.705][Info ] Available Layers: (0)
[16:38:17.750][Info ] Instance RuntimeName=SteamVR/OpenXR RuntimeVersion=0.1.0
[16:38:17.750][Info ] Available View Configuration Types: (1)
[16:38:17.750][Info ] Available Environment Blend Mode count : (1)
[16:38:17.750][Info ] Environment Blend Mode (XR_ENVIRONMENT_BLEND_MODE_OPAQUE) : (Selected)
[16:38:18.414][Info ] Available reference spaces: 3
[16:38:18.424][Info ] System Properties: Name=SteamVR/OpenXR : lighthouse VendorId=10462
[16:38:18.424][Info ] System Graphics Properties: MaxWidth=2016 MaxHeight=2240 MaxLayers=16
[16:38:18.424][Info ] System Tracking Properties: OrientationTracking=True PositionTracking=True
[16:38:18.424][Info ] Creating swapchain for view 0 with dimensions Width=2016 Height=2240 SampleCount=1
[16:38:18.427][Info ] Creating swapchain for view 1 with dimensions Width=2016 Height=2240 SampleCount=1
[16:38:18.430][Info ] XrEventDataSessionStateChanged: state XR_SESSION_STATE_UNKNOWN->XR_SESSION_STATE_IDLE session=1995166640864 time=332621467785300
[16:38:18.430][Info ] XrEventDataSessionStateChanged: state XR_SESSION_STATE_IDLE->XR_SESSION_STATE_READY session=1995166640864 time=332621467796000
[16:38:18.475][Error ] HRESULT failure [80070057]
Origin: d3d12Device->CreateCommittedResource(&heapProp, D3D12_HEAP_FLAG_NONE, &buffDesc, d3d12ResourceState, nullptr, __uuidof(ID3D12Resource), reinterpret_cast(buffer.ReleaseAndGetAddressOf()))
Source: OpenXR-SDK-Source-main\src\tests\hello_xr\graphicsplugin_d3d12.cpp:69
```

The DirectX11 and OpenGL backends appear to work correctly. I could not test Vulkan2, Vulkan, or OpenGLES because it reported those backends were not supported.

GPU: NVIDIA RTX 2070 Super with driver 512.59
OS: Windows 10 21H1 19043.1706

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the crash using the listed CMake steps and DirectX12 arguments, then inspect hello_xr-main.cpp and src/tests/hello_xr/graphicsplugin_d3d12.cpp:69 around CreateCommittedResource. Compare the DirectX12 path with the working DirectX11 and OpenGL backends. Done means Hello-XR runs without the reported HRESULT failure on the stated setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.