Segmentation Fault on Linux VKRT build.
ArmorPaint version:
858e402 (also happened in the official alpha 1.0 binary)
OS / GPU model: ArchLinux x86_64 kernel 6.12.8-arch1-1 Radeon RX 7900XTX (RADV 24.3.3, AMDVLK 24.20_2044449)
Issue description:
ArmorPaint crashes with "signal SIGSEGV: invalid address (fault address: 0x0)". I tried the open source version of the driver (RADV) and AMD's proprietary version of the driver (AMDVLK), both of which failed. GPU driver and GPU supports Vulkan raytracing because raytracing example of this worked successfully.
Here is the backtrace information I got from LLDB.
* thread #1, name = 'ArmorPaint', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
* frame #0: 0x00007ffff22f19c9 libvulkan_radeon.so`radv_generate_ray_tracing_state_key [inlined] radv_create_group_handles at radv_pipeline_rt.c:146:13
frame #1: 0x00007ffff22f190a libvulkan_radeon.so`radv_generate_ray_tracing_state_key [inlined] radv_rt_fill_group_info at radv_pipeline_rt.c:213:22
frame #2: 0x00007ffff22f190a libvulkan_radeon.so`radv_generate_ray_tracing_state_key at radv_pipeline_rt.c:1002:13
frame #3: 0x00007ffff22f2089 libvulkan_radeon.so`radv_CreateRayTracingPipelinesKHR [inlined] radv_rt_pipeline_create at radv_pipeline_rt.c:1086:13
frame #4: 0x00007ffff22f1ff1 libvulkan_radeon.so`radv_CreateRayTracingPipelinesKHR at radv_pipeline_rt.c:1188:11
frame #5: 0x00007fffe8a18eed libVkLayer_khronos_validation.so`DispatchCreateRayTracingPipelinesKHR(VkDevice_T*, VkDeferredOperationKHR_T*, VkPipelineCache_T*, unsigned int, VkRayTracingPipelineCreateInfoKHR const*, VkAllocationCallbacks const*, VkPipeline_T**) at layer_chassis_dispatch_manual.cpp:1169:85
frame #6: 0x00007fffe8cee96d libVkLayer_khronos_validation.so`vulkan_layer_chassis::CreateRayTracingPipelinesKHR(VkDevice_T*, VkDeferredOperationKHR_T*, VkPipelineCache_T*, unsigned int, VkRayTracingPipelineCreateInfoKHR const*, VkAllocationCallbacks const*, VkPipeline_T**) at chassis.cpp:988:54
frame #7: 0x0000555555befb2c ArmorPaint`kinc_raytrace_pipeline_init(pipeline=0x00005555566343f0, command_list=0x0000555556763b58, ray_shader=0x0000555558f88720, ray_shader_size=19384, constant_buffer=0x0000555556634390) at raytrace.c.h:247:3
frame #8: 0x00005555559f1071 ArmorPaint`iron_raytrace_init(shader=0x0000555558f86490) at iron.h:3004:2
frame #9: 0x0000555555a80582 ArmorPaint`render_path_raytrace_raytrace_init(shader_name="raytrace_brute_core.spirv", build=true) at iron.c:31215:3
frame #10: 0x0000555555a9c560 ArmorPaint`render_path_raytrace_commands(use_live_layer=false) at iron.c:31146:3
frame #11: 0x0000555555a4fbd1 ArmorPaint`render_path_raytrace_draw(use_live_layer=false) at iron.c:31254:2
frame #12: 0x0000555555a4f8e7 ArmorPaint`render_path_base_commands(draw_commands=(ArmorPaint`render_path_deferred_draw_deferred at iron.c:26886)) at iron.c:16843:3
frame #13: 0x0000555555a891c5 ArmorPaint`render_path_deferred_commands at iron.c:26883:2
frame #14: 0x0000555555a1b456 ArmorPaint`render_path_render_frame at iron.c:8942:2
frame #15: 0x0000555555a0936c ArmorPaint`camera_object_render_frame(raw=0x0000555558952ae0) at iron.c:5504:2
frame #16: 0x0000555555a11a2e ArmorPaint`scene_render_frame at iron.c:6998:21
frame #17: 0x0000555555a1f8ef ArmorPaint`app_render at iron.c:10137:2
frame #18: 0x0000555555a135e6 ArmorPaint`sys_render_callback at iron.c:7386:3
frame #19: 0x00005555559eb9b6 ArmorPaint`_update(data=0x0000000000000000) at iron.h:487:2
frame #20: 0x0000555555c08732 ArmorPaint`kinc_internal_update_callback at system.h:427:3
frame #21: 0x0000555555c08a09 ArmorPaint`kinc_internal_frame at system.h:522:2
frame #22: 0x0000555555c08a30 ArmorPaint`kinc_start at system.h:537:9
frame #23: 0x0000555555a0866b ArmorPaint`_kickstart at iron.c:5374:2
frame #24: 0x00005555559e4dee ArmorPaint`kickstart(argc=1, argv=0x00007fffffffd8a8) at iron.h:304:2
frame #25: 0x0000555555bff102 ArmorPaint`main(argc=1, argv=0x00007fffffffd8a8) at system.c.h:200:9
frame #26: 0x00007ffff70e4e08 libc.so.6`__libc_start_call_main(main=(ArmorPaint`main at system.c.h:199), argc=1, argv=0x00007fffffffd8a8) at libc_start_call_main.h:58:16
frame #27: 0x00007ffff70e4ecc libc.so.6`__libc_start_main_impl(main=(ArmorPaint`main at system.c.h:199), argc=1, argv=0x00007fffffffd8a8, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffd898) at libc-start.c:360:3
frame #28: 0x00005555555f8785 ArmorPaint`_start + 37
Steps to reproduce:
- Clone this repository.
- Move
armortools/armorpaint. - Run
../armorcore/make --graphics vulkan --run - Segmentation fault
I too am also seeing this
I can't build branch because of this:
OS: Linux Mint 22.1 x86_64 GPU: Radeon 5700 XT
I'll hijack this instead of making a new bug report because the root issue is likely the same:
ArmorPaint version:
commit eb557172be724be37731778af06adf817b70405b, also affects older builds but I don't have a certain version history since OpenGL used to work and this bug report was already active.
OS / GPU model: Arch Linux 6.13.8-zen1-1-zen AMD Radeon RX 7900 XTX - driver version 25.0.3 (radeonsi, navi31, LLVM 19.1.7, DRM 3.61)
Issue description: With the removal of OpenGL as a build target the program is no longer usable on AMD based linux systems (I can't comment on nvidia or intel). OpenGL did work but it's no longer available as a build option.
//base/tools/make.js
function shader_find_type(options) {
if (options.graphics === 'vulkan') {
return 'spirv';
}
else if (options.graphics === 'metal') {
return 'metal';
}
else if (options.graphics === 'direct3d12') {
return 'hlsl';
}
}
Program Output
$ armorpaint
Chosen Vulkan device: AMD Radeon RX 7900 XTX (RADV NAVI31)
/usr/bin/armorpaint: line 3: 176498 Segmentation fault (core dumped) /usr/bin/ArmorPaint /usr/lib/armorpaint/
$ gdb ArmorPaint
...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe97ff6c0 (LWP 187101)]
[New Thread 0x7fffe8ffe6c0 (LWP 187102)]
Chosen Vulkan device: AMD Radeon RX 7900 XTX (RADV NAVI31)
[New Thread 0x7fffe3fff6c0 (LWP 187103)]
[New Thread 0x7fffe37fe6c0 (LWP 187104)]
Thread 1 "ArmorPaint" received signal SIGSEGV, Segmentation fault.
(gdb) bt full
#0 0x00007ffff4abdb9a in ??? () at /usr/lib/libvulkan_radeon.so
#1 0x00005555556b4081 in get_descriptor_set (buffer=0x55555a327970)
at ../../../base/sources/backends/vulkan_gpu.c:1410
descriptor_set = 0x0
buffer_descs = {{buffer = 0x55555a327970, offset = 0, range = 256}}
tex_desc = {{sampler = 0x0, imageView = 0x55555ad05980, imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL}, {sampler = 0x0, imageView = 0x0, imageLayout = VK_IMAGE_LAYOUT_UNDEFINED} <repeats 15 times>}
writes = {{sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, pNext = 0x0, dstSet = 0x0, dstBinding = 0, dstArrayElement = 0, descriptorCount = 1, descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, pImageInfo = 0x0, pBufferInfo = 0x7fffffff5390, pTexelBufferView = 0x0}, {sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, pNext = 0x0, dstSet = 0x0, dstBinding = 2, dstArrayElement = 0, descriptorCount = 1, descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, pImageInfo = 0x7fffffff5210, pBufferInfo = 0x0, pTexelBufferView = 0x0}, {sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, pNext = 0x0, dstSet = 0x0, dstBinding = 0, dstArrayElement = 0, descriptorCount = 0, descriptorType = VK_DESCRIPTOR_TYPE_SAMPLER, pImageInfo = 0x0, pBufferInfo = 0x0, pTexelBufferView = 0x0} <repeats 15 times>}
write_count = 2
#2 0x00005555556b3d7d in gpu_set_constant_buffer
(buffer=0x555556e26398 <constant_buffer>, offset=0, size=256)
at ../../../base/sources/backends/vulkan_gpu.c:1415
descriptor_set = 0x5555556b6540 <gpu_constant_buffer_unlock+32>
offsets = {32767}
#3 0x0000555555680fca in gpu_draw () at ../../../base/sources/iron_gpu.c:67
#4 0x000055555566e31c in draw_scaled_sub_image
(tex=0x55555ad05190, sx=0, sy=0, sw=2048, sh=2048, dx=0, dy=0, dw=200, dh=200)
at ../../../base/sources/iron_draw.c:239
#5 0x000055555566e404 in draw_scaled_image (tex=0x55555ad05190, dx=0, dy=0, dw=200, dh=200)
at ../../../base/sources/iron_draw.c:243
#6 0x0000555555612ae3 in ui_base_update_ui ()
at /.../src/armortools/armorpaint/build/iron.c:22660
source = 0x55555ad05190
l = 0x55555a30b710
target = 0x55555ad31830
set_clone_source = false
decal = false
decal_mask = false
down = false
undo_pressed = false
redo_pressed = false
#7 0x000055555560db0d in ui_base_update ()
at /.../armortools/armorpaint/build/iron.c:21982
keys = 0x7fffffff5800
decal = false
decal_mask = false
is_typing = false
#8 0x0000555555638482 in sys_update ()
at /.../src/armortools/armorpaint/build/iron.c:31501
cb = 0x55555ac72050
i = 4
l = 6
#9 0x00005555556385a9 in sys_render ()
at /.../src/armortools/armorpaint/build/iron.c:31538
#10 0x0000555555637fa2 in sys_render_callback ()
at /.../src/armortools/armorpaint/build/iron.c:31286
i = 0
#11 0x000055555558d7d8 in _update (data=0x0) at ../../../base/sources/iron.h:421
start_sleep = 120
#12 0x000055555568d69e in iron_internal_update_callback () at ../../../base/sources/iron_system.c:180
#13 0x000055555568d879 in iron_internal_frame () at ../../../base/sources/iron_system.c:256
#14 0x000055555568d8a0 in iron_start () at ../../../base/sources/iron_system.c:270
#15 0x00005555555a7fa8 in _kickstart ()
at /.../src/armortools/armorpaint/build/iron.c:4958
#16 0x00005555555865f1 in kickstart (argc=1, argv=0x7fffffffd6f8) at ../../../base/sources/iron.h:284
bindir = 0x55555a214570 "/.../src/armortools/armorpaint/build/out"
assetsdir = 0x55555a214570 "/.../src/armortools/armorpaint/build/out"
l = 82
#17 0x00005555556aba02 in main (argc=1, argv=0x7fffffffd6f8)
at ../../../base/sources/backends/linux_system.c:1465
Steps to reproduce:
- Run an AMD-based system
-
../base/make --release --compile(also happens with debug) -
./ArmorPaint - SIGSEGV
As an addendum, I'm more than willing to put in some work in testing and debugging. Just tell me what you want done and I'll see what can be done.
Wanted to jump in here. I also get a segfault on startup. The validation layers also cry about not enabled features:
Running with Vulkan validation layers enabled.
Chosen Vulkan device: AMD Radeon RX 7600S (RADV NAVI33)
Vulkan WARNING: Code 517492826 : vkAllocateDescriptorSets(): Trying to allocate 2048 of VK_DESCRIPTOR_TYPE_SAMPLER descriptors from VkDescriptorPool 0xe7f79a0000000005, but this pool only has a total of 1 descriptors for this type so you will likely get VK_ERROR_OUT_OF_POOL_MEMORY_KHR. While this might succeed on some implementations, it will fail on others.
Vulkan WARNING: Code 517492826 : vkAllocateDescriptorSets(): Trying to allocate 32768 of VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE descriptors from VkDescriptorPool 0xe7f79a0000000005, but this pool only has a total of 16 descriptors for this type so you will likely get VK_ERROR_OUT_OF_POOL_MEMORY_KHR. While this might succeed on some implementations, it will fail on others.
Vulkan WARNING: Code 517492826 : vkAllocateDescriptorSets(): Trying to allocate 2048 of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC descriptors from VkDescriptorPool 0xe7f79a0000000005, but this pool only has a total of 1 descriptors for this type so you will likely get VK_ERROR_OUT_OF_POOL_MEMORY_KHR. While this might succeed on some implementations, it will fail on others.
Vulkan ERROR: Code -2010063723 : vkAllocateMemory(): pAllocateInfo->memoryTypeIndex 10 includes the VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD memory property, but the deviceCoherentMemory feature is not enabled.
The Vulkan spec states: If the deviceCoherentMemory feature is not enabled, pAllocateInfo->memoryTypeIndex must not identify a memory type supporting VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD (https://vulkan.lunarg.com/doc/view/1.4.309.0/linux/antora/spec/latest/chapters/memory.html#VUID-vkAllocateMemory-deviceCoherentMemory-02790)
Vulkan ERROR: Code -2010063723 : vkAllocateMemory(): pAllocateInfo->memoryTypeIndex 10 includes the VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD memory property, but the deviceCoherentMemory feature is not enabled.
The Vulkan spec states: If the deviceCoherentMemory feature is not enabled, pAllocateInfo->memoryTypeIndex must not identify a memory type supporting VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD (https://vulkan.lunarg.com/doc/view/1.4.309.0/linux/antora/spec/latest/chapters/memory.html#VUID-vkAllocateMemory-deviceCoherentMemory-02790)
Vulkan ERROR: Code -2010063723 : vkAllocateMemory(): pAllocateInfo->memoryTypeIndex 10 includes the VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD memory property, but the deviceCoherentMemory feature is not enabled.
The Vulkan spec states: If the deviceCoherentMemory feature is not enabled, pAllocateInfo->memoryTypeIndex must not identify a memory type supporting VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD (https://vulkan.lunarg.com/doc/view/1.4.309.0/linux/antora/spec/latest/chapters/memory.html#VUID-vkAllocateMemory-deviceCoherentMemory-02790)
Vulkan ERROR: Code -2010063723 : vkAllocateMemory(): pAllocateInfo->memoryTypeIndex 10 includes the VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD memory property, but the deviceCoherentMemory feature is not enabled.
The Vulkan spec states: If the deviceCoherentMemory feature is not enabled, pAllocateInfo->memoryTypeIndex must not identify a memory type supporting VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD (https://vulkan.lunarg.com/doc/view/1.4.309.0/linux/antora/spec/latest/chapters/memory.html#VUID-vkAllocateMemory-deviceCoherentMemory-02790)
Vulkan ERROR: Code -2010063723 : vkAllocateMemory(): pAllocateInfo->memoryTypeIndex 10 includes the VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD memory property, but the deviceCoherentMemory feature is not enabled.
The Vulkan spec states: If the deviceCoherentMemory feature is not enabled, pAllocateInfo->memoryTypeIndex must not identify a memory type supporting VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD (https://vulkan.lunarg.com/doc/view/1.4.309.0/linux/antora/spec/latest/chapters/memory.html#VUID-vkAllocateMemory-deviceCoherentMemory-02790)
Segmentation fault (core dumped)
My system: OS: Fedora Linux 42 (KDE Plasma Desktop Edition) x86_64 CPU: AMD Ryzen 9 7940HS w/ Radeon 780M Graphics (16) @ 5.263GHz dGPU: GPU: AMD ATI Radeon RX 7600S Memory: 31296MiB
This might be related only to AMD. I might be able to test this tomorrow on Nvidia.
I built with ../base/make --debug --compile.
Cheers!
i've also had no luck running any of the armortools with my amd gpu (9070xt)
$ ./build/Release/ArmorPaint
WARNING: radv is not a conformant Vulkan implementation, testing use only.
Chosen Vulkan device: AMD Radeon Graphics (RADV GFX1201)
fish: Job 1, './build/Release/ArmorPaint' terminated by signal SIGSEGV (Address boundary error)
Thread 1 "ArmorPaint" received signal SIGSEGV, Segmentation fault.
0x00005555555b5260 in draw_init (image_vert=0x0, image_frag=0x0,
image_transform_vert=0x0, image_transform_frag=0x0, rect_vert=0x0,
rect_frag=0x0, tris_vert=0x0, tris_frag=0x0, text_vert=0x0, text_frag=0x0)
at ../../../base/sources/iron_draw.c:151
151 gpu_shader_init(&vert_shader, image_vert->buffer, image_vert->length, GPU_SHADER_TYPE_VERTEX);
(gdb)
the updates to git in the last day seems to have allowed to me start the application, although there are major graphical glitching going on.
Should be finally working on amd gpus now, sorry it took so long and thanks for the detailed reports. If you still encounter issues please let me know at https://github.com/armory3d/armortools/issues/1913. I have tested it on Radeon RX6400, hopefully it also runs on other models.