stride3d/stride · error · Exception

The current device doesn't support primary stereo

Error message

The current device doesn't support primary stereo

What it means

OpenXRHmd.Enable enumerates the view configurations the runtime supports and requires that the primary stereo view type be present, since Stride's OpenXR path only implements stereo rendering. If no supported view configuration matches the desired stereo type, it throws an Exception stating the current device doesn't support primary stereo.

Solutions

  1. Select a stereo-capable OpenXR runtime (SteamVR, Oculus, Windows Mixed Reality) via the system OpenXR runtime settings.
  2. Update the runtime/driver to a version that advertises XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO.
  3. Verify the headset is connected so the runtime exposes the stereo view configuration.
  4. Check the debug-logged viewconfig list in the exception context to see what the runtime actually supports.
Defensive patterns

Strategy: validation

Validate before calling

// C#
// before Enable: ensure a stereo-capable runtime is the active OpenXR runtime
bool stereoAvailable = openxrRuntime.SupportsViewConfiguration(ViewConfigurationType.PrimaryStereo);

Try / catch

// C#
try { hmd.Enable(); }
catch (Exception ex) when (ex.Message.Contains("primary stereo"))
{
    Logger.Warning("Active OpenXR runtime does not support stereo; disabling VR");
    vrAvailable = false;
}

Prevention

When it happens

Trigger: Calling Enable with an OpenXR runtime whose enumerated view configurations do not include the primary stereo view type (e.g. a runtime exposing only monoscopic or a nonstandard configuration), so viewtype_found stays false after the loop.

Common situations: Using an emulator, monoscopic viewer, or exotic OpenXR runtime; misconfigured/default OpenXR runtime selected on the machine; runtimes that only support non-primary configurations.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/5b2a4419be0a526f. Report an issue: GitHub.

Appendix: source

Thrown at sources/engine/Stride.VirtualReality/OpenXR/OpenXRHmd.cs:191

            // Changing the form_factor may require changing the view_type too.
            var view_type = ViewConfigurationType.PrimaryStereo;
            uint view_config_count = 0;

            Xr.EnumerateViewConfiguration(Instance, SystemId, 0, ref view_config_count, viewConfigurationTypes: null).CheckResult();

            var viewconfigs = new ViewConfigurationType[view_config_count];
            fixed (ViewConfigurationType* viewconfigspnt = &viewconfigs[0])
                Xr.EnumerateViewConfiguration(Instance, SystemId, view_config_count, ref view_config_count, viewconfigspnt).CheckResult();
            Logger.Debug("Available config types: ");
            var viewtype_found = false;
            for (int i = 0; i < view_config_count; i++)
            {
                Logger.Debug("    " + viewconfigs[i]);
                viewtype_found |= view_type == viewconfigs[i];
            }
            if (!viewtype_found)
            {
                throw new Exception("The current device doesn't support primary stereo");
            }

            uint view_count = 0;
            Xr.EnumerateViewConfigurationView(Instance, SystemId, view_type, 0, ref view_count, null).CheckResult();
            var viewconfig_views = new ViewConfigurationView[view_count];
            for (int i = 0; i < view_count; i++)
            {
                viewconfig_views[i].Type = StructureType.ViewConfigurationView;
                viewconfig_views[i].Next = null;
            }
            fixed (ViewConfigurationView* viewspnt = &viewconfig_views[0])
                Xr.EnumerateViewConfigurationView(Instance, SystemId, view_type, (uint)viewconfig_views.Length, ref view_count, viewspnt).CheckResult();

            // get size
            renderSize.Width = (int)Math.Round(viewconfig_views[0].RecommendedImageRectWidth * RenderFrameScaling) * 2; // 2 views in one frame
            renderSize.Height = (int)Math.Round(viewconfig_views[0].RecommendedImageRectHeight * RenderFrameScaling);

            SessionCreateInfo session_create_info;

View on GitHub (pinned to 96fad776d2)