vkCreateDevice fails when enabling VK_KHR_acceleration_structure and VK_KHR_ray_query and address sanitizer on Linux

When enabling address sanitizer and device extensions VK_KHR_acceleration_structure, VK_KHR_ray_query, vkCreateDevice fails with VK_ERROR_INITIALIZATION_FAILED, without address sanitizer it works.

System info:
OS: Arch Linux x86_64
Host: MS-7E56 (2.0)
Kernel: Linux 6.18.9-arch1-2
CPU: AMD Ryzen 7 9700X (16) @ 5.58 GHz
GPU 1: NVIDIA GeForce RTX 5070 Ti [Discrete]
GPU 2: AMD Radeon Graphics [Integrated]

Driver info:

apiVersion        = 1.4.312 (4211000)
driverVersion     = 580.126.18.0 (2434761856)
vendorID          = 0x10de
deviceID          = 0x2c05
deviceType        = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
deviceName        = NVIDIA GeForce RTX 5070 Ti
pipelineCacheUUID = 8836ce1e-79b3-223e-3909-2632e4d5ea92

It seems that 2 other people hit the same issue (see the Sandy Carter’s comment):

I’ve made a minimal reproducible example by stripping down my code, it’s validation clean (just no cleanup) and works on iGPU (AMD with radv driver).

Compile and run with: g++ -Wall -Wextra -Og -std=c++17 -I$VULKAN_SDK/include -lvulkan -fsanitize=address main.cpp -o main && ./main

Source code (rename to .cpp):

main.txt (8.2 KB)

Vulkan Loader dump:

loader_dump.txt (15.7 KB)

According to this answer:

ASAN_OPTIONS=protect_shadow_gap=0can be used as a workaround. It’s interesting that it’s only triggered when enabling VK_KHR_acceleration_structure and VK_KHR_ray_query but maybe other extensions can trigger it too.

Assuming this is the same problem, it exists for >10 years (see this issue asan: problem calling NVIDIA CUDA libraries · Issue #629 · google/sanitizers · GitHub), since a workaround exists, I guess that’s the solution.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.