Closed haasn closed 4 months ago
It's worth pointing out that the buffer view being destroyed in the backtrace (via vulkan_layer_chassis::DestroyBufferView
) is the one temporarily being used by the compute shader (layout(binding=0, r8) restrict uniform imageBuffer _2;
).
Since the vk_buf_deref
callback is being run, the command in question has definitely completed. This is witnessed by a semaphore wait (vkWaitSemaphores
) on a semaphore being signaled by this command (at VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT
). There is no VkFence involved, so no vkWaitForFences call to witness the command's completion. It's possible that this is the source of the issue, as the command may not be properly retired in this case.
There is no VkFence involved, so no vkWaitForFences call to witness the command's completion. It's possible that this is the source of the issue, as the command may not be properly retired in this case.
Unfortunately this is not the case, I tried switching to vkWaitForFences
but get the same segfault.
Hello @haasn , you mention a test suite in the issue, could you point me to it please, and tell me what settings you were using?
Hello @haasn , you mention a test suite in the issue, could you point me to it please, and tell me what settings you were using?
git clone --recursive https://code.videolan.org/videolan/libplacebo && cd libplacebo
meson setup build -Dtests=true
meson test -Cbuild vulkan.c
Hey @haasn, thank you for the details. Unfortunately those steps do not seem to be enough on Windows. It is my first time using meson, so maybe my setup is broken.
1) I had to remove the search of the atomic
library, it fails and I can confirm that indeed atomic.lib
is nowhere to be found on my computer
if not cc.links(atomic_test)
build_deps += cc.find_library('atomic')
endif
2) meson cannot find the vulkan loader, and glslang
, even though I have the Vulkan SDK installed, so I cannot build the vulkan tests
Do you happen to have insights on those issues please?
@haasn so I am on Linux and close to reproducing, but I can't get meson to detect the SDK (or my personal clone) of glslang
/shaderc
(without it, the test fails with Failed initializing any SPIR-V compiler! Maybe libplacebo was built without support for either libshaderc or glslang?
)
I try meson setup build -Dtests=true -Dglslang=enabled
but will complain about C++ static library 'SPIRV' not found
and I have tried setting the pkgconfig and everything to my various paths
(edit - think I got it, but required a lot of hard coding in the meson.build
)
@haasn I can fully reproduce it!
so for clarity, it only occurs with GPU-AV (Best Practice, core valid, etc, don't effect the crash)
@haasn we should have this all fixed now
I have also added the libplacebo
's meson test -Cbuild vulkan.c
test to our SDK release to make sure GPU-AV (and rest of validation as well) doesn't regress on it!
Thanks for opening the issue
Environment:
Describe the Issue
Segmentation fault when dispatching the first compute shader in the test suite, starting with commit b3065ebc190d83462d15761cd26edb559f3c5508. (See terminal output below)
Still present as of ff56cf67d3494eec1243cc4225d1667e9b3f90cd.
Additional context
Terminal output + backtrace
``` ... compute shader source: [ 1] #version 450 [ 2] #extension GL_ARB_compute_shader : enable [ 3] #extension GL_KHR_shader_subgroup_basic : enable [ 4] #extension GL_KHR_shader_subgroup_vote : enable [ 5] #extension GL_KHR_shader_subgroup_arithmetic : enable [ 6] #extension GL_KHR_shader_subgroup_ballot : enable [ 7] #extension GL_KHR_shader_subgroup_shuffle : enable [ 8] #extension GL_KHR_shader_subgroup_clustered : enable [ 9] #extension GL_KHR_shader_subgroup_quad : enable [ 10] #extension GL_ARB_shader_image_load_store : enable [ 11] #extension GL_ARB_texture_buffer_object : enable [ 12] layout(std430, push_constant) uniform PushC { [ 13] layout(offset=0) int _4; [ 14] layout(offset=4) int _5; [ 15] layout(offset=8) int _6; [ 16] layout(offset=12) int _7; [ 17] }; [ 18] layout(constant_id=0) const int _8 = 1; [ 19] layout(constant_id=1) const int _9 = 1; [ 20] layout(constant_id=2) const int _a = 1; [ 21] layout(binding=0, r8) restrict uniform imageBuffer _2; [ 22] layout(binding=1, rgba8) readonly restrict uniform image1D _3; [ 23] layout (local_size_x = 16, local_size_y = 1) in; [ 24] [ 25] void _1() { [ 26] ivec3 pos = ivec3(gl_GlobalInvocationID); [ 27] ivec3 tex_pos = pos + ivec3(_4, _5, _6); [ 28] int base = _7 + pos.z * _8 + pos.y * _9 + pos.x * _a; [ 29] vec4 color = imageLoad(_3, int(tex_pos)); [ 30] imageStore(_2, base + 0, vec4(color[0])); [ 31] imageStore(_2, base + 1, vec4(color[1])); [ 32] imageStore(_2, base + 2, vec4(color[2])); [ 33] [ 34] } [ 35] [ 36] void main() { [ 37] _1(); [ 38] } Specialization constant values: constant_id=0: 48 constant_id=1: 48 constant_id=2: 3 shaderc output: input:11: warning: '#extension' : extension not supported: GL_ARB_texture_buffer_object shaderc compile status 'success' (0 errors, 1 warnings) Spent 2.902 ms translating SPIR-V Spent 13.143 ms compiling shader Spent 13.742 ms creating pipeline Pass statistics: size 0, SPIR-V: vert 0 frag 0 comp 0 Thread 9 "test.vulkan.c" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffd4a006c0 (LWP 2002)] 0x00007fffe59c902a in std::__atomic_base