02-21-2021 05:24 PM
Verbose [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : Entering loader trampoline
Warning [GENERAL | | OpenXR-Loader] : ReadLayerDataFilesInRegistry - failed to read registry location \ApiLayers\Implicit in either HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER
Info [GENERAL | | OpenXR-Loader] : RuntimeManifestFile::FindManifestFiles - using environment variable override runtime file F:\Oculus\Support\oculus-runtime\oculus_openxr_32.json
Info [GENERAL | | OpenXR-Loader] : RuntimeManifestFile::CreateIfValid - attempting to load F:\Oculus\Support\oculus-runtime\oculus_openxr_32.json
Info [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : RuntimeInterface::LoadRuntime succeeded loading runtime defined in manifest file F:\Oculus\Support\oculus-runtime\oculus_openxr_32.json using interface version 1 and OpenXR API version 1.0
Output captured from Oculus runtime show no specific error:22/02 01:49:20.051 {INFO} [CAPI] OVRInterface plugin library location: F:\Oculus\Support\oculus-runtime\client-plugins\x86
22/02 01:49:20.051 {INFO} [CAPI] OVRInterface plugin libraries:
<none>
22/02 01:49:20.051 {INFO} [CAPI] OVRInterface classes and interfaces:
Class Id: 0xb00b00067332ab1, class Name: OVRExtensionAddition
Interface Id: 0xb00b00053345520
22/02 01:49:20.057 {INFO} [CAPI] LibOVR module is located at F:\Oculus\Support\oculus-runtime\LibOVRRT32_1.dll
Procmon indicates that the last event from the process is a CreateFile for Oculus\Support\oculus-runtime\client-plugins\x86 that fails with PATH NOT FOUND, because it does not exist.22/02 02:02:21.196 {WARNING} [OXR] OXRInstanceData::CreateSession detected graphics device query was not called for XR_TYPE_GRAPHICS_BINDING_D3D11_KHR
The |
Solved! Go to Solution.
02-25-2021 03:04 PM
@morgg - looking at your callstack, it seems like xrEnumerateInstanceExtensionProperties is being called from DLLMain. This will result in undefined behavior (at least) with Windows. There are restrictions of what can be called from DLLMain: https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-best-practices
Is there so other place you can call this code from?
Thanks,
John
02-25-2021 01:27 PM
Hi @morgg ,
This issue does not look like it is specific to 32 bit or specific to Oculus.
Generally before calling xrCreateSession you'll need to call an xrGetGraphicsRequirement function. (There was an different less specific error for this case before OpenXR 1.0.12 but this has always been a requirement.)
For your case, I'd suggest looking at a Sample OpenXR application. Here is one example - d3d11 in hello_xr: https://github.com/KhronosGroup/OpenXR-SDK-Source/blob/master/src/tests/hello_xr/graphicsplugin_d3d1...
Hope that helps,
John
02-25-2021 02:47 PM
Thanks for the reply John.
Indeed, the second issue I explained (missing xrGetGraphicsRequirements call) was my code's fault, and I realized what I was missing. I also proposed some clarification to the specification so it may be easer to understand for other newbies like me 🙂
But the first issue I was reporting (xrEnumerateInstanceExtensionProperties() never returning) is still happening.
If I just skip this part and hardcode the extensions requested, the Instance can be created without issues.
AFAIK, there is not much to do before the call to xrEnumerateInstanceExtensionProperties where I could have screwed up... This is the relevant excerpt of code dealing with OpenXR before the problem:
#define XR_USE_PLATFORM_WIN32
#define XR_USE_GRAPHICS_API_D3D11
#include <openxr/openxr.h>
#include <openxr/openxr_platform.h>
uint32_t ext_count = 0;
XrResult xrResult = XR_ERROR_RUNTIME_FAILURE;
xrResult = xrEnumerateInstanceExtensionProperties(nullptr, 0, &ext_count, nullptr);
I am able to run the SingleFileExample I am using as a guideline with the Oculus 32bit runtime, but for some reason in my "app" (a wrapper to run an old DirectDraw game in Direct3D11), with the same steps (related to OpenXR) it does not work.
Is there any other more verbose log that I could check, or some debugging symbols for the runtime so that I can see where it gets stuck??
This is the call stack when I pause it:
ntdll.dll!_NtWaitForMultipleObjects@20() Unknown
KernelBase.dll!WaitForMultipleObjectsEx() Unknown
KernelBase.dll!_WaitForMultipleObjects@16() Unknown
> LibOVRRT32_1.dll!07f8b177() Unknown
LibOVRRT32_1.dll![Frames below may be incorrect and/or missing, no symbols loaded for LibOVRRT32_1.dll] Unknown
LibOVRRT32_1.dll!07f88d93() Unknown
LibOVRRT32_1.dll!07ef0a71() Unknown
LibOVRRT32_1.dll!07ef1daf() Unknown
LibOVRRT32_1.dll!07e7ed25() Unknown
ntdll.dll!_bsearch() Unknown
LibOVRRT32_1.dll!07fa7c14() Unknown
LibOVRRT32_1.dll!07fa7b20() Unknown
LibOVRRT32_1.dll!07e735c2() Unknown
openxr_loader.dll!7a357dbd() Unknown
openxr_loader.dll!7a358ec1() Unknown
openxr_loader.dll!7a340a0c() Unknown
ddraw.dll!VRRendererOpenXR::is_available() Line 36 C++
ddraw.dll!DllMain(HINSTANCE__ * hModule, unsigned long ul_reason_for_call, void * lpReserved) Line 1149 C++
ddraw.dll!dllmain_dispatch(HINSTANCE__ * const instance, const unsigned long reason, void * const reserved) Line 200 C++
ddraw.dll!_DllMainCRTStartup(HINSTANCE__ * const instance, const unsigned long reason, void * const reserved) Line 253 C++
ntdll.dll!_LdrxCallInitRoutine@16() Unknown
ntdll.dll!LdrpCallInitRoutine() Unknown
ntdll.dll!LdrpInitializeNode() Unknown
ntdll.dll!LdrpInitializeGraphRecurse() Unknown
ntdll.dll!LdrpInitializeGraphRecurse() Unknown
ntdll.dll!_LdrpInitializeProcess@8() Unknown
ntdll.dll!_LdrpInitialize() Unknown
ntdll.dll!LdrInitializeThunk() Unknown
Any ideas?
Thanks!
02-25-2021 03:04 PM
@morgg - looking at your callstack, it seems like xrEnumerateInstanceExtensionProperties is being called from DLLMain. This will result in undefined behavior (at least) with Windows. There are restrictions of what can be called from DLLMain: https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-best-practices
Is there so other place you can call this code from?
Thanks,
John
02-25-2021 04:21 PM
I am hacking someone else's code, so I will see what I can do 🙂
Thanks for the help @johnkearney !
11-23-2022 02:30 PM
I ran into the same problem as you.
Can you tell me if you have solved it? If so, may I ask how you solved it?