NVK: VK_ERROR_OUT_OF_DEVICE_MEMORY on swapchain creation
Problem Description
Every Vulkan Application i've tried "crashes". The crash comes from the problem, that Swapchain creation fails with error VK_ERROR_OUT_OF_DEVICE_MEMORY
.
This is a permanent issue. I've tried restarting my computer a few times.
I've tried debugging this issue with the "easy way" described here.
What i've noticed is:
-
drmCommandWriteRead
returns-22
- called from
nouveau_ws_bo_new_tiled_locked
- called from
- Causes
mem->bo
innvk_AllocateMemory
to beNULL
Regression
This issue appeared since mesa 24.1
Log files as attachment
- Backtrace of debugging
#0 drmCommandWriteRead (fd=10, drmCommandIndex=drmCommandIndex@entry=64, data=data@entry=0x7fffffffc1e0, size=size@entry=48) at ../libdrm-2.4.120/xf86drm.c:3186
#1 0x00007fffe865f2a7 in nouveau_ws_bo_new_tiled_locked (dev=dev@entry=0x555555633770, size=size@entry=3932160, align=<optimized out>, align@entry=65536, pte_kind=pte_kind@entry=6 '\006', tile_mode=<optimized out>, flags=(NOUVEAU_WS_BO_LOCAL | NOUVEAU_WS_BO_GART))
at ../src/nouveau/winsys/nouveau_bo.c:227
#2 0x00007fffe865f4d2 in nouveau_ws_bo_new_tiled (dev=0x555555633770, size=3932160, align=align@entry=65536, pte_kind=pte_kind@entry=6 '\006', tile_mode=<optimized out>, flags=flags@entry=(NOUVEAU_WS_BO_LOCAL | NOUVEAU_WS_BO_GART)) at ../src/nouveau/winsys/nouveau_bo.c:269
#3 0x00007fffe825c622 in nvk_AllocateMemory (device=0x5555556d3b10, pAllocateInfo=<optimized out>, pAllocator=0x5555556b91e0, pMem=0x5555556b95e8) at ../src/nouveau/vulkan/nvk_device_memory.c:235
#4 0x00007fffe8228753 in wsi_create_native_image_mem (chain=0x5555556b9190, info=0x5555556b9238, image=0x5555556b95e0) at ../src/vulkan/wsi/wsi_common_drm.c:693
#5 0x00007fffe8225684 in wsi_create_image (chain=0x5555556b9190, info=0x5555556b9238, image=0x5555556b95e0) at ../src/vulkan/wsi/wsi_common.c:729
#6 0x00007fffe822e130 in x11_image_init (device_h=<optimized out>, pAllocator=<optimized out>, chain=0x5555556b9190, pCreateInfo=<optimized out>, image=0x5555556b95e0) at ../src/vulkan/wsi/wsi_common_x11.c:2035
#7 x11_surface_create_swapchain (icd_surface=<optimized out>, device=<optimized out>, wsi_device=<optimized out>, pCreateInfo=<optimized out>, pAllocator=0x5555556d3b50, swapchain_out=<optimized out>) at ../src/vulkan/wsi/wsi_common_x11.c:2714
#8 0x00007fffe8225b8c in wsi_CreateSwapchainKHR (_device=0x5555556d3b10, pCreateInfo=<optimized out>, pAllocator=<optimized out>, pSwapchain=0x7fffffffc850) at ../src/vulkan/wsi/wsi_common.c:1005
#9 0x00007ffff6bba585 in terminator_CreateSwapchainKHR (device=0x5555556d3b10, pCreateInfo=0x7fffffffc920, pAllocator=0x0, pSwapchain=0x7fffffffc850) at /usr/src/debug/vulkan-icd-loader/Vulkan-Loader-1.3.285/loader/wsi.c:499
#10 0x000055555557515b in VulkanSwapchain::VulkanSwapchain (this=0x5555555e6978, device=..., surface=..., window=0x0) at /home/sebbl/Dev/C_Cpp/cpp_vk_playground/src/vk/swapchain.cpp:46
#11 0x0000555555565aef in GpuState::GpuState (this=0x5555555e62d8, window=0x5555556b0370) at /home/sebbl/Dev/C_Cpp/cpp_vk_playground/src/vk/gpu_state.cpp:12
#12 0x00005555555595c4 in App::App (this=0x5555555e62d0) at /home/sebbl/Dev/C_Cpp/cpp_vk_playground/src/app.cpp:7
#13 0x000055555555b4a7 in main (argc=1, argv=0x7fffffffcc18) at /home/sebbl/Dev/C_Cpp/cpp_vk_playground/src/main.cpp:8
Screenshots/video files (if applicable)
Any extra information would be greatly appreciated
The issue also appears on current mesa master a79a2486
System information
System:
Host: APE Kernel: 6.9.3-arch1-1 arch: x86_64 bits: 64 compiler: gcc
v: 14.1.1
Desktop: KDE Plasma v: 6.0.5 tk: Qt v: N/A wm: kwin_wayland dm: SDDM
Distro: Arch Linux
CPU:
Info: 8-core model: AMD Ryzen 7 7800X3D bits: 64 type: MT MCP arch: Zen 4
rev: 2 cache: L1: 512 KiB L2: 8 MiB L3: 96 MiB
Speed (MHz): avg: 4772 min/max: 400/5050 cores: 1: 4772 2: 4772 3: 4772
4: 4772 5: 4772 6: 4772 7: 4772 8: 4772 9: 4772 10: 4772 11: 4772 12: 4772
13: 4772 14: 4772 15: 4772 16: 4772 bogomips: 134203
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
Device-1: NVIDIA GA104 [GeForce RTX 3070 Lite Hash Rate] vendor: ASUSTeK
driver: nouveau v: kernel arch: Ampere pcie: speed: 5 GT/s lanes: 16 ports:
active: DP-3,HDMI-A-1 empty: DP-1,DP-2,HDMI-A-2 bus-ID: 01:00.0
chip-ID: 10de:2488
Device-2: AMD Raphael driver: amdgpu v: kernel arch: RDNA-2 pcie:
speed: 16 GT/s lanes: 16 ports: active: none empty: DP-4, DP-5, DP-6,
HDMI-A-3, Writeback-1 bus-ID: 0f:00.0 chip-ID: 1002:164e temp: 42.0 C
Device-3: KYE Systems (Mouse Systems) PC-LM1E Camera
driver: snd-usb-audio,uvcvideo type: USB rev: 2.0 speed: 480 Mb/s lanes: 1
bus-ID: 1-5:3 chip-ID: 0458:6006
Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.0
compositor: kwin_wayland driver: X: loaded: modesetting
alternate: fbdev,nouveau,nv,vesa dri: nouveau,radeonsi gpu: nouveau
display-ID: 0
Monitor-1: DP-3 model: ViewSonic VX2758-SERIES res: 2560x1440 dpi: 109
diag: 686mm (27")
Monitor-2: HDMI-A-1 model: BenQ GL2450 res: 1920x1080 dpi: 92
diag: 609mm (24")
API: EGL v: 1.5 platforms: device: 0 drv: nouveau device: 1 drv: radeonsi
device: 2 drv: swrast gbm: drv: nouveau surfaceless: drv: nouveau wayland:
drv: nouveau x11: drv: nouveau
API: OpenGL v: 4.6 compat-v: 4.3 vendor: mesa v: 24.1.0-arch1.1 glx-v: 1.4
direct-render: yes renderer: NV174 device-ID: 10de:2488 display-ID: :1.0
API: Vulkan v: 1.3.279 surfaces: xcb,xlib,wayland device: 0
type: discrete-gpu driver: mesa nvk device-ID: 10de:2488 device: 1 type: cpu
driver: mesa llvmpipe device-ID: 10005:0000