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 90 forks source link

Could not create Vulkan instance Manjaro Raspberry pi 5 Arm64 #174

Closed coreybruce closed 3 months ago

coreybruce commented 3 months ago

Hey I just want to report a issue, I am unable to launch vkquake2 on my Raspberry pi 5 and I have vulkan-headers installed

./quake2
Added packfile ./baseq2/pak0.pak (1106 files)
execing default.cfg
couldn't exec config.cfg
Console initialized.

------- sound initialization -------
Setting up ALSA driver .....
Low Performance 11KHz.
sound sampling rate: 11025
------------------------------------
------- Loading ref_vk.so -------
LoadLibrary("/home/corey/stuff/projects/vkQuake2/linux/releaseaarch64-glibc/ref_vk.so")
ref_vk version: Vulkan (vkQuake2 v1.5.10)
Initializing Vulkan display
...setting fullscreen mode 11: 1920 1080
Using XFree86-VidModeExtension Version 2.2
Enabled extensions: VK_KHR_surface VK_KHR_xlib_surface 
QVk_Init(): Could not create Vulkan instance: VK_ERROR_INCOMPATIBLE_DRIVER
ref_vk::R_Init() - could not initialize Vulkan!
ERROR:             vkDeviceWaitIdle: Invalid device [VUID-vkDeviceWaitIdle-device-parameter]
Received signal 6, exiting...
kondrak commented 3 months ago

Hi!

Do you have a Vulkan capable driver installed? Seems that's what causing issues here, ie. the current driver you're using does not support Vulkan.

coreybruce commented 3 months ago

I will have to check with Manjaro and find out :smile:

I have made a post about it on the Manjaro forum https://forum.manjaro.org/t/vulkan-support-raspberry-pi-5/161664

kondrak commented 3 months ago

If you follow the Readme instructions then you can try and install these drivers yourself via the package manager:

sudo apt install mesa-vulkan-drivers

The instruction above is for Debian/Ubuntu distros, on Manjaro you might need to use a different package manager.

coreybruce commented 3 months ago

Hey I installed vulkan-broadcom and vulkan-mesa-layer just in case it was needed but I get this log now

couldn't exec default.cfg
couldn't exec config.cfg
Console initialized.

------- sound initialization -------
Setting up ALSA driver .....
Low Performance 11KHz.
sound sampling rate: 11025
------------------------------------
------- Loading ref_vk.so -------
LoadLibrary("/home/corey/stuff/projects/vkQuake2/linux/releaseaarch64-glibc/ref_vk.so")
ref_vk version: Vulkan (vkQuake2 v1.5.10)
Initializing Vulkan display
...setting mode 11: 1920 1080
Using XFree86-VidModeExtension Version 2.2
Enabled extensions: VK_KHR_surface VK_KHR_xlib_surface VK_KHR_get_physical_device_properties2 
...created Vulkan instance
...created Vulkan surface
...found 1 Vulkan-capable device(s)
...created Vulkan memory allocator
Supported present modes: VK_PRESENT_MODE_IMMEDIATE_KHR VK_PRESENT_MODE_MAILBOX_KHR VK_PRESENT_MODE_FIFO_KHR VK_PRESENT_MODE_FIFO_RELAXED_KHR 
...using present mode: VK_PRESENT_MODE_MAILBOX_KHR
...trying swapchain extent: 1920x1080
...trying swapchain image format: 44
...created Vulkan swapchain
...created synchronization objects
...created 3 Vulkan render passes
...created Vulkan command pools
...created world depth buffer
...created UI depth buffer
...created world color buffer
...created world postpocess color buffer
...created 5 Vulkan image view(s)
...created 5 Vulkan framebuffers
...created 2 Vulkan commandbuffers
Successfully initialized Vulkan!

������岠�������
------------------------------------
Vulkan API: 1.3
Header version: 276
Devices found:
   #0: V3D 7.1.7
Using device #0:
   deviceName: V3D 7.1.7
   resolution: 1920x1080
   driverVersion: 24.0.2 (0x6000002)
   apiVersion: 1.2.274
   deviceID: 1433410611
   vendorID: 0x14E4 (unknown)
   deviceType: VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU
   gfx/present/transfer: 0/0/0
Present mode: VK_PRESENT_MODE_MAILBOX_KHR
Swapchain image format: 44
Swapchain image count: 5
Sampler anisotropy: yes
Supported present modes:
   VK_PRESENT_MODE_IMMEDIATE_KHR
   VK_PRESENT_MODE_MAILBOX_KHR
   VK_PRESENT_MODE_FIFO_KHR
   VK_PRESENT_MODE_FIFO_RELAXED_KHR
Enabled extensions:
   VK_KHR_surface
   VK_KHR_xlib_surface
   VK_KHR_get_physical_device_properties2
Enabled layers:
Cmd_RemoveCommand: miniaudio not added
recursive shutdown
Error: Couldn't load pics/colormap.pcx

Seems like I fixed the vulkan issue but now something else is the issue

also VKQuake2 runs on Manjaro x64 no problems, it is just having issues on Manjaro Arm64

kondrak commented 3 months ago

Good! Vulkan actually works now. The error you got in the end is because of missing game assets, so copy the game .pak files to baseq2 folder and you should be fine.

coreybruce commented 3 months ago

Ah ok sweet as I will try it now that you say it's working and I can confirm it's working tho I noticed when going from fullscreen to windowed it was annoyingly finicky and kept putting the top of the window outside the top left hand side of the screen. I also wonder if the game could be further optimized for pi hardware as explosions really tank the performance on the pi 5

I would document that on Manjaro on the pi 5 requires vulkan-broadcom to be installed :)

kondrak commented 3 months ago

The issues you experience with windowing is the consequence of using a 20+ year old window-handling routines - that was part of the challenge with this project but it came at the cost of things not always working that great on Linux. With SDL or other off-the-shelf window manager these problems would likely not be there but changing this at this point is a significant time investment and out of scope for this project.

The performance issues you mention are strange, intuitively it sounds like you're running a debug build with validation layers enabled but based on the log that doesn't seem to be the case. Unfortunately I don't have the hardware available at hand, so can't really debug it, there's nothing happening there that should be causing these issues, so really - it's a bit of a guessing game right now.

coreybruce commented 3 months ago

Ah I see, whatever is causing it hopefully it will be resolved eventually

Thanks for helping 🙂