Skip to content

Commit 3bee7f6

Browse files
committed
Fix an issue with Vulkan support on Linux
1 parent c595271 commit 3bee7f6

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Src/GPUPerfAPIVk/GPUPerfAPIVk.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,22 @@ bool Initialize_Vk_Entrypoints(VkInstance instance, VkDevice device)
6767
#ifdef _WIN32
6868
HMODULE vulkanModule = GetModuleHandle("Vulkan-1.dll");
6969
#else
70-
void* vulkanModule = dlopen("libvulkan.so", RTLD_NOW);
70+
void* vulkanModule = dlopen("libvulkan.so", RTLD_NOLOAD);
71+
72+
if (vulkanModule == nullptr)
73+
{
74+
vulkanModule = dlopen("libvulkan.so", RTLD_NOW);
75+
}
76+
77+
if (vulkanModule == nullptr)
78+
{
79+
vulkanModule = dlopen("libvulkan.so.1", RTLD_NOLOAD);
80+
}
81+
82+
if (vulkanModule == nullptr)
83+
{
84+
vulkanModule = dlopen("libvulkan.so.1", RTLD_NOW);
85+
}
7186
#endif
7287

7388
if (vulkanModule == nullptr)

0 commit comments

Comments
 (0)