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

SIGSEGV while creating pipeline using Vulkan backend on Steam Deck #4600

Open
kpreid opened this issue Oct 28, 2023 · 6 comments
Open

SIGSEGV while creating pipeline using Vulkan backend on Steam Deck #4600

kpreid opened this issue Oct 28, 2023 · 6 comments
Labels
backend: vulkan Issues with Vulkan type: bug Something isn't working

Comments

@kpreid
Copy link
Contributor

kpreid commented Oct 28, 2023

Description
When running my wgpu application on the Steam Deck, using wgpu 0.18.0, it crashes with a segfault when attempting to create a pipeline. This crash is new, in that it does not happen with wgpu 0.17.1.

It can also be reproduced:

  • in my application with current wgpu trunk 43b74f9.
  • running the attached trace in the player with wgpu 0.18.0.
  • but not in the player with wgpu trunk.

So, apparently it is fixed or perturbed in that small period. (Perhaps a naga change improved the SPIR-V?)

So, I guess I'm asking for “please release v0.18.1” (note that this would have to be without the raw-window-handle update or with some kind of dual compatibility), but it'd also be nice to know whether this is an intentional or accidental fix.

Repro steps

Run this trace in the player … on a Steam Deck? Or maybe on any Linux driver_info: "Mesa 23.1.1 (git-fa55e3c026)", backend: Vulkan ?

Extra materials

Backtrace:

00:02:54 [DEBUG] (1) Adapter: AdapterInfo { name: "AMD Custom GPU 0405 (RADV VANGOGH)", vendor: 4098, device: 5695, device_type: IntegratedGpu, driver: "radv", driver_info: "Mesa 23.1.1 (git-fa55e3c026)", backend: Vulkan }

Thread 1 "all-is-cubes" received signal SIGSEGV, Segmentation fault.
0x00007ffff4eb78cc in radv_shader_spirv_to_nir () from /usr/lib/x86_64-linux-gnu/GL/default/lib/libvulkan_radeon.so
(gdb) bt

#0  0x00007ffff4eb78cc in radv_shader_spirv_to_nir ()
   from /usr/lib/x86_64-linux-gnu/GL/default/lib/libvulkan_radeon.so
#1  0x00007ffff4e8d0ee in radv
_graphics_pipeline_compile ()
   from /usr/lib/x86_64-linux-gnu/GL/default/lib/libvulkan_radeon.so
#2  0x00007ffff4e9150d in radv_graphics_pipeline_init ()
   from /usr/lib/x86_64-linux-gnu/GL/default/lib/libvulkan_radeon.so
#3  0x00007ffff4e943f0 in radv_graphics_pipeline_create ()
   from /usr/lib/x86_64-linux-gnu/GL/default/lib/libvulkan_radeon.so
#4  0x00007ffff4e946d8 in radv_CreateGraphicsPipelines ()
   from /usr/lib/x86_64-linux-gnu/GL/default/lib/libvulkan_radeon.so
#5  0x00007fffb56f15c9 in DispatchCreateGraphicsPipelines(VkDevice_T*, VkPipelineCache_T*, unsigned int, VkGraphicsPipelineCreateInfo const*, VkAllocationCallbacks const*, VkPipeline_T**) ()
   from /usr/lib/x86_64-linux-gnu/libVkLayer_khronos_validation.so
#6  0x00007fffb5661e64 in vulkan_layer_chassis::CreateGraphicsPipelines(VkDevice_T*, VkPipelineCache_T*, unsigned int, VkGraphicsPipelineCreateInfo const*, VkAllocationCallbacks const*, VkPipeline_T**) ()
   from /usr/lib/x86_64-linux-gnu/libVkLayer_khronos_validation.so
#7  0x0000555555c339e0 in ash::device::Device::create_graphics_pipelines (
    self=0x555557b9dfa0, pipeline_cache=..., create_infos=..., 
    allocation_callbacks=...)
    at /home/deck/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ash-0.37.3+1.3.251/src/device.rs:2132
#8  wgpu_hal::vulkan::device::{impl#4}::create_render_pipeline (
    self=0x555557983f10, desc=0x7ffffffdf250) at src/vulkan/device.rs:1782
#9  0x0000555555b00e5f in wgpu_core::device::resource::Device<wgpu_hal::vulkan::Api>::create_render_pipeline<wgpu_hal::vulkan::Api, wgpu_core::identity::IdentityManagerFactory> (self=0x555557983f10, self_id=..., 
    adapter=<optimized out>, desc=0x7ffffffdfed0, implicit_context=..., 
    hub=0x55555785c480, token=0x7ffffffdf8c8)
    at /home/deck/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-0.18.0/src/device/resource.rs:3119
#10 0x0000555555aab9df in wgpu_core::global::Global<wgpu_core::identity::IdentityManagerFactory>::device_create_render_pipeline<wgpu_core::identity::IdentityManagerFactory, wgpu_hal::vulkan::Api> (self=<optimized out>, 
    device_id=..., desc=0x7ffffffdfed0, id_in=<optimized out>, 
    implicit_pipeline_ids=...)
    at /home/deck/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-0.18.0/src/device/global.rs:1874
#11 0x0000555555b4a860 in wgpu::backend::direct::{impl#7}::device_create_render_pipeline (self=0x55555785c370, device=<optimized out>, 
    device_data=0x5555578b2140, desc=0x7ffffffe0348)
    at src/backend/direct.rs:1210
#12 0x0000555555b55e72 in wgpu::context::{impl#5}::device_create_render_pipeline<wgpu::backend::direct::Context> (self=0x55555785c370, 
    device=<optimized out>, device_data=..., desc=0x7ffffffe0348)
    at src/context.rs:2334
#13 0x0000555555a6faf1 in wgpu::Device::create_render_pipeline (
    self=<optimized out>, desc=0x555557df7100) at src/lib.rs:2552
#14 0x0000555555a5cd5a in all_is_cubes_gpu::in_wgpu::postprocess::create_postprocess_pipeline (device=0x555557986e30, 
    postprocess_bind_group_layout=<optimized out>, surface_format=...)
    at all-is-cubes-gpu/src/in_wgpu/postprocess.rs:98

Platform

  • wgpu 0.18.0
  • Steam Deck / SteamOS, desktop mode
@kpreid
Copy link
Contributor Author

kpreid commented Oct 28, 2023

P.S. I will be attempting to test my actual application with wgpu trunk, but that will require dealing with winit API changes, so I decided not to block on that.

@cwfitzgerald
Copy link
Member

Nothing should have changed functionally between trunk and now, nothing of external substance has landed since the release

@kpreid
Copy link
Contributor Author

kpreid commented Oct 28, 2023

Good/bad news: after running my real code with trunk it still segfaults. So, it's not mysteriously fixed, it's just flaky / the player not segfaulting was coincidental. Oh, and I see I forgot to mention: this crash does not happen with wgpu 0.17.1.

@cwfitzgerald
Copy link
Member

Delightful!

@cwfitzgerald
Copy link
Member

Can you get the validation layers on the machine if you don't have them already?

@kpreid
Copy link
Contributor Author

kpreid commented Oct 28, 2023

I don't know how to set that up; I have never interacted with Vulkan in any way but using wgpu. (Perhaps this would be a topic better suited for chat, but in any case it's too late today.)

@teoxoy teoxoy added type: bug Something isn't working backend: vulkan Issues with Vulkan labels Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: vulkan Issues with Vulkan type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants