Unreal Engine VR Crashing

I am using the Unreal Engine VR Template project. The problem is, each time SteamVR exits, Unreal Engine crashes.

This is a big problem for me, as I want to allow my headset to go to sleep when idling (which will force SteamVR to exit), but I don’t want Unreal Engine to crash each time.

Any fix available?

Hello there @skypalace1 !

That crash shouldn’t happen at all, specially if you are working on the VR template only, there should be no content affecting the cache yet. Plus, the interaction is with Steam only, so the GPU, nor the headset, should be involved here.

To pinpoint the origin, we will need to see the exact error encountered, via checking the crash log, which can be found in the following location (also, please check the crash report guide). Once you have the log, add it to the thread, and we can investigate further:

Where To Find Local Crash Reports

Crash reports from the editor are stored on your local machine in your project’s Saved/Crashes folder.

Alternatively, you can find crash reports on a user’s local machine in C:\Users[Your Windows Username]\AppData\Local[Project Name]\Saved\Crashes.

Ok, I’ve put my log file here:

The last line is

[2025.07.25-11.12.26:945][731]LogHMD: FOpenXRHMD is requesting app exit. CurrentSessionState: XR_SESSION_STATE_UNKNOWN

I am guessing that has to do with it?

Hello again!

Thank you for the log. Investigating through it, I think the key lines to consider are the following:

SteamVRHMD.cpp
`FSteamVRHMD::OnEndPlay(FWorldContext&)`
LogHMD: FOpenXRHMD is requesting app exit. CurrentSessionState: XR_SESSION_STATE_UNKNOWN

These mean that the engine is trying to access SteamVR functions after SteamVR has already shut down, maybe due the headset entering sleep mode, or losing connection. Since SteamVR is off, OpenXR runtime requests the application to exit, which causes the crash in UE.

So, the first step would be to ensure that the headset is not set to idle or sleep. To do so, please adjust the following settings on SteamVR:

  • Go to Settings > Developer > Set Idle Timeout
  • Set “Never” (or longer timeout) to prevent automatic shutdown while idle
  • Next, go to Power Management
  • Set “Put base stations in standby mode” to a longer timeout
  • Disable “Turn off controllers” or set a longer timeout

Another element to adjust, would be to prevent UE from crashing when missing the HMD connection, which ca be done via disabling the “Exit on Disconnect” option from OpenXR settings, or forcing via console command or Blueprint with the folowing line:

vr.bExitVROnHMDRemoved 0

Finally, checking with my peers, their suggestion was to setup a better handling for the disconnect event, via adjusting your code to Poll IsHeadMountedDisplayEnabled() and IsHMDConnected(), then pause the game or show a reconnect screen, to prevent the shutdown.

Thank you for your reply! I am very grateful that you took the time to look into this issue.

I did want to avoid a solution that never puts the headset to sleep, since I am using the HP Reverb G2, which, despite being 5 years old and being discontinued, is still the best headset available, so I don’t want to burn out the lenses keeping it on all the time.

I found a solution that seems to be working well for me. If I uncheck the WindowsMR setting to “Suspend Windows Mixed Reality and its apps when my headset is asleep”, then the headset is still able to go to sleep, but it doesn’t exit SteamVR, which is great. It does require a little trick to turn it back on, I have to press the windows key +Y twice, then wait a few seconds.

I was unaware of the vr.bExitVROnHMDRemoved option, thank you for pointing that out, I might try to test that later.

Thanks again and cheers!

1 Like