Ralith/openxrs

Failing to run Vulkan.rs on windows

dmitsuki opened this issue · 7 comments

When I try to run vulkan.rs on Windows I get

thread 'main' panicked at 'called Result::unwrap() on an Err value: ERROR_EXTENSION_NOT_PRESENT', openxr\examples\vulkan.rs:166:14

I'm using a 5700 XT with current drivers, I should have all the required extensions. Am I missing something or is there a bug present.

Your OpenXR runtime is requesting extensions that your Vulkan implementation does not support. This is probably a bug in your OpenXR runtime. What's printed after required Vulkan device extensions: ?

loaded OpenXR runtime: SteamVR/OpenXR 0.1.0
required Vulkan instance extensions:
["VK_KHR_external_memory_capabilities",
"VK_KHR_get_physical_device_properties2",
"VK_KHR_surface", "VK_KHR_win32_surface"]

required Vulkan device extensions:
["VK_KHR_external_memory",
"VK_KHR_external_semaphore",
"VK_KHR_dedicated_allocation",
"VK_KHR_get_memory_requirements2",
"VK_KHR_external_memory_win32",
"VK_KHR_win32_keyed_mutex",
"VK_EXT_debug_marker"]

SteamVR's OpenXR implementation is unfortunately very buggy (and has been since release). For example, the VK_EXT_debug_marker extension is only available when a debugging layer (typically VK_LAYER_KHRONOS_validation) is enabled, but SteamVR requests it unconditionally. You can hack around this particular issue by manually loading the VK_LAYER_KHRONOS_validation layer, which will, ironically, proceed to loudly complain about all the other things they're doing wrong.

I'm starting to see what you mean, this seems basically unusable. No problem on your end though, thanks for the help.

FWIW, I've found it works okay in practice if you hold your nose and ignore the validation errors. Frustrating that they haven't done anything about it, and makes detecting errors in your own code much harder, but not a hard blocker for using the stack.

Well, when I ran it I kept getting an error

Objects: 1
[0] 0x25aa9328d40, type: 1, name: NULL
UNASSIGNED-GeneralParameterError-ExtensionNotEnabled(ERROR / SPEC): msgNum: -383040211 - Validation Error: [ UNASSIGNED-GeneralParameterError-ExtensionNotEnabled ] Object 0: handle = 0x25aa9328d40, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xe92b452d | Attemped to call vkCmdDebugMarkerEndEXT() but its required extension VK_EXT_debug_report has not been enabled

After enabling the validation layer, don't see a proper image, just garbage. When I checked the queuried extensions, VK_EXT_debug_report is not in it (and I think it's deprecated) and I think VK_EXT_debug_utils is supposed to be used now, but that's not what openXR is asking for even though it's the extension it queries.

The example (and my own much more complex project) works fine on my SteamVR installation when the validation layers are injected manually via environment variables, fwiw.