-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array wrapper may cause a GPU crash? #2308
Comments
This is impossible for me to debug. I don't have any Apple hardware. |
Hi, @js6i ! Unless there were major changes, since I've worked on struct spvDescriptorSetBuffer1
{
spvDescriptor<texture_buffer<uint>> t0 [[id(0)]][1] /* unsized array hack */;
}; This is a mix of T1-argument-buffer( AFAIR what you need to to set following setting of compiler:
|
@Try thanks for chiming in. Are you saying that Besides, the generated code seems fine other than the weird bug that I addressed in #2314. |
There were not intended to be uses together. Yet, have to say that I didn't followed spirv-cross for several months, and thing maybe different now. Maybe @billhollings knows better, than I am, if there is a use case for In Metal T1-argument buffer is close analog to Vulkan descriptor-set, and T2 - more like descriptor-buffer, allowing pointer to other buffers/textures within the buffer.
Don't think it needed to emulate vulkan. Vulkan descriptor-indexing model always requires to declare upper bound for each runtime-sized array, on C++ side. Even if |
Yeah, the issue with that is that then binding a smaller buffer (and the descriptor pool only needs to be large enough to fit the variable count) triggers a validation error. |
Workaround is merged, so should be fine now. |
This is something I found while working on KhronosGroup/MoltenVK#2199. Enabling variable sized arrays caused a bunch of vkd3d tests that otherwise worked fine (modulo validation errors due to declaring huge arrays and binding small buffers to them) to crash the GPU (M1). I tried a few things, like using the regular
array<>
type instead ofspvDescriptor*
wrappers, but what ended up fixing the crash was making the entry point variables plain pointers.Below is one of the kernels that crashed (from vkd3d d3d12
test_register_space
), with the plain pointer version #if'd inline:The crash is
vkQueueSubmit MTLCommandBuffer on Queue 3-0" execution failed (code 3): Caused GPU Address Fault Error (0000000b:kIOGPUCommandBufferCallbackErrorPageFault
The text was updated successfully, but these errors were encountered: