Skip to content
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

sysgpu: vulkan Segmentation fault error prevents some examples from running on Wayland #1270

Open
joshua-holmes opened this issue Sep 18, 2024 · 2 comments
Labels
bug Something isn't working needs-triage Issues that need triaging

Comments

@joshua-holmes
Copy link
Contributor

Error message when running sprite example, although, the same error message occurs glyphs and hardware-check as well:

info(gamemode): gamemode: activated
info(mach): found Vulkan backend on Discrete GPU adapter: AMD Radeon RX 6900 XT (RADV NAVI21), Vulkan driver version 24.2.2

VUID-VkShaderModuleCreateInfo-pCode-08737(ERROR / SPEC): msgNum: -1520283006 - Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-08737 ] | MessageID = 0xa5625282 | vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error):
[VUID-StandaloneSpirv-OpTypeRuntimeArray-04680] Vulkan, OpTypeStruct containing an OpTypeRuntimeArray must be decorated with Block or BufferBlock.
  %_struct_12 = OpTypeStruct %_runtimearr_mat4v4float
. The Vulkan spec states: If pCode is a pointer to SPIR-V code, pCode must adhere to the validation rules described by the Validation Rules within a Module section of the SPIR-V Environment appendix (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-08737)
    Objects: 0
VUID-VkGraphicsPipelineCreateInfo-layout-07990(ERROR / SPEC): msgNum: -278545623 - Validation Error: [ VUID-VkGraphicsPipelineCreateInfo-layout-07990 ] Object 0: handle = 0x944a2c0000000039, type = VK_OBJECT_TYPE_SHADER_MODULE; Object 1: handle = 0x210d07000000003a, type = VK_OBJECT_TYPE_PIPELINE_LAYOUT; | MessageID = 0xef65bb29 | vkCreateGraphicsPipelines(): pCreateInfos[0].pStages[0] SPIR-V (VK_SHADER_STAGE_VERTEX_BIT) uses descriptor [Set 0, Binding 2, variable "sprite_uv_transforms"] of type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER but expected . The Vulkan spec states: If a resource variables is declared in a shader, and the descriptor type is not VK_DESCRIPTOR_TYPE_MUTABLE_EXT, a descriptor slot in layout must match the descriptor type (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-layout-07990)
    Objects: 2
        [0] 0x944a2c0000000039, type: 15, name: NULL
        [1] 0x210d07000000003a, type: 17, name: NULL
Segmentation fault at address 0x40
???:?:?: 0x719ed28fbc04 in ??? (libvulkan_radeon.so)
Unwind information for `libvulkan_radeon.so:0x719ed28fbc04` was not available, trace may be incomplete

???:?:?: 0x719ed28e2fc8 in ??? (libvulkan_radeon.so)
???:?:?: 0x719ed28e4c17 in ??? (libvulkan_radeon.so)
???:?:?: 0x719ed28e6567 in ??? (libvulkan_radeon.so)
???:?:?: 0x719ed28e72dd in ??? (libvulkan_radeon.so)
???:?:?: 0x719ed28e7678 in ??? (libvulkan_radeon.so)
???:?:?: 0x719ec6cc9c60 in ??? (libVkLayer_khronos_validation.so)
???:?:?: 0x719ec7021306 in ??? (libVkLayer_khronos_validation.so)
/home/josh/.cache/zig/p/1220d2b6789b71a94e692cb2f060bff4ffa4edfe196216cd573da68e74ab884eb34e/vk.zig:29220:67: 0x11fcaeb in createGraphicsPipelines (sprite)
            const result = self.dispatch.vkCreateGraphicsPipelines(
                                                                  ^
/home/josh/dev/open-source/mach/src/sysgpu/vulkan.zig:2245:44: 0x11fafc3 in init (sprite)
        _ = try vkd.createGraphicsPipelines(vk_device, .null_handle, 1, &[_]vk.GraphicsPipelineCreateInfo{.{
                                           ^
/home/josh/dev/open-source/mach/src/sysgpu/vulkan.zig:644:35: 0x11fcdb1 in createRenderPipeline (sprite)
        return RenderPipeline.init(device, desc);
                                  ^
/home/josh/dev/open-source/mach/src/sysgpu/main.zig:510:60: 0x120002a in buildPipeline (sprite)
        const render_pipeline = device.createRenderPipeline(descriptor) catch @panic("api error");
                                                           ^
/home/josh/dev/open-source/mach/src/gfx/SpritePipeline.zig:176:30: 0x1203fe1 in update (sprite)
            try buildPipeline(core, sprite_pipeline, pipeline_id, texture);
                             ^
/home/josh/dev/open-source/mach/src/module/module.zig:444:32: 0x121e762 in dispatchInternal__anon_13725 (sprite)
                .ErrorUnion => try @call(.auto, handler, args),
                               ^
/home/josh/dev/open-source/mach/src/module/module.zig:360:38: 0x12202e4 in dispatch (sprite)
            return m.dispatchInternal(stack_space, options, injectable);
                                     ^
/home/josh/dev/open-source/mach/examples/sprite/main.zig:24:27: 0x122042e in main (sprite)
    try mach.mods.dispatch(stack_space, .{});
                          ^
/home/josh/zig/0.13.0-dev.351+64ef45eb0/files/lib/std/start.zig:524:37: 0x122086e in main (sprite)
            const result = root.main() catch |err| {
                                    ^
???:?:?: 0x719ed4d4ae07 in ??? (libc.so.6)
???:?:?: 0x719ed4d4aecb in ??? (libc.so.6)
???:?:?: 0x116c464 in ??? (???)
Aborted (core dumped)
@joshua-holmes joshua-holmes added bug Something isn't working needs-triage Issues that need triaging labels Sep 18, 2024
@joshua-holmes joshua-holmes changed the title core: vulkan/sysgpu Segmentation fault error prevents some examples from running on Wayland sysgpu: vulkan Segmentation fault error prevents some examples from running on Wayland Sep 18, 2024
@RonaldZielaznicki
Copy link
Contributor

Would you mind checking if you can still run into this error after #1289?

@joshua-holmes
Copy link
Contributor Author

Seems I get an almost identical error (sprite):

info(gamemode): gamemode: activated
info(mach): found Vulkan backend on Discrete GPU adapter: AMD Radeon RX 6900 XT (RADV NAVI21), Vulkan driver version 24.2.5

VUID-VkShaderModuleCreateInfo-pCode-08737(ERROR / SPEC): msgNum: -1520283006 - Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-08737 ] | MessageID = 0xa5625282 | vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error):
[VUID-StandaloneSpirv-OpTypeRuntimeArray-04680] Vulkan, OpTypeStruct containing an OpTypeRuntimeArray must be decorated with Block or BufferBlock.
  %_struct_12 = OpTypeStruct %_runtimearr_mat4v4float
. The Vulkan spec states: If pCode is a pointer to SPIR-V code, pCode must adhere to the validation rules described by the Validation Rules within a Module section of the SPIR-V Environment appendix (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-08737)
    Objects: 0
VUID-VkGraphicsPipelineCreateInfo-layout-07990(ERROR / SPEC): msgNum: -278545623 - Validation Error: [ VUID-VkGraphicsPipelineCreateInfo-layout-07990 ] Object 0: handle = 0xab64de0000000020, type = VK_OBJECT_TYPE_SHADER_MODULE; Object 1: handle = 0xc4f3070000000021, type = VK_OBJECT_TYPE_PIPELINE_LAYOUT; | MessageID = 0xef65bb29 | vkCreateGraphicsPipelines(): pCreateInfos[0].pStages[0] SPIR-V (VK_SHADER_STAGE_VERTEX_BIT) uses descriptor [Set 0, Binding 2, variable "sprite_uv_transforms"] of type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER but expected . The Vulkan spec states: If a resource variables is declared in a shader, and the descriptor type is not VK_DESCRIPTOR_TYPE_MUTABLE_EXT, a descriptor slot in layout must match the descriptor type (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-layout-07990)
    Objects: 2
        [0] 0xab64de0000000020, type: 15, name: NULL
        [1] 0xc4f3070000000021, type: 17, name: NULL
Segmentation fault at address 0x40
???:?:?: 0x79fb154fbbc4 in ??? (libvulkan_radeon.so)
Unwind information for `libvulkan_radeon.so:0x79fb154fbbc4` was not available, trace may be incomplete

???:?:?: 0x79fb154e2f88 in ??? (libvulkan_radeon.so)
???:?:?: 0x79fb154e4bd7 in ??? (libvulkan_radeon.so)
???:?:?: 0x79fb154e6527 in ??? (libvulkan_radeon.so)
???:?:?: 0x79fb154e729d in ??? (libvulkan_radeon.so)
???:?:?: 0x79fb154e7638 in ??? (libvulkan_radeon.so)
???:?:?: 0x79fb098c9c60 in ??? (libVkLayer_khronos_validation.so)
???:?:?: 0x79fb09c21306 in ??? (libVkLayer_khronos_validation.so)
/home/josh/.cache/zig/p/1220d2b6789b71a94e692cb2f060bff4ffa4edfe196216cd573da68e74ab884eb34e/vk.zig:29220:67: 0x121248b in createGraphicsPipelines (sprite)
            const result = self.dispatch.vkCreateGraphicsPipelines(
                                                                  ^
/home/josh/dev/open-source/mach/src/sysgpu/vulkan.zig:2245:44: 0x1210963 in init (sprite)
        _ = try vkd.createGraphicsPipelines(vk_device, .null_handle, 1, &[_]vk.GraphicsPipelineCreateInfo{.{
                                           ^
/home/josh/dev/open-source/mach/src/sysgpu/vulkan.zig:644:35: 0x1212751 in createRenderPipeline (sprite)
        return RenderPipeline.init(device, desc);
                                  ^
/home/josh/dev/open-source/mach/src/sysgpu/main.zig:510:60: 0x12159ca in buildPipeline (sprite)
        const render_pipeline = device.createRenderPipeline(descriptor) catch @panic("api error");
                                                           ^
/home/josh/dev/open-source/mach/src/gfx/SpritePipeline.zig:176:30: 0x1219981 in update (sprite)
            try buildPipeline(core, sprite_pipeline, pipeline_id, texture);
                             ^
/home/josh/dev/open-source/mach/src/module/module.zig:444:32: 0x12371e2 in dispatchInternal__anon_21911 (sprite)
                .error_union => try @call(.auto, handler, args),
                               ^
/home/josh/dev/open-source/mach/src/module/module.zig:360:38: 0x1238d64 in dispatch (sprite)
            return m.dispatchInternal(stack_space, options, injectable);
                                     ^
/home/josh/dev/open-source/mach/examples/sprite/main.zig:24:27: 0x1238eae in main (sprite)
    try mach.mods.dispatch(stack_space, .{});
                          ^
/home/josh/zig/0.13.0-dev.351+64ef45eb0/files/lib/std/start.zig:524:37: 0x12392ee in main (sprite)
            const result = root.main() catch |err| {
                                    ^
???:?:?: 0x79fb17b29e07 in ??? (libc.so.6)
???:?:?: 0x79fb17b29ecb in ??? (libc.so.6)
???:?:?: 0x117a5d4 in ??? (???)
Aborted (core dumped)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issues that need triaging
Projects
None yet
Development

No branches or pull requests

2 participants