# OpenXR 1.1.36 - crash

**URL:** https://discourse.vtk.org/t/openxr-1-1-36-crash/13744
**Category:** VR/AR
**Created:** [April 19, 2024, 6:28am UTC](https://discourse.vtk.org/t/openxr-1-1-36-crash/13744 "2024-04-19T06:28:49Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![codeling](https://discourse.vtk.org/user_avatar/discourse.vtk.org/codeling/32/3792_2.png) [@codeling](https://discourse.vtk.org/u/codeling)
#### Post date: [July 16, 2024, 1:49pm UTC](https://discourse.vtk.org/t/openxr-1-1-36-crash/13744/3 "2024-07-16T13:49:08Z")

</div>

Turns out there is a very simple solution for this problem!

**Fix:** Add

```auto
createInfo.applicationInfo.apiVersion = 
      XR_MAKE_VERSION(XR_VERSION_MAJOR(XR_CURRENT_API_VERSION),
          0, XR_VERSION_PATCH(XR_CURRENT_API_VERSION));

```

before the calls to `xrCreateInstance` in `vtkOpenXRManager.cxx` (`Rendering/OpenXR`).

* * *

How did I find out: I looked into the [hello\_xr](https://github.com/KhronosGroup/OpenXR-SDK-Source/tree/main/src/tests/hello_xr) example from the OpenXR SDK for changes between 1.0(.34) and 1.1(.36) and the only thing I could find was that the version in the `info` struct passed to `xrCreateInstance` is set differently, now it is explicitly setting the minor part of the api version to 0.

Not sure what other changes would come with switching to 1.1, but for now, replicating this change is the easiest to make VTK compatible with the OpenXR SDK \>= 1.1.36. Applying the fix as described above to VTK leads to applications running again without crash; I still see an error in the output:

`2024-07-16 15:11:35.190 ( 2.077s) [63BA4D4551CFE43C] vtkOpenXRManager.cxx:547 ERR| (nullptr): Failed to wait frame. [XR_ERROR_SESSION_NOT_RUNNING].`

but I don’t think this affects the functionality.

I have submitted [a merge request](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/11318), so this should hopefully also be fixed in future VTK releases.

---

_[View the full topic](https://discourse.vtk.org/t/openxr-1-1-36-crash/13744)._
