godotengine / godotengine/godot
XR Projects either crashing or not detecting haedset after working properly
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
v4.6.2.stable.official [71f334935]
### System information
Godot v4.6.2.stable - Windows 11 (build 22631) - Multi-window, 2 monitors - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 2080 Ti (NVIDIA; 32.0.15.9621) - Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 threads) - 31.84 GiB memory - HTC Vive Cosmos VR Headset
### Issue description
I was trying to learn about VR following the basic tutorial from the [official documentation](https://docs.godotengine.org/en/stable/tutorials/xr/index.html#basic-tutorial). I made a project following the steps found in the ["Setting up XR"](https://docs.godotengine.org/en/stable/tutorials/xr/setting_up_xr.html) and ["A better XR start script"](https://docs.godotengine.org/en/stable/tutorials/xr/a_better_xr_start_script.html) sections. When I tried running it, I could move my head just fine but my hands where still on the floor, not following my controllers. By turning the "Show When Tracked" property on in the inspector, I couldn't see the meshes attached to my controllers at all, indicating that they where not being tracked.
To try to understand where the problem could come from, I decided to download a project from the Internet [(the OpenXR demo by Bastiaan Olij)](https://github.com/BastiaanOlij/godot4_openxr_demo). After fixing the various errors caused by the switch from version 4.0 to 4.6.2, I ran the game and my hands worked just fine. However, after trying to teleport, the game closed because of an error I didn't fix (related to ShaderMaterials using set_shader_parameter
() instead of set_shader_param()), so I fixed it, tried to run the project again and the game window just crashed. It didn't close with an error being pushed in the editor, it crashed. And opening my previous project (the one where my hands didn't work) and trying to run it also lead to a crash (which it didn't before).
Here is what the console looks like for both of those projects:
```
Godot Engine v4.6.2.stable.official.71f334935 - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 596.21 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce RTX 2080 Ti
Editing project: E:/GameDev/Godot4Test
Godot Engine v4.6.2.stable.official.71f334935 - https://godotengine.org
Vulkan 1.4.329 - Forward Mobile - Using Device #0: NVIDIA - NVIDIA GeForce RTX 2080 Ti
Godot Engine v4.6.2.stable.official.71f334935 - https://godotengine.org
OpenXR: Created instance for OpenXR 1.1.54
OpenXR: Running on OpenXR runtime: Vive Reality Runtime 0.0.1
OpenXR: XrGraphicsRequirementsVulkan2KHR:
- minApiVersionSupported: 1.1.0
- maxApiVersionSupported: 1.2.1023
Vulkan 1.4.329 - Forward Mobile - Using Device #0: NVIDIA - NVIDIA GeForce RTX 2080 Ti
================================================================
CrashHandlerException: Program crashed with signal 11
Engine version: Godot Engine v4.6.2.stable.official (71f334935c000924d403448e698df4441130df18)
Dumping the backtrace. Please include this when reporting the bug on: https://github.com/godotengine/godot/issues
[1] error(2): C:\Users\Heppi\Desktop\Création de jeux\Godot\Godot_v4.6.2-stable_win64.exe
[2] error(-1): failed to read executable information
[3] error(-1): failed to read executable information
[4] error(-1): failed to read executable information
[5] error(-1): failed to read executable information
[6] error(-1): failed to read executable information
[7] error(-1): failed to read executable information
[8] error(-1): failed to read executable information
[9] error(-1): failed to read executable information
[10] error(-1): failed to read executable information
[11] error(-1): failed to read executable information
[12] error(-1): failed to read executable information
[13] error(-1): failed to read executable information
[14] error(-1): failed to read executable information
[15] error(-1): failed to read executable information
[16] error(-1): failed to read executable information
[17] error(-1): failed to read executable information
[18] error(-1): failed to read executable information
[19] error(-1): failed to read executable information
[20] error(-1): failed to read executable information
[21] error(-1): failed to read executable information
[22] error(-1): failed to read executable information
[23] error(-1): failed to read executable information
[24] error(-1): failed to read executable information
[25] error(-1): failed to read executable information
[26] error(-1): failed to read executable information
[27] error(-1): failed to read executable information
-- END OF C++ BACKTRACE --
================================================================
```
Afterwards, I tried to create a brand new project that is simply a copy/paste of the ["Setting up XR"](https://docs.godotengine.org/en/stable/tutorials/xr/setting_up_xr.html) tutorial from the doc, I ran it and instead of crashing, it simply didn't launch in VR at all, giving me this output in the console:
```
Godot Engine v4.6.2.stable.official.71f334935 - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 596.21 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce RTX 2080 Ti
Editing project: E:/GameDev/XRTests
Godot Engine v4.6.2.stable.official.71f334935 - https://godotengine.org
D3D12 12_0 - Forward Mobile - Using Device #0: NVIDIA - NVIDIA GeForce RTX 2080 Ti
Godot Engine v4.6.2.stable.official.71f334935 - https://godotengine.org
OpenXR: Created instance for OpenXR 1.1.54
OpenXR: Running on OpenXR runtime: Vive Reality Runtime 0.0.1
OpenXR: xrGetD3D12GraphicsRequirementsKHR:
- minFeatureLevel: 45056
ERROR: Parameter "desired_adapter" is null.
at: _initialize_device (drivers/d3d12/rendering_device_driver_d3d12.cpp:5911)
ERROR: Condition "err != OK" is true. Returning: ERR_CANT_CREATE
at: initialize (drivers/d3d12/rendering_device_driver_d3d12.cpp:6298)
ERROR: Failed to initialize driver for device.
at: (servers/rendering/rendering_device.cpp:6990)
Vulkan 1.4.329 - Forward Mobile - Using Device #0: NVIDIA - NVIDIA GeForce RTX 2080 Ti
WARNING: Your video card drivers seem not to support Direct3D 12, switching to Vulkan.
at: DisplayServerWindows (platform/windows/display_server_windows.cpp:7314)
OpenXR: Failed to create session [ XR_ERROR_GRAPHICS_DEVICE_INVALID ]
OpenXR not initialized, please check if your headset is connected
ERROR: 10 RID allocations of type 'N9OpenXRAPI18InteractionProfileE' were leaked at exit.
ERROR: 23 RID allocations of type 'N9OpenXRAPI6ActionE' were leaked at exit.
ERROR: 1 RID allocations of type 'N9OpenXRAPI9ActionSetE' were leaked at exit.
ERROR: 2 RID allocations of type 'N9OpenXRAPI7TrackerE' were leaked at exit.
```
### Steps to reproduce
**COULD PREVENT YOU FROM RUNNING VR PROJECTS ALLTOGETHER!**
(From what I can guess):
- Open a project meant for Godot 4.0.X in Godot 4.6.2;
- Try running it and fix errors as the come;
### Minimal reproduction project (MRP)
N/A
Contributor guide
Research direction
Start by reproducing the tutorial project and the reported crash with the HTC Vive Cosmos on Windows 11, preserving the OpenXR and rendering logs. Inspect the reported paths in drivers/d3d12/rendering_device_driver_d3d12.cpp, servers/rendering/rendering_device.cpp, and platform/windows/display_server_windows.cpp, along with the OpenXR initialization path. Done means isolating a reproducible engine failure or environment-specific issue and documenting a verified fix or next diagnostic step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, godot
- Domain
- ar-vr-xr, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100