You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If macOS VulkanSDK 1.3.296 is used with on installed, run vulkaninfo and you will get this:
ERROR at /Users/lunarg/Dev/macos-sdk-build/Vulkan-Tools/vulkaninfo/./vulkaninfo.h:409: Failed to initialize: Vulkan loader is not installed, not found, or failed to load.
I always use VulkanSDK with no installed and config icd.d/explicit_layer.d manually in /home/me/.config/vulkan and in early version of VulkanSDK it worked.
I checked source code of vulkaninfo, and I found this:
// 1.3.268
VkResult dllErr = dll.Initialize();
if (dllErr != VK_SUCCESS) {
THROW_ERR("Failed to initialize: Vulkan loader is not installed, not found, or failed to load.");
}
// 1.3.296
VkResult dllErr = volkInitialize();
if (dllErr != VK_SUCCESS) {
THROW_ERR("Failed to initialize: " API_NAME " loader is not installed, not found, or failed to load.");
}
New version will use volk to perform vulkan library load. And volk initialize do this:
VkResult volkInitialize(void)
{
#if defined(_WIN32)
HMODULE module = LoadLibraryA("vulkan-1.dll");
if (!module)
return VK_ERROR_INITIALIZATION_FAILED;
// note: function pointer is cast through void function pointer to silence cast-function-type warning on gcc8
vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)(void(*)(void))GetProcAddress(module, "vkGetInstanceProcAddr");
#elif defined(__APPLE__)
void* module = dlopen("libvulkan.dylib", RTLD_NOW | RTLD_LOCAL);
if (!module)
module = dlopen("libvulkan.1.dylib", RTLD_NOW | RTLD_LOCAL);
if (!module)
module = dlopen("libMoltenVK.dylib", RTLD_NOW | RTLD_LOCAL);
// Add support for using Vulkan and MoltenVK in a Framework. App store rules for iOS// strictly enforce no .dylib's. If they aren't found it just falls throughif (!module)
module = dlopen("vulkan.framework/vulkan", RTLD_NOW | RTLD_LOCAL);
if (!module)
module = dlopen("MoltenVK.framework/MoltenVK", RTLD_NOW | RTLD_LOCAL);
// modern versions of macOS don't search /usr/local/lib automatically contrary to what man dlopen says// Vulkan SDK uses this as the system-wide installation location, so we're going to fallback to this if all else failsif (!module && getenv("DYLD_FALLBACK_LIBRARY_PATH") == NULL)
module = dlopen("/usr/local/lib/libvulkan.dylib", RTLD_NOW | RTLD_LOCAL);
if (!module)
return VK_ERROR_INITIALIZATION_FAILED;
vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)dlsym(module, "vkGetInstanceProcAddr");
#elsevoid* module = dlopen("libvulkan.so.1", RTLD_NOW | RTLD_LOCAL);
if (!module)
module = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
if (!module)
return VK_ERROR_INITIALIZATION_FAILED;
VOLK_DISABLE_GCC_PEDANTIC_WARNINGS
vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)dlsym(module, "vkGetInstanceProcAddr");
VOLK_RESTORE_GCC_PEDANTIC_WARNINGS
#endif
loadedModule = module;
volkGenLoadLoader(NULL, vkGetInstanceProcAddrStub);
return VK_SUCCESS;
}
It just load vulkan dynamic library in system or in working directory, it will break vulkaninfo application when VulkanSDK is not installed.
In my workflow, there is a simple workaround: just copy libvulkan.dylib to same directory of vulkaninfo application or just set working directory of vulkaninfo application to path of libvulkan.dylib.
But you know some projects will pack all the VulkanSDK as 3rd party dependency, in this way, VulkanSDK will not installed, so I want to report this, I think vulkaninfo need to give same experience no matter VulkanSDK installed or not. Cause it is a important tool to diagnose vulkan environment.
The text was updated successfully, but these errors were encountered:
FlyAndNotDown
changed the title
vulkaninfo
vulkaninfo can not run if VulkanSDK is not installed
Dec 29, 2024
I believe this is a regression in vulkaninfo and has been fixed by 0f30717
We are working on a new SDK which will contain that commit, so the fix should be out shortly (within a week or two). I'll try to post here when that occurs so you can try out the SDK with the commit to see if its fixed.
If macOS VulkanSDK 1.3.296 is used with on installed, run vulkaninfo and you will get this:
I always use VulkanSDK with no installed and config icd.d/explicit_layer.d manually in
/home/me/.config/vulkan
and in early version of VulkanSDK it worked.I checked source code of vulkaninfo, and I found this:
New version will use volk to perform vulkan library load. And volk initialize do this:
It just load vulkan dynamic library in system or in working directory, it will break vulkaninfo application when VulkanSDK is not installed.
In my workflow, there is a simple workaround: just copy libvulkan.dylib to same directory of vulkaninfo application or just set working directory of vulkaninfo application to path of libvulkan.dylib.
But you know some projects will pack all the VulkanSDK as 3rd party dependency, in this way, VulkanSDK will not installed, so I want to report this, I think vulkaninfo need to give same experience no matter VulkanSDK installed or not. Cause it is a important tool to diagnose vulkan environment.
The text was updated successfully, but these errors were encountered: