GPUOpen-Drivers / AMDVLK

AMD Open Source Driver For Vulkan
MIT License
1.72k stars 161 forks source link

Creating a ray tracing pipeline with a specific closest hit shader causes a segmentation fault on Windows #254

Closed expenses closed 3 months ago

expenses commented 2 years ago

Not sure if this is the best place to report this. I'm running an AMD Radeon RX 6900 XT on AMD Radeon Software 21.8.2. When developing a program that uses the Vulkan ray tracing extensions, I ran into this problem. This is entirely caused by the SPIR-V shader in question, as swapping it out for a different problem results in the program running perfectly. The shader is valid according to spirv-val and there are no validation errors reported. It's attached here:

shader.zip

Here's the full gdb backtrace:

(gdb) run
Starting program: C:\Users\Ashley\Desktop\ray-tracing-gallery\target\debug\ray-tracing-gallery.exe
[New Thread 2340.0x2150]
[New Thread 2340.0x1b04]
[New Thread 2340.0x1514]
[New Thread 2340.0x1f14]
[New Thread 2340.0x1c44]
[New Thread 2340.0x2a5c]
[New Thread 2340.0x133c]
[New Thread 2340.0x690]
22:26:52 [INFO] Found 2 devices
22:26:52 [INFO]
22:26:52 [INFO] Checking Device: "AMD Radeon RX 6900 XT"
22:26:52 [INFO]   Checking for a graphics queue family: ✔️
22:26:52 [INFO]   Checking for an appropriate surface format: ✔️
22:26:52 [INFO]   Checking for required extensions:
22:26:52 [INFO]     * "VK_KHR_swapchain": ✔️
22:26:52 [INFO]     * "VK_KHR_deferred_host_operations": ✔️
22:26:52 [INFO]     * "VK_KHR_acceleration_structure": ✔️
22:26:52 [INFO]     * "VK_KHR_ray_tracing_pipeline": ✔️
22:26:52 [INFO]     * "VK_KHR_shader_clock": ✔️
22:26:52 [INFO]
22:26:52 [INFO] Checking Device: "Intel(R) Iris(R) Plus Graphics 640"
22:26:52 [INFO]   Checking for a graphics queue family: ✔️
22:26:52 [INFO]   Checking for an appropriate surface format: ✔️
22:26:52 [INFO]   Checking for required extensions:
22:26:52 [INFO]     * "VK_KHR_swapchain": ✔️
22:26:52 [INFO]     * "VK_KHR_deferred_host_operations": ❌
22:26:52 [INFO]     * "VK_KHR_acceleration_structure": ❌
22:26:52 [INFO]     * "VK_KHR_ray_tracing_pipeline": ❌
22:26:52 [INFO]     * "VK_KHR_shader_clock": ✔️
22:26:52 [INFO]
22:26:52 [INFO] Using device "AMD Radeon RX 6900 XT"

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ffaa538f5ec in vk_icdGetInstanceProcAddrSG ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
(gdb) bt
#0  0x00007ffaa538f5ec in vk_icdGetInstanceProcAddrSG ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#1  0x00007ffaa53a8fdf in vk_icdGetInstanceProcAddrSG ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#2  0x00007ffaa53aa11b in vk_icdGetInstanceProcAddrSG ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#3  0x00007ffaa5084cb0 in vk_icdGetInstanceProcAddrSG ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#4  0x00007ffaa4d45fd4 in vk_icdGetInstanceProcAddrSG ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#5  0x00007ffaa4d2ac8b in vk_icdGetInstanceProcAddrSG ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#6  0x00007ffaa4ac382e in vk_icdGetInstanceProcAddrSG ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#7  0x00007ffaa4c6d0b2 in vk_icdGetInstanceProcAddrSG ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#8  0x00007ffaa4b10445 in vk_icdGetInstanceProcAddrSG ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#9  0x00007ffaa4b0f9dd in vk_icdGetInstanceProcAddrSG ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#10 0x00007ffaa4ac0d52 in vk_icdGetInstanceProcAddrSG ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#11 0x00007ffaa4883caf in vk_icdNegotiateLoaderICDInterfaceVersion ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#12 0x00007ffaa482e0e2 in vk_icdNegotiateLoaderICDInterfaceVersion ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#13 0x00007ffaa4a8612e in vk_icdGetInstanceProcAddrSG ()
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#14 0x00007ffaa4a8800b in vk_icdGetInstanceProcAddrSG ()
---Type <return> to continue, or q <return> to quit---
   from C:\Windows\System32\DriverStore\FileRepository\u0370882.inf_amd64_16efd232c9cc1313\B370998\amdvlk64.dll
#15 0x00007ffaa1ec6e9c in vkNegotiateLoaderLayerInterfaceVersion ()
   from C:\VulkanSDK\1.2.189.2\Bin\VkLayer_khronos_validation.dll
#16 0x00007ffaa1e4829e in ?? () from C:\VulkanSDK\1.2.189.2\Bin\VkLayer_khronos_validation.dll
#17 0x00007ff7745e480a in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
jiaolu commented 3 months ago

Not sure if you are using gpuopen amdvlk driver. but i tested the main_debug.spv with amdllpc. and the main_debug.spv can be compiled without issue.