Cyberpunk 2077 crashes on radv with ray tracing enabled
For quite a while since certain updates in vkd3d-proton, CP2077 started crashing when enabling ray tracing.
See also: https://github.com/HansKristian-Work/vkd3d-proton/issues/652
I tried digging into the crash a bit (latest Mesa-main with vkd3d-proton master).
I caught the crash with gdb sourcing this script to load symbols.
The method was first to start the game without ray tracing turned on, but with these env variables:
radv_rt=true
VKD3D_CONFIG='dxr11'
Then attach gdb to it, continue the game and enable ray tracing in the settings when some save is loaded. That causes the crash.
Resulting current back trace wasn't very informative:
Thread 10 "redDispatcher8" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 136922]
0x0000000142ce4a5d in ?? ()
(gdb) lsf
loading symbols for /opt/wine-devel/lib64/wine/x86_64-windows/msvcrt.dll
loading symbols for /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.12.0
...
loading symbols for /opt/wine-devel/lib64/wine/x86_64-windows/version.dll
(gdb)
(gdb) bt
#0 0x0000000142ce4a5d in ?? ()
#1 0x00007f2defd6c180 in ?? ()
#2 0x0000000000000000 in ?? ()
(gdb)
But one of the threads had this:
(gdb) t 12
[Switching to thread 12 (Thread 0x3a00f6c0 (LWP 136924))]
#0 __memcpy_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:280
280 ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
(gdb) bt
#0 __memcpy_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:280
#1 0x00007f21054f3f1b in memcpy (__len=32, __src=0x4, __dest=0x7f20b94e4384) at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29
#2 radv_CmdPushConstants (commandBuffer=commandBuffer@entry=0x7f20b94e1900, layout=<optimized out>, stageFlags=stageFlags@entry=32, offset=offset@entry=0, size=size@entry=32, pValues=pValues@entry=0x3a00db60)
at ../mesa/src/amd/vulkan/radv_cmd_buffer.c:5931
#3 0x00007f21054e2a8b in lbvh_build_internal (flush_bits=4142, bvh_states=0x7f20ac15e950, pInfos=0x39eec380, infoCount=1, commandBuffer=0x7f20b94e1900) at ../mesa/src/amd/vulkan/radv_acceleration_structure.c:729
#4 radv_CmdBuildAccelerationStructuresKHR (commandBuffer=0x7f20b94e1900, infoCount=1, pInfos=0x39eec380, ppBuildRangeInfos=0x39eebbb0) at ../mesa/src/amd/vulkan/radv_acceleration_structure.c:909
Backtrace stopped: Cannot access memory at address 0x88
__src=0x4
in memcpy
looks off.
Hopefully this can help narrow it down. I can also try catching that condition with fossilize.