Hello guys! Can somebody give me a clue where is the problem. Developing new application under MacOS with latest SDK. If I am trying to link libMoltenVK.dylib to my bundle app then instance creates very well. But in case I am trying to link only vulkan.framework, ICD driver does not loads and fails to create an instance. Where can be the problem? Tried to play around with env vars, but it seems that I do not understand how vulkan.framework should load ICD driver and layers. I am trying to make it work with SDK installed into system folders /usr/local/
Correct me if I am wrong but if SDK installed into /usr/local then the only thing I need is to link vulkan.framework which should make a search in these system folders and in case of successfull search of /usr/local/share/vulkan/icd.d/MoltenVK_icd.json it should upload into memory libMoltenVK.dylib. Or I am missing something?
I investigated the problem by myself. MacOS restricted access of my application with sandbox. So as a result fopen() call inside vulkan.framework has failed to read ICD manifest json. To fix it you need to set “App Sandbox” = NO in your *.entitlements file
I suspect there may have been a pop-up you missed asking if you want to allow to access the directory containing the manifest. Such pop-ups are normal macOS behavior as far as I can see.
More importantly, if you want to distribute your app you need to copy the framework and libMoltenVK.dylib into your app bundle. As is, it will only work if the user has installed the Vulkan SDK. See the link provided by @krOoze earlier in this thread.