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

Fullscreen cause infinite reload (linux) #95

Closed Elrondo46 closed 4 years ago

Elrondo46 commented 4 years ago

Can you solve it ?

OS: Arch Linux GPU: GTX 1070 Nvidia Drivers: 440.82

I've no problems with other vulkan games including Wine with DXVK

kondrak commented 4 years ago

Cannot reproduce. Which Vulkan SDK are you using? Also, please paste terminal output here with logs so that I can see potential error message.

Elrondo46 commented 4 years ago

There is no error messages in Terminal, just infinite reload I use the last Gnome version.

kondrak commented 4 years ago

There has to be console output in the terminal, please check again. Can't help much without that information I'm afraid (I'm using Gnome as well).

Elrondo46 commented 4 years ago

I want to help you but I can just make a video host on peertube instance if you want, there is no debug trace....

kondrak commented 4 years ago

When you run the game directly in Terminal., the Quake console prints its output there. Initialization process must be failing somewhere and this output can help. You could also try the debug build and see if it behaves differently. Does the game work in windowed mode?

Elrondo46 commented 4 years ago

Oh watch this in debug at restart QVk_EndFrame(): received VK_ERROR_OUT_OF_DATE_KHR after vkQueuePresentKHR - restarting video!

Elrondo46 commented 4 years ago

There was the same problem in vkquake: https://github.com/Novum/vkQuake/issues/114

kondrak commented 4 years ago

Ok, so I understand that it keeps happening all the time?

Elrondo46 commented 4 years ago

All the time I want fullscreen

Elrondo46 commented 4 years ago

Window mode is not affected

kondrak commented 4 years ago

Full Terminal output would be still useful here, so please paste here everything you can see starting from application launch.

Elrondo46 commented 4 years ago

Debug

`╰─ ./quake2 Added packfile ./baseq2/pak0.pak (3307 files) execing default.cfg execing config.cfg Console initialized.

------- sound initialization ------- Setting up ALSA driver ..... High Quality 48KHz. sound sampling rate: 48000

------- Loading ref_vk.so ------- LoadLibrary("/opt/vkquake2/ref_vk.so") ref_vk version: Vulkan (vkQuake2 v1.4.4) Initializing Vulkan display ...setting mode 11: 1920 1080 Using XFree86-VidModeExtension Version 2.2 Enabled extensions: VK_KHR_surface VK_KHR_xlib_surface ...created Vulkan instance ...created Vulkan surface ...found 1 Vulkan-capable device(s) ...created Vulkan memory allocator Supported present modes: VK_PRESENT_MODE_FIFO_KHR VK_PRESENT_MODE_FIFO_RELAXED_KHR VK_PRESENT_MODE_IMMEDIATE_KHR ...using present mode: VK_PRESENT_MODE_FIFO_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 MSAAx4 color buffer ...created 2 Vulkan image view(s) ...created 2 Vulkan framebuffers ...created 2 Vulkan commandbuffers Successfully initialized Vulkan!

������岠������

Vulkan API: 1.2 Header version: 137 Devices found:

0: GeForce GTX 1070

Using device #0: deviceName: GeForce GTX 1070 resolution: 1920x1080 (MSAAx4) driverVersion: 440.82.0 (0x6E148000) apiVersion: 1.1.119 deviceID: 7041 vendorID: 0x10DE (NVIDIA) deviceType: VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU gfx/present/transfer: 0/0/1 Present mode: VK_PRESENT_MODE_FIFO_KHR Swapchain image format: 44 Supported present modes: VK_PRESENT_MODE_FIFO_KHR VK_PRESENT_MODE_FIFO_RELAXED_KHR VK_PRESENT_MODE_IMMEDIATE_KHR Enabled extensions: VK_KHR_surface VK_KHR_xlib_surface Enabled layers:

CDAudio_Init: open of "/dev/cdrom" failed (2) ------- Loading gamex64.so ------- LoadLibrary (/opt/vkquake2/./baseq2/gamex64.so) ==== InitGame ==== ------- Server Initialization ------- 0 entities inhibited 0 teams with 0 entities

====== Quake2 Initialized ======

0.0.0.0:0: client_connect ------- Server Initialization ------- 0 entities inhibited 0 teams with 0 entities

Changing map... reconnecting...

Installation Failed to open ./baseq2/music/track07.[ogg/flac/mp3/wav]: error -7 Shutting down Vulkan ------- Loading ref_vk.so ------- LoadLibrary("/opt/vkquake2/ref_vk.so") Cmd_AddCommand: +mlook already defined Cmd_AddCommand: -mlook already defined Cmd_AddCommand: force_centerview already defined ref_vk version: Vulkan (vkQuake2 v1.4.4) Initializing Vulkan display ...setting fullscreen mode 11: 1920 1080 Using XFree86-VidModeExtension Version 2.2 Enabled extensions: VK_KHR_surface VK_KHR_xlib_surface ...created Vulkan instance ...created Vulkan surface ...found 1 Vulkan-capable device(s) ...created Vulkan memory allocator Supported present modes: VK_PRESENT_MODE_FIFO_KHR VK_PRESENT_MODE_FIFO_RELAXED_KHR VK_PRESENT_MODE_IMMEDIATE_KHR ...using present mode: VK_PRESENT_MODE_FIFO_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 MSAAx4 color buffer ...created 2 Vulkan image view(s) ...created 2 Vulkan framebuffers ...created 2 Vulkan commandbuffers Successfully initialized Vulkan!

������岠������

Vulkan API: 1.2 Header version: 137 Devices found:

0: GeForce GTX 1070

Using device #0: deviceName: GeForce GTX 1070 resolution: 1920x1080 (MSAAx4) driverVersion: 440.82.0 (0x6E148000) apiVersion: 1.1.119 deviceID: 7041 vendorID: 0x10DE (NVIDIA) deviceType: VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU gfx/present/transfer: 0/0/1 Present mode: VK_PRESENT_MODE_FIFO_KHR Swapchain image format: 44 Supported present modes: VK_PRESENT_MODE_FIFO_KHR VK_PRESENT_MODE_FIFO_RELAXED_KHR VK_PRESENT_MODE_IMMEDIATE_KHR Enabled extensions: VK_KHR_surface VK_KHR_xlib_surface Enabled layers:

QVk_EndFrame(): received VK_ERROR_OUT_OF_DATE_KHR after vkQueuePresentKHR - restarting video! Failed to open ./baseq2/music/track07.[ogg/flac/mp3/wav]: error -7 QVk_BeginFrame(): received VK_ERROR_OUT_OF_DATE_KHR after vkAcquireNextImageKHR - restarting video! Shutting down Vulkan ------- Loading ref_vk.so ------- LoadLibrary("/opt/vkquake2/ref_vk.so") Cmd_AddCommand: +mlook already defined Cmd_AddCommand: -mlook already defined Cmd_AddCommand: force_centerview already defined ref_vk version: Vulkan (vkQuake2 v1.4.4) Initializing Vulkan display ...setting mode 11: 1920 1080 Using XFree86-VidModeExtension Version 2.2 Enabled extensions: VK_KHR_surface VK_KHR_xlib_surface ...created Vulkan instance ...created Vulkan surface ...found 1 Vulkan-capable device(s) ...created Vulkan memory allocator Supported present modes: VK_PRESENT_MODE_FIFO_KHR VK_PRESENT_MODE_FIFO_RELAXED_KHR VK_PRESENT_MODE_IMMEDIATE_KHR ...using present mode: VK_PRESENT_MODE_FIFO_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 MSAAx4 color buffer ...created 2 Vulkan image view(s) ...created 2 Vulkan framebuffers ...created 2 Vulkan commandbuffers Successfully initialized Vulkan!

������岠������

Vulkan API: 1.2 Header version: 137 Devices found:

0: GeForce GTX 1070

Using device #0: deviceName: GeForce GTX 1070 resolution: 1920x1080 (MSAAx4) driverVersion: 440.82.0 (0x6E148000) apiVersion: 1.1.119 deviceID: 7041 vendorID: 0x10DE (NVIDIA) deviceType: VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU gfx/present/transfer: 0/0/1 Present mode: VK_PRESENT_MODE_FIFO_KHR Swapchain image format: 44 Supported present modes: VK_PRESENT_MODE_FIFO_KHR VK_PRESENT_MODE_FIFO_RELAXED_KHR VK_PRESENT_MODE_IMMEDIATE_KHR Enabled extensions: VK_KHR_surface VK_KHR_xlib_surface Enabled layers:

Failed to open ./baseq2/music/track07.[ogg/flac/mp3/wav]: error -7 ==== ShutdownGame ==== Shutting down Vulkan recursive shutdown`

kondrak commented 4 years ago

Thanks, I'll see what I can find here.

kondrak commented 4 years ago

Does the game revert to window mode automatically once it fails entering fullscreen? That seems to be what I see here.

Elrondo46 commented 4 years ago

Exact

kondrak commented 4 years ago

I haven't had a deeper look into it yet but for a quick test - can you open ref_vk/vk_rmain.c file in a text editor and comment out lines 1271 and 1272? They're responsible for reverting to windowed mode which in this particular case might not be necessary.

After the modification please run make debug so that we can get more info if something else comes up.

Elrondo46 commented 4 years ago

Same errors QVk_EndFrame(): received VK_ERROR_OUT_OF_DATE_KHR after vkQueuePresentKHR - restarting video! QVk_BeginFrame(): received VK_ERROR_OUT_OF_DATE_KHR after vkAcquireNextImageKHR - restarting video! Failed to open ./baseq2/music/track07.[ogg/flac/mp3/wav]: error -7 QVk_BeginFrame(): received VK_ERROR_OUT_OF_DATE_KHR after vkAcquireNextImageKHR - restarting video!

And infinite loop in fullscreen

Elrondo46 commented 4 years ago

After searches, I've a doc can be interested but I'm not a C/C++ coder: https://github.com/KhronosGroup/Vulkan-Docs/issues/1126

https://github.com/KhronosGroup/Vulkan-Docs/issues/1126

goodjaerb commented 4 years ago

I just found this repo and I'm having this issue as well. I made a video to show what it looks like to me and attached the output. It is not reverting me to windowed mode. It just keeps restarting vulkan. If I set vid_fullscreen to 0 it runs fine in a window. I installed the latest LunarG Vulkan SDK and followed your directions. Might a different version work better?

https://www.youtube.com/watch?v=cjYPGA-6LQo

vkQuake2_output.txt

kondrak commented 4 years ago

I just pushed a slight behavior change of what happens during a video restart on Vulkan. The problem here is that the error causes entire window to be rebuilt which now should not occur. Please check the ood branch and let me know if the issue still presists :)

kondrak commented 4 years ago

@goodjaerb is this Gnome? Apparently there's an issue when toggling to fullscreen but what's happening here is pretty odd, there could be another bug.

goodjaerb commented 4 years ago

@goodjaerb is this Gnome? Apparently there's an issue when toggling to fullscreen but what's happening here is pretty odd, there could be another bug.

It's Ubuntu 20.04, so yes I believe gnome. I will try the odd branch and let you know.

goodjaerb commented 4 years ago

@kondrak i compiled the ood branch and it appears to be working just fine!

kondrak commented 4 years ago

Great! @Elrondo46 does it work for you as well?

Elrondo46 commented 4 years ago

Solved in odd branch :100: , I love playing it in fullscreen... Greetings from France in Lockdown actually :(

kondrak commented 4 years ago

Don't worry, the lockdown will end eventually, over here we're also stuck at home and slowly losing our minds because of it ;) Thanks for the report and your help guys, I'll push a proper fix to master branch soon!

Elrondo46 commented 4 years ago

Thanks