or equivalent for Gradle/Ivy, or get it from the LWJGL website.
This means that GLFW cannot find the Vulkan binary. Make sure libvulkan.1.dylib is in a location where dlopen can find it. If you use the above LWJGL artifact you don’t have to worry about it, GLFW will find it automatically.
Where did I go wrong with my approach:
I’m using IntelliJ IDEA and added the jars simply via Project Structure>Libraries>Add>… . And then I’m running the Triangle Demo with the VM options of -Djava.library.path=natives/mac/. In the folder natives/mac are all of the .git .sga1 and .dylib files that came with the LWJGL download.
Are my libraries/natives somehow misplaced? I just always used this setup for OpenGL and stuck with it.
That’s what the console spits out: That not-finding but seemingly still loading of lubvulkan.1.dylib is strange.
[LWJGL] Version: 3.1.7 build 2
[LWJGL] OS: Mac OS X v10.10.5
[LWJGL] JRE: 9.0.4 x86_64
[LWJGL] JVM: Java HotSpot(TM) 64-Bit Server VM v9.0.4+11 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL] Loaded from java.library.path: natives/mac/liblwjgl.dylib
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] Warning: Failed to instantiate memory allocator: org.lwjgl.system.jemalloc.JEmallocAllocator. Using the system default.
[LWJGL] MemoryUtil allocator: StdlibAllocator
[LWJGL] Loading library: glfw
[LWJGL] Loaded from java.library.path: natives/mac/libglfw.dylib
[LWJGL] Loading library: MoltenVK
[LWJGL] Loading library: libvulkan.1.dylib
[LWJGL] libvulkan.1.dylib not found in system paths
[LWJGL] Loaded from java.library.path: natives/mac/libvulkan.1.dylib
MoltenVK requires macOS 10.11 or later. You’re on 10.10, so that’s the biggest issue.
This line here, without further output, means that the LWJGL shared library loader was able to find the MoltenVK binary in natives/mac, but loading failed (because of the macOS version). LWJGL currently silently captures the error and moves on to try loading libvulkan.1.dylib, if available on the system. In a future LWJGL build, I’ll make sure there’s some useful output in this case.
This works as intended. Sometimes it’s very useful to know on which paths the shared library was NOT found, before trying other paths. In this case, libvulkan.1.dylib is not a library bundled with LWJGL, so the system paths are examined first.
Important note: libvulkan.1.dylib is just the Vulkan ICD loader. It’s a library that discovers Vulkan drivers in your system. Loading it on its own is not enough without libMoltenVK.dylib. This is why LWJGL bundles libMoltenVK.dylib directly. It’s also more efficient, because it avoids an extra indirection on each Vulkan function call (see Best Application Performance Setup for details).
What happens in your case is this:
LWJGL finds libMoltenVK.dylib in natives/mac, tries to load it and fails (the error is suppressed).
LWJGL finds libvulkan.1.dylib in natives/mac, loads it successfully and configures GLFW to load it from there.
GLFW loads the Vulkan loader, but the loader cannot find a working ICD, so you get the failed to find list of required Vulkan extensions error.
Thank you very much!
Your help was very appreciated. At least this already helped somebody (other than me) and gave you something to consider (if you hadn’t had the intention to express the currently silently captured library loading failed error already).