Vulkan Shader compiler crash
Join Date: 3 Feb 15
Posts: 6
Posted: Mon, 2023-11-20 06:01
It seems the vulkan shader compiler is not fully threadsafe.
I was able to reproduce on Android on various adreno based devices: Galaxy S6 Tab (Adreno 640), Galaxy A52 5G (Adreno 619), Pixel 3A (Adreno 615), Pixel 2XL (Adreno 540) but not on other non adreno gpu based android devices (and not on PC with vulkan driver).
I have a sequence posted of shader compiler requests for at least one CS and one PS.
Both the PS and CS are not trivial but the CS is a very complex one (I suspect the CS request starts to be processed first but ends after the PS requests has been processed).
If the compiling requests are processed on different threads, it randomly crash or not.
If MT shader compiling is disabled in the our application, it never crashes.
When it crashes, I get the following callstack:
#00 pc 0000000000be6780 /vendor/lib64/libllvm-glnext.so (!!!0000!487de5636d63bb9601ede5b0f782a0!02fe52e!+1128) (BuildId: b2efc987f291796dd300f624036fbe19)
#01 pc 00000000009f232c /vendor/lib64/libllvm-glnext.so (!!!0000!a0c8f6997b328c2ada5569b4d52918!02fe52e!+252) (BuildId: b2efc987f291796dd300f624036fbe19)
#02 pc 00000000009d0804 /vendor/lib64/libllvm-glnext.so (!!!0000!c3aaf8fe6cfe7eeacc6c0fa604b005!02fe52e!+620) (BuildId: b2efc987f291796dd300f624036fbe19)
#03 pc 0000000000aaad40 /vendor/lib64/libllvm-glnext.so (QGLCLinkProgram(void*, unsigned int, QGLC_SRCSHADER_IRSHADER**, QGLC_LINKPROGRAM_DATA*, QGLC_LINKPROGRAM_RESULT*)+112) (BuildId: b2efc987f291796dd300f624036fbe19)
#04 pc 000000000007fc64 /vendor/lib64/hw/vulkan.adreno.so (!!!0000!408a0df45472c0e06e44d798996f89!e883189!+16748) (BuildId: 72db396c8baadb530a02baef5c3b344a)
#05 pc 0000000000067a9c /vendor/lib64/hw/vulkan.adreno.so (!!!0000!9edc5309b84ca97e813fe8bc838b43!e883189!+148) (BuildId: 72db396c8baadb530a02baef5c3b344a)
#06 pc 00000000000471bc /vendor/lib64/hw/vulkan.adreno.so (qglinternal::vkCreateComputePipelines(VkDevice_T*, VkPipelineCache_T*, unsigned int, VkComputePipelineCreateInfo const*, VkAllocationCallbacks const*, VkPipeline_T**)+972) (BuildId: 72db396c8baadb530a02baef5c3b344a)