radv_amdgpu_cs_submit: Assertion `chunk_data[request->number_of_ibs - 1].ib_data.ip_type == request->ip_type' failed.
Description
When Mesa is built in debug mode, I can get a 100% reproducible crash starting a new game in OpenGothic. The issue does not happen in release-mode built binaries.
Repro
Found in 7550f591, reproduces every time. I've rolled back as far back as to June to rule out a recent regression; I can go further back if needed.
Repro procedure:
meson setup builddir/
ninja -C builddir/
sudo ninja -C builddir/ install
# clone and build OpenGothic; it also needs the original Gothic 2 installed somewhere in the system (the `-g` argument below)
cd OpenGothic
MESA=/usr/local LD_LIBRARY_PATH=$MESA/lib64:$MESA/lib:$(pwd)/build/opengothic:$LD_LIBRARY_PATH \
LIBGL_DRIVERS_PATH=$MESA/lib64/dri VK_ICD_FILENAMES=$MESA/share/vulkan/icd.d/radeon_icd.x86_64.json \
./build/opengothic/Gothic2Notr -g ~/Games/gothic-ii-gold-edition/drive_c/GOG\ Games/Gothic\ 2\ Gold/
# select New Game, confirm, skip intro -> crash
Logs
This is logged just before the game crashes:
Gothic2Notr: ../src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c:1677: radv_amdgpu_cs_submit: Assertion `chunk_data[request->number_of_ibs - 1].ib_data.ip_type == request->ip_type' failed.
Game logs its own backtrace:
---crashlog(SIGABRT)---
GPU: AMD Radeon RX 6700 XT (RADV NAVI22)
#1: - /lib64/libc.so.6(+0x8e844) [0x7fa2b08b0844]
#2: gsignal - /lib64/libc.so.6(gsignal+0x1e) [0x7fa2b085fabe]
#3: abort - /lib64/libc.so.6(abort+0xdf) [0x7fa2b084887f]
#4: abort - /lib64/libc.so.6(+0x2679b) [0x7fa2b084879b]
#5: abort - /lib64/libc.so.6(+0x36147) [0x7fa2b0858147]
#6: abort - /usr/local/lib64/libvulkan_radeon.so(+0x6e62cf) [0x7fa2b02e62cf]
#7: abort - /usr/local/lib64/libvulkan_radeon.so(+0x68dd4e) [0x7fa2b028dd4e]
#8: abort - /usr/local/lib64/libvulkan_radeon.so(+0x72a87f) [0x7fa2b032a87f]
#9: abort - /usr/local/lib64/libvulkan_radeon.so(+0x72b757) [0x7fa2b032b757]
#10: abort - /usr/local/lib64/libvulkan_radeon.so(+0x72bf55) [0x7fa2b032bf55]
#11: Tempest::Detail::VDevice::Queue::submit(unsigned int, VkSubmitInfo2 const*, unsigned long, VkResult (*)(VkQueue_T*, unsigned int, VkSubmitInfo2 const*, unsigned long)) - /home/black_fox/src/OpenGothic/build/opengothic/libTempest.so(_ZN7Tempest6Detail7VDevice5Queue6submitEjPK13VkSubmitInfo2mPF8VkResultP9VkQueue_TjS5_mE+0x2f) [0x7fa2b100744f]
#12: Tempest::Detail::VDevice::submit(Tempest::Detail::VCommandBuffer&, Tempest::Detail::VFence*) - /home/black_fox/src/OpenGothic/build/opengothic/libTempest.so(_ZN7Tempest6Detail7VDevice6submitERNS0_14VCommandBufferEPNS0_6VFenceE+0x2bb) [0x7fa2b100773b]
#13: MainWindow::render() - ./build/opengothic/Gothic2Notr(_ZN10MainWindow6renderEv+0x335) [0x8b5645]
#14: Tempest::X11Api::implProcessEvents(Tempest::SystemApi::AppCallBack&) - /home/black_fox/src/OpenGothic/build/opengothic/libTempest.so(_ZN7Tempest6X11Api17implProcessEventsERNS_9SystemApi11AppCallBackE+0x4e) [0x7fa2b10284ee]
#15: Tempest::X11Api::implExec(Tempest::SystemApi::AppCallBack&) - /home/black_fox/src/OpenGothic/build/opengothic/libTempest.so(_ZN7Tempest6X11Api8implExecERNS_9SystemApi11AppCallBackE+0x1b) [0x7fa2b1028ceb]
#16: main - ./build/opengothic/Gothic2Notr(main+0x1f0) [0x8aef70]
Here's an output of coredumpctl:
#0 0x00007fca350b0844 __pthread_kill_implementation (libc.so.6 + 0x8e844)
#1 0x00007fca3505fabe raise (libc.so.6 + 0x3dabe)
#2 0x00007fca3504887f abort (libc.so.6 + 0x2687f)
#3 0x00007fca3504879b __assert_fail_base.cold (libc.so.6 + 0x2679b)
#4 0x00007fca35058147 __assert_fail (libc.so.6 + 0x36147)
#5 0x00007fca34ae62cf radv_amdgpu_cs_submit (libvulkan_radeon.so + 0x6e62cf)
#6 0x00007fca34a8dd4e radv_queue_submit_normal (libvulkan_radeon.so + 0x68dd4e)
#7 0x00007fca34b2a87f vk_queue_submit_final (libvulkan_radeon.so + 0x72a87f)
#8 0x00007fca34b2b757 vk_queue_submit (libvulkan_radeon.so + 0x72b757)
#9 0x00007fca34b2bf55 vk_common_QueueSubmit2KHR (libvulkan_radeon.so + 0x72bf55)
#10 0x00007fca3580744f n/a (/home/black_fox/src/OpenGothic/build/opengothic/libTempest.so + 0x20744f)
System information
Click to expand
System:
Host: hostname Kernel: 6.4.12-200.fc38.x86_64 arch: x86_64 bits: 64
compiler: gcc v: 2.39-9.fc38 Desktop: GNOME v: 44.4 tk: GTK v: 3.24.38
wm: gnome-shell dm: GDM Distro: Fedora release 38 (Thirty Eight)
CPU:
Info: 8-core model: AMD Ryzen 7 5700X bits: 64 type: MT MCP arch: Zen 3+
rev: 2 cache: L1: 512 KiB L2: 4 MiB L3: 32 MiB
Speed (MHz): avg: 2327 high: 2858 min/max: 2200/4662 boost: enabled cores:
1: 2169 2: 2497 3: 2200 4: 2794 5: 2194 6: 2200 7: 2197 8: 2858 9: 2200
10: 2343 11: 2200 12: 2605 13: 2200 14: 2200 15: 2200 16: 2182
bogomips: 108799
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
Device-1: AMD Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
vendor: Micro-Star MSI driver: amdgpu v: kernel arch: RDNA-2 pcie:
speed: 16 GT/s lanes: 16 ports: active: DP-2 empty: DP-1,DP-3,HDMI-A-1
bus-ID: 2b:00.0 chip-ID: 1002:73df
Device-2: Realtek Full HD webcam driver: snd-usb-audio,uvcvideo type: USB
rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 1-7:3 chip-ID: 0bda:5187
Display: x11 server: X.Org v: 1.20.14 with: Xwayland v: 22.1.9
compositor: gnome-shell driver: X: loaded: amdgpu dri: radeonsi gpu: amdgpu
display-ID: :0.0 screens: 1
Screen-1: 0 s-res: 2560x1440 s-dpi: 96
Monitor-1: DP-2 mapped: DisplayPort-1 model: Gigabyte M32Q res: 2560x1440
dpi: 93 diag: 801mm (31.5")
API: OpenGL v: 4.6 Mesa 23.3.0-devel renderer: AMD Radeon RX 6700 XT
(navi22 LLVM 16.0.6 DRM 3.52 6.4.12-200.fc38.x86_64) direct-render: Yes