kondrak / vkQuake2

id Software's Quake 2 v3.21 with mission packs and Vulkan support (Windows, Linux, macOS, FreeBSD, Raspberry Pi 4)
GNU General Public License v2.0
896 stars 91 forks source link

could not initialize Vulkan! #84

Closed rgosens2 closed 4 years ago

rgosens2 commented 4 years ago

Getting this error on MacBook Air when running, probably because of 1366 x 768 resolution.

How do I start with the correct resolution?

rg@MacBook-Air-2015 debug % ./quake2 Added packfile ./baseq2/pak0.pak (3307 files) Added packfile ./baseq2/pak1.pak (279 files) Added packfile ./baseq2/pak2.pak (2 files) Added packfile ./baseq2/pak3.pak (8 files) execing default.cfg couldn't exec config.cfg Console initialized. ------- Loading ref_vk.dylib ------- LoadLibrary("/Volumes/Part3/Quake/Mac/vkQuake2/vkQuake2-master/macos/debug/./ref_vk.dylib") ref_vk version: Vulkan (vkQuake2 v1.4.3) Initializing Metal display ...setting fullscreen mode 11: 1920 1080 Enabled extensions: VK_KHR_surface VK_MVK_macos_surface VK_EXT_debug_utils QVk_Init(): Could not create Vulkan instance: VK_ERROR_LAYER_NOT_PRESENT ref_vk::R_Init() - could not initialize Vulkan! Received signal 11, exiting...

kondrak commented 4 years ago

On MacOS the fullscreen mode defaults to maximum supported resolution by the device, you get the VK_ERROR_LAYER_NOT_PRESENT - which version of the VulkanSDK are you using?

rgosens2 commented 4 years ago

1.2.131.1

kondrak commented 4 years ago

Can you please paste the results of running vulkaninfo?

rgosens2 commented 4 years ago

It works now!

I was running on Catalina, but did the build on Sierra. Catalina zsh did not have a .zshrc file with export VK_LAYER_PATH=

Thanks

kondrak commented 4 years ago

Glad you resolved it!

rgosens2 commented 4 years ago

Testing:

MacBook Air 2015 Catalina:

timedemo 1 map demo2.dm2

Yamagi Quake 2 OpenGL 3.2: 60 fps vkQuake2 Vulkan/Metal: 155 fps

Nice one!

rgosens2 commented 4 years ago

But I guess Yamagi is frame limited at 60 fps?

kondrak commented 4 years ago

I'm not familiar with Yamagi renderer, chances are that VSync is enabled by default (as it was in original Quake 2). Also, not sure if it's a fair comparison, since vkQuake2 does some additional postprocessing, so the results may vary.

rgosens2 commented 4 years ago

Yes, Yamagi was vsynced. It does 247 fps with vsync disabled.

kondrak commented 4 years ago

Be sure to time release build of vkQuake 2 btw, validation layers for Vulkan produce quite significant overhead during runtime!