bkaradzic/bgfx

Crash on resize: Nvidia RTX 4090 + Vulkan + Linux

thinkimlazy opened this issue · 3 comments

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

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

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

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