Closed will-ca closed 1 year ago
Huh. Happens even with fresh build... Same backtrace, looks like.
Thanks for the report! This is a crash in the Intel driver and will be difficult to diagnose on my end since I cannot repro. If you build Filament yourself in a debug configuration, it will try to find the Vulkan validation layers which might give us more info.
Another interesting thing try is ./gltf_viewer -a opengl
, which selects our OpenGL driver, which might be a bit more robust with Intel drivers. Since you seem to be only vaguely aware that the Vulkan backend is what's being used by default, I'm guessing you'd be okay with OpenGL. :)
Cool. OpenGL should work for me for now. Thanks.
As for the debug build:
$ ./gltf_viewer
FEngine (64 bits) created at 0x55a243ffbdb0 (threading is enabled)
FEngine resolved backend: Vulkan
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0
Vulkan device driver: Intel open-source Mesa driver Mesa 22.1.7
Selected physical device 'Intel(R) UHD Graphics 620 (KBL GT2)' from 1 physical devices. (vendor 0x8086, device 0x5917, driver 0x5801007, api 1.3)
FEngine feature level: 1
Requested linear format but KTX contains a sRGB format.
Requested linear format but KTX contains a sRGB format.
Texture Decoder has 6 background threads.
vkCreateSwapchain: 1024x640, VK_FORMAT_B8G8R8A8_SRGB, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, 4, 1
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-ClearValueWithoutLoadOpClear) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-ClearValueWithoutLoadOpClear ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6beca064 | This render pass does not have VkRenderPassCreateInfo.pAttachments->loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR but VkRenderPassBeginInfo.clearValueCount > 0. VkRenderPassBeginInfo.pClearValues will be ignored and no attachments will be cleared.
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-ClearValueWithoutLoadOpClear) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-ClearValueWithoutLoadOpClear ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6beca064 | This render pass does not have VkRenderPassCreateInfo.pAttachments->loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR but VkRenderPassBeginInfo.clearValueCount > 0. VkRenderPassBeginInfo.pClearValues will be ignored and no attachments will be cleared.
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-ClearValueWithoutLoadOpClear) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-ClearValueWithoutLoadOpClear ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6beca064 | This render pass does not have VkRenderPassCreateInfo.pAttachments->loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR but VkRenderPassBeginInfo.clearValueCount > 0. VkRenderPassBeginInfo.pClearValues will be ignored and no attachments will be cleared.
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-ClearValueWithoutLoadOpClear) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-ClearValueWithoutLoadOpClear ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6beca064 | This render pass does not have VkRenderPassCreateInfo.pAttachments->loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR but VkRenderPassBeginInfo.clearValueCount > 0. VkRenderPassBeginInfo.pClearValues will be ignored and no attachments will be cleared.
Uninitialized texture bound to 'materialParams_baseColorMap' in material 'Material_MR' at binding point 9
Uninitialized texture bound to 'materialParams_metallicRoughnessMap' in material 'Material_MR' at binding point 10
Uninitialized texture bound to 'materialParams_normalMap' in material 'Material_MR' at binding point 11
Uninitialized texture bound to 'materialParams_occlusionMap' in material 'Material_MR' at binding point 12
Uninitialized texture bound to 'materialParams_emissiveMap' in material 'Material_MR' at binding point 13
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x62f84330 | Trying to load an attachment with LOAD_OP_LOAD that was previously stored with STORE_OP_DONT_CARE. This may result in undefined behaviour.
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x62f84330 | Trying to load an attachment with LOAD_OP_LOAD that was previously stored with STORE_OP_DONT_CARE. This may result in undefined behaviour.
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x62f84330 | Trying to load an attachment with LOAD_OP_LOAD that was previously stored with STORE_OP_DONT_CARE. This may result in undefined behaviour.
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x62f84330 | Trying to load an attachment with LOAD_OP_LOAD that was previously stored with STORE_OP_DONT_CARE. This may result in undefined behaviour.
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x62f84330 | Trying to load an attachment with LOAD_OP_LOAD that was previously stored with STORE_OP_DONT_CARE. This may result in undefined behaviour.
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x62f84330 | Trying to load an attachment with LOAD_OP_LOAD that was previously stored with STORE_OP_DONT_CARE. This may result in undefined behaviour.
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x62f84330 | Trying to load an attachment with LOAD_OP_LOAD that was previously stored with STORE_OP_DONT_CARE. This may result in undefined behaviour.
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x62f84330 | Trying to load an attachment with LOAD_OP_LOAD that was previously stored with STORE_OP_DONT_CARE. This may result in undefined behaviour.
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x62f84330 | Trying to load an attachment with LOAD_OP_LOAD that was previously stored with STORE_OP_DONT_CARE. This may result in undefined behaviour.
VULKAN WARNING: (UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad) Validation Warning: [ UNASSIGNED-BestPractices-vkCmdBeginRenderPass-StoreOpDontCareThenLoadOpLoad ] Object 0: handle = 0x7f505c8fb5e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x62f84330 | Trying to load an attachment with LOAD_OP_LOAD that was previously stored with STORE_OP_DONT_CARE. This may result in undefined behaviour.
Segmentation fault (core dumped)
(Note: I did not install the Vulkan validation layers until after the build. Seems fine?)
Vulkan Intel Mesa driver: 22.1.7-1
.
I think the warnings are probably a separate issue from the segfault.
IMO, both the warnings and the segfault should be investigated. However the segfault will be hard to diagnose without a repro, which likely requires a Linux machine with a Mesa setup.
I was able to repro and noticed the same warnings.
In setting mContext.debugUtilsSupported = false
, both the segfault and warnings go away. Makes me think that they might be the same issue.
I was able to make the validation warnings go away, but did not solve the segfault.
I end up building RADV (mesa's radeon vulkan driver) and got the following more detailed stack
0x00007fffbc589369 in vk_common_CmdBeginDebugUtilsLabelEXT (_commandBuffer=0x7fffb05fcd50, pLabelInfo=<optimized out>) at ../src/util/u_dynarray.h:163
163 return p;
(gdb) bt
#0 0x00007fffbc589369 in vk_common_CmdBeginDebugUtilsLabelEXT (_commandBuffer=0x7fffb05fcd50, pLabelInfo=<optimized out>) at ../src/util/u_dynarray.h:163
#1 0x000055555676523b in filament::backend::VulkanDriver::pushGroupMarker (this=0x7fffb0000b90, string=0x555557f560fe "Finish Color Passes", len=0) at /home/powei/work2/filament/filament/backend/src/vulkan/VulkanDriver.cpp:1577
#2 0x000055555678a661 in filament::backend::invoke<filament::backend::VulkanDriver, void (char const*, unsigned int), filament::backend::VulkanDriver&, char const*, unsigned int>(void (filament::backend::VulkanDriver::*)(char const*, unsigned int), filament::backend::VulkanDriver&, char const*&&, unsigned int&&) (
m=(void (filament::backend::VulkanDriver::*)(filament::backend::VulkanDriver * const, const char *, unsigned int)) 0x555556765100 <filament::backend::VulkanDriver::pushGroupMarker(char const*, unsigned int)>, d=..., args=@0x7fffd3409130: 0, args=@0x7fffd3409130: 0) at /home/powei/work2/filament/filament/backend/include/private/backend/CommandStream.h:91
#3 0x000055555678a5a7 in filament::backend::trampoline<void (filament::backend::VulkanDriver::*)(char const*, unsigned int), filament::backend::VulkanDriver&, std::__1::tuple<char const*, unsigned int>, 0ul, 1ul> (m=@0x7fffbf7f5a10: (void (filament::backend::VulkanDriver::*)(filament::backend::VulkanDriver * const, const char *, unsigned int)) 0x555556765100 <filament::backend::VulkanDriver::pushGroupMarker(char const*, unsigned int)>,
d=..., t=...) at /home/powei/work2/filament/filament/backend/include/private/backend/CommandStream.h:96
#4 0x000055555678a507 in filament::backend::apply<void (filament::backend::VulkanDriver::*)(char const*, unsigned int), filament::backend::VulkanDriver&, std::__1::tuple<char const*, unsigned int> > (m=@0x7fffbf7f5a10: (void (filament::backend::VulkanDriver::*)(filament::backend::VulkanDriver * const, const char *, unsigned int)) 0x555556765100 <filament::backend::VulkanDriver::pushGroupMarker(char const*, unsigned int)>, d=..., t=...)
at /home/powei/work2/filament/filament/backend/include/private/backend/CommandStream.h:101
#5 0x00005555567650eb in filament::backend::CommandType<void (filament::backend::Driver::*)(char const*, unsigned int)>::Command<&filament::backend::Driver::pushGroupMarker>::execute<void (filament::backend::VulkanDriver::*)(char const*, unsigned int), filament::backend::VulkanDriver&> (
method=@0x7fffbf7f5a10: (void (filament::backend::VulkanDriver::*)(filament::backend::VulkanDriver * const, const char *, unsigned int)) 0x555556765100 <filament::backend::VulkanDriver::pushGroupMarker(char const*, unsigned int)>, driver=..., base=0x7fffd3409120, next=0x7fffbf7f5a58) at /home/powei/work2/filament/filament/backend/include/private/backend/CommandStream.h:141
#6 0x000055555675f784 in filament::backend::ConcreteDispatcher<filament::backend::VulkanDriver>::pushGroupMarker (driver=..., base=0x7fffd3409120, next=0x7fffbf7f5a58) at /home/powei/work2/filament/filament/backend/include/private/backend/DriverAPI.inc:431
#7 0x0000555556710535 in filament::backend::CommandBase::execute (this=0x7fffd3409120, driver=...) at /home/powei/work2/filament/filament/backend/include/private/backend/CommandStream.h:75
#8 0x0000555556710408 in filament::backend::CommandStream::execute(void*)::$_0::operator()() const (this=0x7fffbf7f5c78) at /home/powei/work2/filament/filament/backend/src/CommandStream.cpp:90
#9 0x00005555567103a5 in std::__1::__invoke<filament::backend::CommandStream::execute(void*)::$_0&>(filament::backend::CommandStream::execute(void*)::$_0&) (__f=...) at /usr/lib/llvm-14/bin/../include/c++/v1/type_traits:3640
#10 0x000055555671035d in std::__1::__invoke_void_return_wrapper<void, true>::__call<filament::backend::CommandStream::execute(void*)::$_0&>(filament::backend::CommandStream::execute(void*)::$_0&) (__args=...) at /usr/lib/llvm-14/bin/../include/c++/v1/__functional/invoke.h:61
#11 0x000055555671032d in std::__1::__function::__alloc_func<filament::backend::CommandStream::execute(void*)::$_0, std::__1::allocator<filament::backend::CommandStream::execute(void*)::$_0>, void ()>::operator()() (this=0x7fffbf7f5c78) at /usr/lib/llvm-14/bin/../include/c++/v1/__functional/function.h:180
#12 0x000055555670f449 in std::__1::__function::__func<filament::backend::CommandStream::execute(void*)::$_0, std::__1::allocator<filament::backend::CommandStream::execute(void*)::$_0>, void ()>::operator()() (this=0x7fffbf7f5c70) at /usr/lib/llvm-14/bin/../include/c++/v1/__functional/function.h:354
#13 0x00005555556c99b2 in std::__1::__function::__value_func<void ()>::operator()() const (this=0x7fffbf7f5c70) at /usr/lib/llvm-14/bin/../include/c++/v1/__functional/function.h:507
#14 0x00005555556c6065 in std::__1::function<void ()>::operator()() const (this=0x7fffbf7f5c70) at /usr/lib/llvm-14/bin/../include/c++/v1/__functional/function.h:1184
#15 0x0000555556710fc9 in filament::backend::Driver::execute(std::__1::function<void ()> const&) (this=0x7fffb0000b90, fn=...) at /home/powei/work2/filament/filament/backend/src/Driver.cpp:204
#16 0x000055555670ed69 in filament::backend::CommandStream::execute (this=0x555559164528, buffer=0x7fffd3408f80) at /home/powei/work2/filament/filament/backend/src/CommandStream.cpp:86
#17 0x00005555566327bb in filament::FEngine::execute (this=0x555559163aa0) at /home/powei/work2/filament/filament/src/details/Engine.cpp:1049
#18 0x000055555662f687 in filament::FEngine::loop (this=0x555559163aa0) at /home/powei/work2/filament/filament/src/details/Engine.cpp:645
#19 0x0000555556639509 in std::__1::__invoke<int (filament::FEngine::*)(), filament::FEngine*, , void>(int (filament::FEngine::*&&)(), filament::FEngine*&&) (__f=@0x5555592e7468: (int (filament::FEngine::*)(filament::FEngine * const)) 0x55555662f520 <filament::FEngine::loop()>, __a0=@0x5555592e7478: 0x555559163aa0) at /usr/lib/llvm-14/bin/../include/c++/v1/type_traits:3565
#20 0x000055555663944e in std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, int (filament::FEngine::*)(), filament::FEngine*, 2ul> (__t=...) at /usr/lib/llvm-14/bin/../include/c++/v1/thread:282
#21 0x0000555556638e02 in std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, int (filament::FEngine::*)(), filament::FEngine*> > (__vp=0x5555592e7460) at /usr/lib/llvm-14/bin/../include/c++/v1/thread:293
#22 0x00007ffff7c8784a in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#23 0x00007ffff7d0b2cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
where src/util/u_dynarray.h
is in mesa.
Still seeing this issue across multiple platforms (macOs and Android).
The issue here is that vkCmdEndDebugUtilsLabelEXT
expects that a label was "pushed" onto the command queue (as described in the spec). It is possible to push labels across command buffers, but the pushed label must still be in the queue (unexecuted) when End is called. This implies that we need to make sure the labels are in a good state (all popped) when vkQueueSubmit
is called.
Validation error looks like:
VULKAN ERROR: (VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912) Validation Error: [ VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912 ] Object 0: handle = 0x7fca9f4e2328, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x56146426 | vkCmdEndDebugUtilsLabelEXT() called without a corresponding vkCmdBeginDebugUtilsLabelEXT first The Vulkan spec states: There must be an outstanding vkCmdBeginDebugUtilsLabelEXT command prior to the vkCmdEndDebugUtilsLabelEXT on the queue that commandBuffer is submitted to (https://vulkan.lunarg.com/doc/view/1.3.243.0/mac/1.3-extensions/vkspec.html#VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912)
Describe the bug
bin/gltf_viewer
from the official releases page segfaults on launch for me on Linux, and also with a fresh build.https://github.com/google/filament/releases
To Reproduce Steps to reproduce the behavior:
filament-v1.28.0-linux.tgz
OR build from source according to the instructions.bin/gltf_viewer
(./out/cmake-release/samples/gltf_viewer
).Expected behavior The application
gltf_viewer
should run and not crash.Logs
Terminal:
GDB output and backtrace, if that helps?
Desktop (please complete the following information):
Additional context
Tested: Releases for 1.28, 1.27.2, 1.27.1, 1.26.0, and 1.28 sources.