Vulkan breaks with *** stack smashing detected ***: terminated

Hi all!

We are trying to get Vulkan to run to enable the commercially available HDR10 on our Linux (Ubuntu 24.04 LTS) computer. We got to a point now where Psychtoolbox thinks that our system should enable HDR/vulkan, i.e. PsychHRD(‘Supported’) gives us a 1 and the devices list the graphics card with drivers. Unfortunately, the step of opening the window leads to a stack smashing detected error and octave or MATLAB dies completely. If I do not open Vulkan, i.e. do not add the HDR task to PsychImaging, I can open windows on screen in 8bit mode fine and everything looks as we would expect from psychtoolbox.

This happens with the last couple of different amdvlk versions under both MATLAB and octave.

Has anyone seen this kind of error before? Any help would be welcome.

best
Heiko

As surrounding information: This is the startup output from psychtoolbox without HDR:

PTB-INFO: This is Psychtoolbox-3 for GNU/Linux X11, under Matlab 64-Bit (Version 3.0.19 - Build date: Jun 22 2024).
PTB-INFO: OS support status: Linux 6.8.0-45-lowlatency Supported.
PTB-INFO: Type 'PsychtoolboxVersion' for more detailed version information.
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with
PTB-INFO: some restrictions. See file 'License.txt' in the Psychtoolbox root folder for the exact licensing conditions.

PTB-INFO: Trying to enable at least 10 bpc fixed point framebuffer.
PTB-INFO: Linux native 10 bit per color framebuffer requested, and the OS claims it is working fine. Good.

PTB-INFO: Real (OS native, queried) color resolution of the GPU framebuffer is 10 bits per RGB color component.
PTB-INFO: OpenGL-Renderer is AMD :: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.57, 6.8.0-45-lowlatency) :: 4.6 (Compatibility Profile) Mesa 24.0.9-0ubuntu0.1
PTB-INFO: VBL startline = 2160 , VBL Endline = -1
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.666822 ms [59.999439 Hz]. (50 valid samples taken, stddev=0.000431 ms.)

PTB-INFO: Reported monitor refresh interval from operating system = 16.666667 ms [60.000000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.

PTB-INFO: Psychtoolbox imaging pipeline starting up for window with requested imagingmode 5121 ...
PTB-INFO: Will use 32 bits per color component floating point framebuffer for stimulus drawing. Alpha blending should work correctly.
PTB-INFO: Will use 32 bits per color component floating point framebuffer for stimulus post-processing (if any).

And here is the error message at maximum debug level once I enable HDR in PsychImaging:

PsychVulkanCore-INFO: At startup there are 23 Vulkan instance extensions available.
PsychVulkanCore-INFO: 0. instance extension is 'VK_KHR_device_group_creation'.
PsychVulkanCore-INFO: 1. instance extension is 'VK_KHR_display'.
PsychVulkanCore-INFO: 2. instance extension is 'VK_KHR_external_fence_capabilities'.
PsychVulkanCore-INFO: 3. instance extension is 'VK_KHR_external_memory_capabilities'.
PsychVulkanCore-INFO: 4. instance extension is 'VK_KHR_external_semaphore_capabilities'.
PsychVulkanCore-INFO: 5. instance extension is 'VK_KHR_get_display_properties2'.
PsychVulkanCore-INFO: 6. instance extension is 'VK_KHR_get_physical_device_properties2'.
PsychVulkanCore-INFO: 7. instance extension is 'VK_KHR_get_surface_capabilities2'.
PsychVulkanCore-INFO: 8. instance extension is 'VK_KHR_surface'.
PsychVulkanCore-INFO: 9. instance extension is 'VK_KHR_wayland_surface'.
PsychVulkanCore-INFO: 10. instance extension is 'VK_KHR_xcb_surface'.
PsychVulkanCore-INFO: 11. instance extension is 'VK_KHR_xlib_surface'.
PsychVulkanCore-INFO: 12. instance extension is 'VK_EXT_acquire_xlib_display'.
PsychVulkanCore-INFO: 13. instance extension is 'VK_EXT_debug_report'.
PsychVulkanCore-INFO: 14. instance extension is 'VK_EXT_debug_utils'.
PsychVulkanCore-INFO: 15. instance extension is 'VK_EXT_direct_mode_display'.
PsychVulkanCore-INFO: 16. instance extension is 'VK_EXT_display_surface_counter'.
PsychVulkanCore-INFO: 17. instance extension is 'VK_KHR_surface_protected_capabilities'.
PsychVulkanCore-INFO: 18. instance extension is 'VK_EXT_acquire_drm_display'.
PsychVulkanCore-INFO: 19. instance extension is 'VK_EXT_surface_maintenance1'.
PsychVulkanCore-INFO: 20. instance extension is 'VK_EXT_swapchain_colorspace'.
PsychVulkanCore-INFO: 21. instance extension is 'VK_KHR_portability_enumeration'.
PsychVulkanCore-INFO: 22. instance extension is 'VK_LUNARG_direct_driver_loading'.
PsychVulkanCore-INFO: Found and enabled 0. instance extension 'VK_KHR_surface'.
PsychVulkanCore-INFO: Found and enabled 1. instance extension 'VK_KHR_get_surface_capabilities2'.
PsychVulkanCore-INFO: Found and enabled 2. instance extension 'VK_KHR_external_memory_capabilities'.
PsychVulkanCore-INFO: Found and enabled 3. instance extension 'VK_KHR_external_semaphore_capabilities'.
PsychVulkanCore-INFO: Found and enabled 4. instance extension 'VK_KHR_get_physical_device_properties2'.
PsychVulkanCore-INFO: Found and enabled 5. instance extension 'VK_EXT_debug_utils'.
PsychVulkanCore-INFO: Found and enabled 6. instance extension 'VK_KHR_xlib_surface'.
PsychVulkanCore-INFO: Found and enabled 7. instance extension 'VK_EXT_acquire_xlib_display'.
PsychVulkanCore-INFO: Found and enabled 8. instance extension 'VK_KHR_display'.
PsychVulkanCore-INFO: Found and enabled 9. instance extension 'VK_EXT_direct_mode_display'.
PsychVulkanCore-INFO: Found and enabled 10. instance extension 'VK_EXT_swapchain_colorspace'.
PsychVulkanCore-INFO: Vulkan instance (version 1.3.275) created.
PsychVulkanCore-INFO: At startup there are 2 Vulkan devices available.
PsychVulkanCore-INFO: GPU 0: 'AMD Radeon RX 6750 XT' : Vulkan 1.3.293 : VendorId 0x1002 : DeviceId 0x73df : Discrete graphics card.
PsychVulkanCore-INFO: GPU 0: Driver 'AMD open-source driver' [2024.Q3.2 (LLPC)] : Driver version 0x80013e
PsychVulkanCore-INFO: GPU 0: Probing the following 178 device extensions against required set.
PsychVulkanCore-INFO: 0. device extension is 'VK_KHR_16bit_storage'.
PsychVulkanCore-INFO: 1. device extension is 'VK_KHR_8bit_storage'.
PsychVulkanCore-INFO: 2. device extension is 'VK_KHR_acceleration_structure'.
PsychVulkanCore-INFO: 3. device extension is 'VK_KHR_bind_memory2'.
PsychVulkanCore-INFO: 4. device extension is 'VK_KHR_buffer_device_address'.
PsychVulkanCore-INFO: 5. device extension is 'VK_KHR_calibrated_timestamps'.
PsychVulkanCore-INFO: 6. device extension is 'VK_KHR_cooperative_matrix'.
PsychVulkanCore-INFO: 7. device extension is 'VK_KHR_copy_commands2'.
PsychVulkanCore-INFO: 8. device extension is 'VK_KHR_create_renderpass2'.
PsychVulkanCore-INFO: 9. device extension is 'VK_KHR_dedicated_allocation'.
PsychVulkanCore-INFO: 10. device extension is 'VK_KHR_deferred_host_operations'.
PsychVulkanCore-INFO: 11. device extension is 'VK_KHR_depth_stencil_resolve'.
PsychVulkanCore-INFO: 12. device extension is 'VK_KHR_descriptor_update_template'.
PsychVulkanCore-INFO: 13. device extension is 'VK_KHR_device_group'.
PsychVulkanCore-INFO: 14. device extension is 'VK_KHR_draw_indirect_count'.
PsychVulkanCore-INFO: 15. device extension is 'VK_KHR_driver_properties'.
PsychVulkanCore-INFO: 16. device extension is 'VK_KHR_dynamic_rendering'.
PsychVulkanCore-INFO: 17. device extension is 'VK_KHR_dynamic_rendering_local_read'.
PsychVulkanCore-INFO: 18. device extension is 'VK_KHR_external_fence'.
PsychVulkanCore-INFO: 19. device extension is 'VK_KHR_external_fence_fd'.
PsychVulkanCore-INFO: 20. device extension is 'VK_KHR_external_memory'.
PsychVulkanCore-INFO: 21. device extension is 'VK_KHR_external_memory_fd'.
PsychVulkanCore-INFO: 22. device extension is 'VK_KHR_external_semaphore'.
PsychVulkanCore-INFO: 23. device extension is 'VK_KHR_external_semaphore_fd'.
PsychVulkanCore-INFO: 24. device extension is 'VK_KHR_format_feature_flags2'.
PsychVulkanCore-INFO: 25. device extension is 'VK_KHR_fragment_shader_barycentric'.
PsychVulkanCore-INFO: 26. device extension is 'VK_KHR_fragment_shading_rate'.
PsychVulkanCore-INFO: 27. device extension is 'VK_KHR_get_memory_requirements2'.
PsychVulkanCore-INFO: 28. device extension is 'VK_KHR_global_priority'.
PsychVulkanCore-INFO: 29. device extension is 'VK_KHR_imageless_framebuffer'.
PsychVulkanCore-INFO: 30. device extension is 'VK_KHR_image_format_list'.
PsychVulkanCore-INFO: 31. device extension is 'VK_KHR_index_type_uint8'.
PsychVulkanCore-INFO: 32. device extension is 'VK_KHR_line_rasterization'.
PsychVulkanCore-INFO: 33. device extension is 'VK_KHR_load_store_op_none'.
PsychVulkanCore-INFO: 34. device extension is 'VK_KHR_maintenance1'.
PsychVulkanCore-INFO: 35. device extension is 'VK_KHR_maintenance2'.
PsychVulkanCore-INFO: 36. device extension is 'VK_KHR_maintenance3'.
PsychVulkanCore-INFO: 37. device extension is 'VK_KHR_maintenance4'.
PsychVulkanCore-INFO: 38. device extension is 'VK_KHR_maintenance5'.
PsychVulkanCore-INFO: 39. device extension is 'VK_KHR_maintenance6'.
PsychVulkanCore-INFO: 40. device extension is 'VK_KHR_maintenance7'.
PsychVulkanCore-INFO: 41. device extension is 'VK_KHR_map_memory2'.
PsychVulkanCore-INFO: 42. device extension is 'VK_KHR_multiview'.
PsychVulkanCore-INFO: 43. device extension is 'VK_KHR_pipeline_executable_properties'.
PsychVulkanCore-INFO: 44. device extension is 'VK_KHR_pipeline_library'.
PsychVulkanCore-INFO: 45. device extension is 'VK_KHR_push_descriptor'.
PsychVulkanCore-INFO: 46. device extension is 'VK_KHR_ray_query'.
PsychVulkanCore-INFO: 47. device extension is 'VK_KHR_ray_tracing_maintenance1'.
PsychVulkanCore-INFO: 48. device extension is 'VK_KHR_ray_tracing_pipeline'.
PsychVulkanCore-INFO: 49. device extension is 'VK_KHR_ray_tracing_position_fetch'.
PsychVulkanCore-INFO: 50. device extension is 'VK_KHR_relaxed_block_layout'.
PsychVulkanCore-INFO: 51. device extension is 'VK_KHR_sampler_mirror_clamp_to_edge'.
PsychVulkanCore-INFO: 52. device extension is 'VK_KHR_sampler_ycbcr_conversion'.
PsychVulkanCore-INFO: 53. device extension is 'VK_KHR_separate_depth_stencil_layouts'.
PsychVulkanCore-INFO: 54. device extension is 'VK_KHR_shader_atomic_int64'.
PsychVulkanCore-INFO: 55. device extension is 'VK_KHR_shader_clock'.
PsychVulkanCore-INFO: 56. device extension is 'VK_KHR_shader_draw_parameters'.
PsychVulkanCore-INFO: 57. device extension is 'VK_KHR_shader_expect_assume'.
PsychVulkanCore-INFO: 58. device extension is 'VK_KHR_shader_float16_int8'.
PsychVulkanCore-INFO: 59. device extension is 'VK_KHR_shader_float_controls'.
PsychVulkanCore-INFO: 60. device extension is 'VK_KHR_shader_float_controls2'.
PsychVulkanCore-INFO: 61. device extension is 'VK_KHR_shader_integer_dot_product'.
PsychVulkanCore-INFO: 62. device extension is 'VK_KHR_shader_maximal_reconvergence'.
PsychVulkanCore-INFO: 63. device extension is 'VK_KHR_shader_non_semantic_info'.
PsychVulkanCore-INFO: 64. device extension is 'VK_KHR_shader_quad_control'.
PsychVulkanCore-INFO: 65. device extension is 'VK_KHR_shader_subgroup_extended_types'.
PsychVulkanCore-INFO: 66. device extension is 'VK_KHR_shader_subgroup_rotate'.
PsychVulkanCore-INFO: 67. device extension is 'VK_KHR_shader_subgroup_uniform_control_flow'.
PsychVulkanCore-INFO: 68. device extension is 'VK_KHR_shader_terminate_invocation'.
PsychVulkanCore-INFO: 69. device extension is 'VK_KHR_spirv_1_4'.
PsychVulkanCore-INFO: 70. device extension is 'VK_KHR_storage_buffer_storage_class'.
PsychVulkanCore-INFO: 71. device extension is 'VK_KHR_swapchain'.
PsychVulkanCore-INFO: 72. device extension is 'VK_KHR_swapchain_mutable_format'.
PsychVulkanCore-INFO: 73. device extension is 'VK_KHR_synchronization2'.
PsychVulkanCore-INFO: 74. device extension is 'VK_KHR_timeline_semaphore'.
PsychVulkanCore-INFO: 75. device extension is 'VK_KHR_uniform_buffer_standard_layout'.
PsychVulkanCore-INFO: 76. device extension is 'VK_KHR_variable_pointers'.
PsychVulkanCore-INFO: 77. device extension is 'VK_KHR_vertex_attribute_divisor'.
PsychVulkanCore-INFO: 78. device extension is 'VK_KHR_vulkan_memory_model'.
PsychVulkanCore-INFO: 79. device extension is 'VK_KHR_workgroup_memory_explicit_layout'.
PsychVulkanCore-INFO: 80. device extension is 'VK_KHR_zero_initialize_workgroup_memory'.
PsychVulkanCore-INFO: 81. device extension is 'VK_EXT_4444_formats'.
PsychVulkanCore-INFO: 82. device extension is 'VK_EXT_attachment_feedback_loop_layout'.
PsychVulkanCore-INFO: 83. device extension is 'VK_EXT_border_color_swizzle'.
PsychVulkanCore-INFO: 84. device extension is 'VK_EXT_calibrated_timestamps'.
PsychVulkanCore-INFO: 85. device extension is 'VK_EXT_color_write_enable'.
PsychVulkanCore-INFO: 86. device extension is 'VK_EXT_conditional_rendering'.
PsychVulkanCore-INFO: 87. device extension is 'VK_EXT_conservative_rasterization'.
PsychVulkanCore-INFO: 88. device extension is 'VK_EXT_custom_border_color'.
PsychVulkanCore-INFO: 89. device extension is 'VK_EXT_depth_clamp_zero_one'.
PsychVulkanCore-INFO: 90. device extension is 'VK_EXT_depth_clip_control'.
PsychVulkanCore-INFO: 91. device extension is 'VK_EXT_depth_clip_enable'.
PsychVulkanCore-INFO: 92. device extension is 'VK_EXT_depth_range_unrestricted'.
PsychVulkanCore-INFO: 93. device extension is 'VK_EXT_descriptor_buffer'.
PsychVulkanCore-INFO: 94. device extension is 'VK_EXT_descriptor_indexing'.
PsychVulkanCore-INFO: 95. device extension is 'VK_EXT_device_address_binding_report'.
PsychVulkanCore-INFO: 96. device extension is 'VK_EXT_device_fault'.
PsychVulkanCore-INFO: 97. device extension is 'VK_EXT_dynamic_rendering_unused_attachments'.
PsychVulkanCore-INFO: 98. device extension is 'VK_EXT_extended_dynamic_state'.
PsychVulkanCore-INFO: 99. device extension is 'VK_EXT_extended_dynamic_state2'.
PsychVulkanCore-INFO: 100. device extension is 'VK_EXT_extended_dynamic_state3'.
PsychVulkanCore-INFO: 101. device extension is 'VK_EXT_external_memory_dma_buf'.
PsychVulkanCore-INFO: 102. device extension is 'VK_EXT_external_memory_host'.
PsychVulkanCore-INFO: 103. device extension is 'VK_EXT_frame_boundary'.
PsychVulkanCore-INFO: 104. device extension is 'VK_EXT_global_priority'.
PsychVulkanCore-INFO: 105. device extension is 'VK_EXT_global_priority_query'.
PsychVulkanCore-INFO: 106. device extension is 'VK_EXT_graphics_pipeline_library'.
PsychVulkanCore-INFO: 107. device extension is 'VK_EXT_hdr_metadata'.
PsychVulkanCore-INFO: 108. device extension is 'VK_EXT_host_query_reset'.
PsychVulkanCore-INFO: 109. device extension is 'VK_EXT_image_drm_format_modifier'.
PsychVulkanCore-INFO: 110. device extension is 'VK_EXT_image_robustness'.
PsychVulkanCore-INFO: 111. device extension is 'VK_EXT_image_sliced_view_of_3d'.
PsychVulkanCore-INFO: 112. device extension is 'VK_EXT_image_view_min_lod'.
PsychVulkanCore-INFO: 113. device extension is 'VK_EXT_index_type_uint8'.
PsychVulkanCore-INFO: 114. device extension is 'VK_EXT_inline_uniform_block'.
PsychVulkanCore-INFO: 115. device extension is 'VK_EXT_line_rasterization'.
PsychVulkanCore-INFO: 116. device extension is 'VK_EXT_load_store_op_none'.
PsychVulkanCore-INFO: 117. device extension is 'VK_EXT_memory_budget'.
PsychVulkanCore-INFO: 118. device extension is 'VK_EXT_memory_priority'.
PsychVulkanCore-INFO: 119. device extension is 'VK_EXT_mesh_shader'.
PsychVulkanCore-INFO: 120. device extension is 'VK_EXT_mutable_descriptor_type'.
PsychVulkanCore-INFO: 121. device extension is 'VK_EXT_nested_command_buffer'.
PsychVulkanCore-INFO: 122. device extension is 'VK_EXT_non_seamless_cube_map'.
PsychVulkanCore-INFO: 123. device extension is 'VK_EXT_pageable_device_local_memory'.
PsychVulkanCore-INFO: 124. device extension is 'VK_EXT_pci_bus_info'.
PsychVulkanCore-INFO: 125. device extension is 'VK_EXT_physical_device_drm'.
PsychVulkanCore-INFO: 126. device extension is 'VK_EXT_pipeline_creation_cache_control'.
PsychVulkanCore-INFO: 127. device extension is 'VK_EXT_pipeline_creation_feedback'.
PsychVulkanCore-INFO: 128. device extension is 'VK_EXT_pipeline_library_group_handles'.
PsychVulkanCore-INFO: 129. device extension is 'VK_EXT_post_depth_coverage'.
PsychVulkanCore-INFO: 130. device extension is 'VK_EXT_primitive_topology_list_restart'.
PsychVulkanCore-INFO: 131. device extension is 'VK_EXT_private_data'.
PsychVulkanCore-INFO: 132. device extension is 'VK_EXT_provoking_vertex'.
PsychVulkanCore-INFO: 133. device extension is 'VK_EXT_queue_family_foreign'.
PsychVulkanCore-INFO: 134. device extension is 'VK_EXT_robustness2'.
PsychVulkanCore-INFO: 135. device extension is 'VK_EXT_sampler_filter_minmax'.
PsychVulkanCore-INFO: 136. device extension is 'VK_EXT_sample_locations'.
PsychVulkanCore-INFO: 137. device extension is 'VK_EXT_scalar_block_layout'.
PsychVulkanCore-INFO: 138. device extension is 'VK_EXT_separate_stencil_usage'.
PsychVulkanCore-INFO: 139. device extension is 'VK_EXT_shader_atomic_float'.
PsychVulkanCore-INFO: 140. device extension is 'VK_EXT_shader_atomic_float2'.
PsychVulkanCore-INFO: 141. device extension is 'VK_EXT_shader_demote_to_helper_invocation'.
PsychVulkanCore-INFO: 142. device extension is 'VK_EXT_shader_image_atomic_int64'.
PsychVulkanCore-INFO: 143. device extension is 'VK_EXT_shader_module_identifier'.
PsychVulkanCore-INFO: 144. device extension is 'VK_EXT_shader_stencil_export'.
PsychVulkanCore-INFO: 145. device extension is 'VK_EXT_shader_subgroup_ballot'.
PsychVulkanCore-INFO: 146. device extension is 'VK_EXT_shader_subgroup_vote'.
PsychVulkanCore-INFO: 147. device extension is 'VK_EXT_shader_viewport_index_layer'.
PsychVulkanCore-INFO: 148. device extension is 'VK_EXT_subgroup_size_control'.
PsychVulkanCore-INFO: 149. device extension is 'VK_EXT_texel_buffer_alignment'.
PsychVulkanCore-INFO: 150. device extension is 'VK_EXT_tooling_info'.
PsychVulkanCore-INFO: 151. device extension is 'VK_EXT_transform_feedback'.
PsychVulkanCore-INFO: 152. device extension is 'VK_EXT_vertex_attribute_divisor'.
PsychVulkanCore-INFO: 153. device extension is 'VK_EXT_vertex_input_dynamic_state'.
PsychVulkanCore-INFO: 154. device extension is 'VK_EXT_ycbcr_image_arrays'.
PsychVulkanCore-INFO: 155. device extension is 'VK_AMD_buffer_marker'.
PsychVulkanCore-INFO: 156. device extension is 'VK_AMD_device_coherent_memory'.
PsychVulkanCore-INFO: 157. device extension is 'VK_AMD_draw_indirect_count'.
PsychVulkanCore-INFO: 158. device extension is 'VK_AMD_gcn_shader'.
PsychVulkanCore-INFO: 159. device extension is 'VK_AMD_gpa_interface'.
PsychVulkanCore-INFO: 160. device extension is 'VK_AMD_gpu_shader_half_float'.
PsychVulkanCore-INFO: 161. device extension is 'VK_AMD_gpu_shader_int16'.
PsychVulkanCore-INFO: 162. device extension is 'VK_AMD_memory_overallocation_behavior'.
PsychVulkanCore-INFO: 163. device extension is 'VK_AMD_mixed_attachment_samples'.
PsychVulkanCore-INFO: 164. device extension is 'VK_AMD_shader_ballot'.
PsychVulkanCore-INFO: 165. device extension is 'VK_AMD_shader_core_properties'.
PsychVulkanCore-INFO: 166. device extension is 'VK_AMD_shader_core_properties2'.
PsychVulkanCore-INFO: 167. device extension is 'VK_AMD_shader_early_and_late_fragment_tests'.
PsychVulkanCore-INFO: 168. device extension is 'VK_AMD_shader_explicit_vertex_parameter'.
PsychVulkanCore-INFO: 169. device extension is 'VK_AMD_shader_fragment_mask'.
PsychVulkanCore-INFO: 170. device extension is 'VK_AMD_shader_image_load_store_lod'.
PsychVulkanCore-INFO: 171. device extension is 'VK_AMD_shader_info'.
PsychVulkanCore-INFO: 172. device extension is 'VK_AMD_shader_trinary_minmax'.
PsychVulkanCore-INFO: 173. device extension is 'VK_AMD_texture_gather_bias_lod'.
PsychVulkanCore-INFO: 174. device extension is 'VK_GOOGLE_decorate_string'.
PsychVulkanCore-INFO: 175. device extension is 'VK_GOOGLE_hlsl_functionality1'.
PsychVulkanCore-INFO: 176. device extension is 'VK_GOOGLE_user_type'.
PsychVulkanCore-INFO: 177. device extension is 'VK_VALVE_mutable_descriptor_type'.
PsychVulkanCore-INFO: Found and enabled 0. device extension 'VK_KHR_swapchain'.
PsychVulkanCore-INFO: Found and enabled 1. device extension 'VK_KHR_external_memory'.
PsychVulkanCore-INFO: Found and enabled 2. device extension 'VK_KHR_external_semaphore'.
PsychVulkanCore-INFO: Found and enabled 3. device extension 'VK_KHR_maintenance1'.
PsychVulkanCore-INFO: Found and enabled 4. device extension 'VK_KHR_external_memory_fd'.
PsychVulkanCore-INFO: Found and enabled 5. device extension 'VK_KHR_external_semaphore_fd'.
PsychVulkanCore-INFO: Found and enabled 6. device extension 'VK_EXT_hdr_metadata'.
PsychVulkanCore-INFO: Device extension 'VK_AMD_display_native_hdr' is not supported.
PsychVulkanCore-INFO: Device extension 'VK_GOOGLE_display_timing' is not supported.
PsychVulkanCore-INFO: Device extension 'VK_KHR_present_wait' is not supported.
PsychVulkanCore-INFO: Device extension 'VK_KHR_present_id' is not supported.
PsychVulkanCore-INFO: GPU 0: ACCEPTED AND ACTIVATED! Count now 1
PsychVulkanCore-INFO: GPU 1: 'Intel(R) Graphics (RPL-S)' : Vulkan 1.3.274 : VendorId 0x8086 : DeviceId 0xa780 : Integrated graphics chip.
PsychVulkanCore-INFO: GPU 1: Driver 'Intel open-source Mesa driver' [Mesa 24.0.9-0ubuntu0.1] : Driver version 0x6000009
PsychVulkanCore-INFO: GPU 1: Probing the following 145 device extensions against required set
...
PsychVulkanCore-INFO: GPU 1: ACCEPTED AND ACTIVATED! Count now 2
PsychVulkan-INFO: Positioning onscreen window at rect [0, 0, 3840, 2160] to align with display output 0 [HDMI-A-4] of screen 1.


PTB-INFO: This is Psychtoolbox-3 for GNU/Linux X11, under GNU/Octave 64-Bit (Version 3.0.19 - Build date: Jun 22 2024).
PTB-INFO: OS support status: Linux 6.8.0-45-lowlatency Supported.
PTB-INFO: Type 'PsychtoolboxVersion' for more detailed version information.
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with
PTB-INFO: some restrictions. See file 'License.txt' in the Psychtoolbox root folder for the exact licensing conditions.

PTB-INFO: For information about paid support, support memberships and other commercial services, please type
PTB-INFO: 'PsychPaidSupportAndServices'.

PTB-INFO: Trying to enable at least 10 bpc fixed point framebuffer.
PTB-INFO: Linux native 10 bit per color framebuffer requested, and the OS claims it is working fine. Good.
PTB-INFO: Real (OS native, queried) color resolution of the GPU framebuffer is 10 bits per RGB color component.
PTB-INFO: External display method is in use for this window. Running short and lenient timing tests only.


PTB-INFO: OpenGL-Renderer is AMD :: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.57, 6.8.0-45-lowlatency) :: 4.6 (Compatibility Profile) Mesa 24.0.9-0ubuntu0.1
PTB-INFO: VBL startline = 2160 , VBL Endline = -1
PTB-INFO: Will try to use OS-Builtin OpenML sync control support for accurate Flip timestamping.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.666818 ms [59.999456 Hz]. (50 valid samples taken, stddev=0.000401 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.666667 ms [60.000000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.
PTB-INFO: Using usercode override framebuffer rect [0, 0, 3840, 2160] for image processing.
PTB-INFO: Psychtoolbox imaging pipeline starting up for window with requested imagingmode 17830917 ...
PTB-INFO: Will use 32 bits per color component floating point framebuffer for stimulus drawing. Alpha blending should work correctly.
PTB-INFO: Will use 32 bits per color component floating point framebuffer for stimulus post-processing (if any).
PTB-INFO: Full processing needed for redirected output mode.
PTB-INFO: This is a HDR display window: Applying higher precision and suitable range scaling for textures and movie video frames.
Building a fragment shader:Reading shader from file /home/labuser/Psychtoolbox/PsychOpenGL/PsychGLSLShaders/ICMPassThroughShader.frag.txt ...
PsychVulkan-INFO: Positioning onscreen window at rect [0, 0, 3840, 2160] to align with display output 0 [HDMI-A-4] of screen 1.
PsychVulkan-INFO: Loaded identity gamma table into output for HDR.
PsychVulkanCore-INFO: gpu [AMD Radeon RX 6750 XT] has access to target display 0x7546e0fddfe8. Trying to switch to direct display mode...
PsychVulkanCore-INFO: gpu [AMD Radeon RX 6750 XT] display 0x7546e0fddfe8 switched to direct display mode. Setting up for direct display surface.
*** stack smashing detected ***: terminated
fatal: caught signal Aborted -- stopping myself...
Aborted (core dumped)

As chance has it, I tested HDR support yesterday for the first time on Ubuntu 24.04.1-LTS, with an older year 2017’ish Polaris AMD gpu and suitable amdvlk Vulkan driver. Turned out there is a deficiency or bug in Ubuntu 24.04-LTS Mesa 24 OpenGL driver implementation, which causes bad failure of all things Vulkan on at least AMD and Intel and RaspberryPi graphics, probably others → A complete hang of Matlab/Octave, requiring to kill it to recover! I already developed and successfully tested a workaround for this for a future PTB release. With this, Vulkan works just fine again as tested on at least RaspberryPi, AMD and Intel with both KDE and Ubuntu/GNOME desktop GUI, single and multi-display.

However, the specific place your script seems to crash Matlab/Octave, and the fact that it crashes with stack smashing suggests your problem is a different problem, and not a general one for Ubuntu 24.04-LTS. Possibly specific to your gpu model and/or the amdvlk driver versions used. For reference, the latest amdvlk release I successfully tested with Vulkan and HDR (on Ubuntu 22.04.5-LTS with an AMD RavenRidge Vega integrated gpu from the year early 2018), was amdvlk release 2023-Q3.3 from September 2023. I can’t upgrade to any more recent releases, because the amdvlk driver team decided to cut support for all AMD hardware with Vega graphics or older, and thereby all hardware I own, in more recent driver releases. That release would probably also work for you gpu, although later releases are supposed to bring improvements in performance/functionality/quality etc.

Apart from your specific problem, if you need the new Psychtoolbox mex files to fix that other show-stopper bug for Ubuntu 24.04-LTS anytime soon, or any further assistance, or simply appreciate the work time I already put into your issue, please post your paid support authentication token → help PsychPaidSupportAndServices

Best,
-mario

Hi Mario,

thank you for that info already! I will try the amdvlk version that worked for you earlier as well and am looking forward to that update. As Vulkan works at least for some configurations, I do have some hope that we can get it to work without super deep interventions, i.e. just getting a good combinations of software versions.

I do have a support key we bought last year, see below.

best
Heiko

========================================================================================

U6MK5FM5-2024927162927:7263878ad4b223563c6dbb7b3cd5db52404fda51110a7c935c99de72996f93b7

========================================================================================

Wow, just in time. That support membership ran out yesterday, so you just made it with the support request in the last minute!

Replace the PsychBasic/Screen.mexa64 for Matlab and PsychBasic/Octave5LinuxFiles64/Screen.mex with the updated files from the following link:

https://github.com/kleinerm/Psychtoolbox-3/raw/refs/heads/master/Psychtoolbox/PsychBasic/Screen.mexa64

https://github.com/kleinerm/Psychtoolbox-3/raw/refs/heads/master/Psychtoolbox/PsychBasic/Octave5LinuxFiles64/Screen.mex

This should fix the known Ubuntu 24.04-LTS bugs wrt. Vulkan and also HDR.
Lets see if a downgraded amdvlk driver helps. That older driver works for me on 2 generations older graphics hardware, and should work with yours as well.

-mario

Hi Mario,

oh indeed, that was pure luck though!

Unfortunately these files did not solve the problem though. I am still getting the stack smashing error and everything breaks if I add the HDR option.

As there seem to be no immediate candidates for the reason, I think I will reinstall everything from scratch, perhaps with a 22.04 linux. I will let you know whether that helps at all.

best
Heiko

Hi,

so 22.04 was not the problem apparently. I set up such a Linux now and get the same stack smashing error.

best
Heiko

PsychVulkanCore-INFO: Vulkan instance (version 1.3.204) created.


PTB-INFO: This is Psychtoolbox-3 for GNU/Linux X11, under GNU/Octave 64-Bit Intel (Version 3.0.19 - Build date: Sep 27 2024).
PTB-INFO: OS support status: Linux 6.8.0-40-generic Supported.
PTB-INFO: Type 'PsychtoolboxVersion' for more detailed version information.
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with
PTB-INFO: some restrictions. See file 'License.txt' in the Psychtoolbox root folder for the exact licensing conditions.

PTB-INFO: For information about paid support, support memberships and other commercial services, please type
PTB-INFO: 'PsychPaidSupportAndServices'.

PTB-INFO: Trying to enable at least 10 bpc fixed point framebuffer.
PTB-INFO: Linux native 10 bit per color framebuffer requested, and the OS claims it is working fine. Good.
PTB-INFO: Real (OS native, queried) color resolution of the GPU framebuffer is 10 bits per RGB color component.
PTB-INFO: External display method is in use for this window. Running short and lenient timing tests only.


PTB-INFO: OpenGL-Renderer is AMD :: AMD Radeon RX 6750 XT (navi22, LLVM 15.0.7, DRM 3.57, 6.8.0-40-generic) :: 4.6 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2
PTB-INFO: VBL startline = 2160 , VBL Endline = -1
PTB-INFO: Will try to use OS-Builtin OpenML sync control support for accurate Flip timestamping.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.667080 ms [59.998512 Hz]. (50 valid samples taken, stddev=0.000373 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.666667 ms [60.000000 Hz].
PTB-INFO: Small deviations between reported values are normal and no reason to worry.
PTB-INFO: Using usercode override framebuffer rect [0, 0, 3840, 2160] for image processing.
PTB-INFO: Psychtoolbox imaging pipeline starting up for window with requested imagingmode 17830917 ...
PTB-INFO: Will use 32 bits per color component floating point framebuffer for stimulus drawing. Alpha blending should work correctly.
PTB-INFO: Will use 32 bits per color component floating point framebuffer for stimulus post-processing (if any).
PTB-INFO: Full processing needed for redirected output mode.
PTB-INFO: This is a HDR display window: Applying higher precision and suitable range scaling for textures and movie video frames.
Building a fragment shader:Reading shader from file /usr/share/psychtoolbox-3/PsychOpenGL/PsychGLSLShaders/ICMPassThroughShader.frag.txt ...
PsychVulkan-INFO: Positioning onscreen window at rect [0, 0, 3840, 2160] to align with display output 0 [HDMI-A-4] of screen 1.
PsychVulkan-INFO: Loaded identity gamma table into output for HDR.
*** stack smashing detected ***: terminated
fatal: caught signal Aborted -- stopping myself...
Aborted (core dumped)

The new Screen mex files do fix problems on Ubuntu 24.04-LTS, just not the unique one you experience. My main suspect would be the amdvlk driver. Did you downgrade that one to the version I recommended?

Update: Actually, I spent over 6 hours looking through the current amdvlk source code, and I have a suspicion what might cause the crash. Or at least I found one serious bug in AMD’s amdvlk driver, present since at least the year 2018, that would almost certainly trigger a crash with the symptoms you showed, if the attached monitor supports more than a hard-coded limit of 64 different video modes (combinations of video resolution + refresh rate)! The bug is impressively dumb, both the limitation to only 64 modes, and that no error checking is performed in the driver to prevent memory corruption and likely a driver crash if that limit is exceeded. Strong work AMD!

My own HDR monitor exposes only 47 individual modes, ie. smaller than the crash limit of 64, so with mine or similar monitors this problem would not happen.

If you run the ResolutionTest(1) function in Octave/Matlab, count if the “SCREEN 1 OUTPUT 0: AVAILABLE PER OUTPUT DETAILED RESOLUTIONS” list contains more than or around 64 entries/lines.

-mario

Hi Mario,

thank you for all that work! That is an impressive find…

I had downgraded the driver yes. More importantly I just checked and our projector does indeed offer more than 64 modes, namely 105.

Do you have any advise on how we could get a fix for this into the driver? I assume a stupid fix for this like increasing the limit to 128 would not be a lot of change in the code and even implementing a check such that it increases whenever its needed could be possible. But practically: Do you have an idea how complicated compiling the amdvlk driver is? And/or how responsive the maintainers are to bugfixes like this?

best
Heiko

Then that is probably the reason for the crash. You could check with connecting a monitor that exposes at most 64 modes if amdvlk then works correctly. Scripts like VBLSyncTest or PerceptualVBLSyncTest or AdditiveBlendingForLinearSuperpositionTutorial do have optional ‘useVulkan’ function parameters that allow to use Vulkan also on SDR displays, e.g., for standard 8 bit color precision, or high precision deep color 10 bpc/16bpc color precision output. Or ofc. another HDR monitor if you got one with less than 64 modes for simply running SimpleHDRDemo.

Increasing the limit and/or adding limit checks (that should have been there in the first time) is relatively easy. Making it adaptive is not. That part of the driver is remarkably poorly designed and would require quite a bit of work. The fact that the relevant part of the code base is shared with the proprietary drivers and also the MS-Windows drivers makes this even more complicated, as any change needs to work on all operating systems.

I had to do that in the past when implementing HDR support, as relevant bits of the amdvlk driver where quite broken on all operating systems, so I had to do the work of fixing relevant bits of the driver for AMD, doing their job for them. So recompiling is possible and there are instructions for it. Fun it was not at those times (years 2020-2021 mostly), and I haven’t rebuilt since years, so the procedure may have gotten better or worse.

Wrt. to responsiveness of the maintainers: Depends a lot on how much they care about your issue, the quality of your work, their workload, and whatnot. Could be days, could be weeks, could be months in my experience.

The only long term fix is for them to fix the bug or accept a bug fix into their driver, but there might be a non-trivial turnaround time for that, ie. bug fix → availability of an official bug fixed driver.

As short term fix, I have some ideas for some hacks in PTB to work around the issue, which may or may not work. Or compiling a fixed amdvlk driver as a temporary stop gap, given that my build system is still set up for this, assuming nothing broke in the last years of non-use.

In any case, I’d have to ask you to pay for the extra work hours required. I spent over six hours so far just on diagnosis this far. I’d ask you to pay for at least 4 hours at our maximum discount of 40% which you are eligible for, if you want me to continue on trying to find a solution with you. No guarantees of success - you pay for my time trying to solve a problem, not for a successful solution. Also no hard feelings if you don’t want to pay more, but then our troubleshooting process would end at this point.

I’ve sent you a private message with payment instructions and discount code if you want to go that route.

Best,
-mario

Hi Mario,

great!

So given what you write I have decided that we should compile the driver here locally and include a quick fix for it. If I find the time I could create a pull request to the drivers eventually, but for now that will allow us to fix the problem without making it general or integrating with any other os versions or pass any similar hurdles. Also, I wanted to have the option to update the driver without taking more of your time. Fortunately, I just got the source code, compiled and installed the result and this does produce the same behavior as the precompiled amdvlk driver (is recognized and psychtoolbox reports vulkan support but opening a window runs into stack smashing).

Given this success, I am fairly confident that I can solve the rest for our purposes, if you tell me where exactly in the driver you found this bug. That should be the only other thing we need you to do for now.

In terms of payment: I’ll get some of your work hours payed for. This will take at least days, possibly weeks though, because this has to go through admin unless I want to pay this privately.

best
Heiko

I will trust you to pay for the 4 extra work hours, ie. about half of the work time I spent so far, as per the instructions I sent you in the private message, and let me know when the payment has happened. Please do not abuse this trust, our financial funding is very low and I can’t really afford to give these amounts of work for free at the moment. It may allow me to spend some time on trying to upstream a better fix or provide a self-built driver to cover older gpu generations.

Inside the pal module source tree, find and edit the file pal/inc/core/palPlatform.h and change the constant MaxModePerScreen from 64 to a generously higher value, e.g., 256. Then rebuild the driver, install, run. Should hopefully work for your projector then. For reference:

Best,
-mario

Any updates? Did the fix work?

Hi Mario,

yes! That did work, we are now running the locally compiled amdvlk. Everything works now I think, i.e. We are able to display things, we see 10bit resolution for luminance in ramps and are now taking measurements for checking linearity or linearisation.

best
Heiko

Good that it works. Now eagerly awaiting your payment for at least 4 discounted work hours.

Payment for 4 work hours received, thank you for your business :slight_smile: .

Btw. I did file an issue against AMDVLK 3 weeks ago, problem description, diagnostics/root causing, proposals for a fix. So far no reaction from AMD’s team, so I guess they are not too concerned with this specific crasher problem :frowning:

I’ll see if I find the time within the next weeks or months to send some pull request with a proposed fix, given that at least a basic fix of increasing the mode limit and adding some bounds checking and clamping to prevent crashes is straightforward. Coding this up and testing it takes me minutes and is easy. Upstreaming it, if the team isn’t too responsive, is the generally tedious and dreadful part.

In the meantime, some upcoming PTB version will contain some workaround of restricting mode queries to 64 modes max on current affected / not bug-fixed drivers. That can’t prevent crashes in all cases, but it should make at least single-display setups safely workable, and maybe some dual-display setups under certain conditions.

Best
mario

Update 1:

The latest PTB 3.0.19.15 release contains a workaround for this driver bug, which can prevent crash at least on some single-display stimulation setups, and on dual-display with some luck.

Additionally a proper bug fix (dynamic allocation of arrays for video modes) has been merged into AMDs code branch for the next upcoming release, so this bug should be properly fixed in the next official AMDVLK driver release, ie. v2024-Q4.2. Ofc. that fix only helps people with recent AMD Navi gpu family / RDNA graphics cards, as current and future drivers do no longer support Vega or Polaris gpu’s.

See AMDVLK out of bounds write causes memory corruption/crash when an attached display monitor has more than 64 video modes. · Issue #179 · GPUOpen-Drivers/xgl · GitHub

I did a code review of AMD’s fix and think it is correct. If you want to test this fix, you can git pull the latest updates from the dev branch of the xgl submodule, and then rebuild your amdvlk driver (and undo the hack of bumping the mode limit up from 64 in the pal submodule).

Update 2: 4th December 2024: A presumably bug-fixed driver version v2024-Q4.2 has been released by AMD today, which should solve this problem for good: