Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on resize: Nvidia RTX 4090 + Vulkan + Linux #3227

Open
thinkimlazy opened this issue Dec 20, 2023 · 5 comments
Open

Crash on resize: Nvidia RTX 4090 + Vulkan + Linux #3227

thinkimlazy opened this issue Dec 20, 2023 · 5 comments
Labels

Comments

@thinkimlazy
Copy link

thinkimlazy commented Dec 20, 2023

Describe the bug
My App and exampleDebug\exampleRelease crashes after few seconds of resizing

  • Linux
  • Vulkan
  • Nvidia RTX 4090
  • x11 (i3)
 nvidia-smi                                                                                                                                                                                                         (base) 
Tue Dec 19 20:10:25 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.29.06              Driver Version: 545.29.06    CUDA Version: 12.3     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 4090        Off | 00000000:01:00.0  On |                  Off |
|  0%   37C    P8              11W / 450W |   1483MiB / 24564MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+

exampleDebug --gl works fine.

To Reproduce
Steps to reproduce the behavior:

  1. Make debug/release linux
  2. open exampleDebug
  3. Start resizing window

Expected behavior
Resize without crashing

Additional context
Debug log
log.log

@bkaradzic bkaradzic added the bug label Dec 20, 2023
@thinkimlazy
Copy link
Author

On same machine everything works just fine on Vulkan + Integrated AMD Ryzen.

Vulkan standard mentions that logical device lose might be implementation detail. Should we provide a way to recreate logical device?
Looks like nvidia driver implementation for linux loses logical device for some resizes.
(maybe it's noob idea, I am not proficient with graphics)

It seems this problem is old one, I found few mentions of Nvidia + Vulkan and VK_ERROR_DEVICE_LOST error
in discord.
maybe this is relatable mpv-player/mpv#8360

@thinkimlazy
Copy link
Author

thinkimlazy commented Dec 20, 2023

example 22-windows also crashes after 2 windows for Nvidia.
AMD integrated works fine.

@bkaradzic
Copy link
Owner

It's most likely nVidia driver bug... But I can fix bgfx/VK renderer to handle lost device properly.

@mcourteaux
Copy link
Contributor

It's a BGFX bug in the Vulkan backend. For 22-windows, I get the following validation error:

../../../src/renderer_vk.cpp (683): BGFX ---E- RenderPass, Validation, 0: Validation Error: [ VUID-VkRenderPassBeginInfo-pNext-02853 ] Object 0: handle = 0xdd3a8a0000000015, type = VK_OBJECT_TYPE_RENDER_PASS; Object 1: handle = 0x75fbb90000000c27, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x1bd44466 | vkCmdBeginRenderPass(): pRenderPassBegin->renderArea offset.y (0) + extent.height (480) is greater than framebuffer height (319). The Vulkan spec states: If the pNext chain does not contain VkDeviceGroupRenderPassBeginInfo or its deviceRenderAreaCount member is equal to 0, renderArea.offset.y + renderArea.extent.height must be less than or equal to VkFramebufferCreateInfo::height the framebuffer was created with (https://vulkan.lunarg.com/doc/view/1.3.280.0/linux/1.3-extensions/vkspec.html#VUID-VkRenderPassBeginInfo-pNext-02853)

Similar to the issue in #3304. Some mechanism is running behind in keeping track with the resolution of the window.

@mcourteaux
Copy link
Contributor

I also get annoying flickering of the video text debug printing on top of the window. It happens in both GL backend and Vulkan backend for 22-windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants