I am working on making my app compatible with the new Apple Silicone. When I attempt to run my app Intel based app on the the new M1 processor I am having issues with the renderer not working properly. In the image the yellow should actually be grass turf and the other architecture should be a concrete stadium.
I have been able to locate and install a version of Java that is made for the new apple architecture. However when I attempt to launch I am having issues with liblwjgl.dylib not finding a file for the new apple architecture. I have the same issue with the libopenal.dylib.
I get the following error
Exception in thread “jME3 Main” java.lang.UnsatisfiedLinkError: /Applications/Pyware 3D v10/libopenal.dylib: dlopen(/Applications/Pyware 3D v10/libopenal.dylib, 1): no suitable image found. Did find:
/Applications/Pyware 3D v10/libopenal.dylib: no matching architecture in universal wrapper
/Applications/Pyware 3D v10/libopenal.dylib: no matching architecture in universal wrapper
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627)
at java.base/java.lang.Runtime.load0(Runtime.java:768)
at java.base/java.lang.System.load(System.java:1837)
at com.jme3.system.NativeLibraryLoader.loadNativeLibrary(NativeLibraryLoader.java:683)
at com.jme3.system.lwjgl.LwjglContext.loadNatives(LwjglContext.java:178)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:209)
at java.base/java.lang.Thread.run(Thread.java:834)
Has anyone else had any experience with this?
I am currently building this with 3.2 Stable.
This is the key to your issue. The new Applie Silicone is a ARM processor, not an x86 processor. You need to use arm compiled binaries.
EDIT: I will clarify. These arm binaries will either need to come from lwjgl, or you will need to compile lwjgl osx binaries for arm yourself if they do not yet have them, which last I looked they did not.
With Rosetta the X86 files should still work and they are running however the renderer is not displaying the textures properly. Is there a solution when running the first way where I am using the intel java through rosetta?
—> Can you post the stacktrace for the liblwjgl.dylib?
I do believe that if you are not launching from an application that was launched with Rosetta, that it will not work. Rosetta can run x86 applications because they are using the x86 ABI in MacOS, but when launching a ARM process, I do not believe that Rosetta can translate the x86 ABI to the ARM ABI within a single application. It uses a x86 to ARM API internally to translate the calls to allow a x86 application to run on top of ARM. I have not done any direct development on Rosetta, so I could be wrong, but that is my current understanding. You can run x86 on ARM, not mix a application between x86 and ARM.
Try running using a x86 jdk on Rosetta instead, see if that works. Can you please post the JDK that you are using? Also are you using LWJGL 2 or 3?
EDIT: I think I misunderstood initially, your last post indicates that you are using the x86 jdk with Rosetta? Then please just provide the stack trace for the liblwjgl.dylib, which jdk, and which lwjgl.
Right now I am not able to get Netbeans nor the JME SDK to run properly on the M1 mac without crashing. I am building on my intel imac and moving it over to test.
Is there a way that I can run using the OpenGL 4, the caps dump only shows OpenGL2.1 but when I run an open GL viewer I am showing I can run up to OpenGL4.1.
Are you using jme-lwjgl or jme-lwjgl3? And in your graphics.properties file what is the Renderer(string) set to?
I am going to assume this has to do with the new GPU that is part of the ARM soc no supporting something in the opengl version you are using, apple claims that opengl support is still there but deprecated, so it is unclear how well it will work. This could be caused due to that.
I actually am not seeing lwjgl3 for 3.2.x… I know it was around during that time though… @Darkchaos I do not see jme-lwjgl3 packaged with the SDK, nor the dist from the jme github repo on 3.2 releases. I could have sworn that the SDK had the jme-lwjgl3 jar in it.
I just dropped in JME 3.3.2 and I am having the same issues.
What changes should I have needed to make. It compiled and ran I am just still getting the visual color issues.
Ok, So I have been able to install the version 3 of LWJGL, however I have been unable to make it compile and run. I get a message java.lang.NoClassDefFoundError: org/lwjgl/opengl/GLDebugMessageARBCallbackI.
I attempt to install the LWJGL from their website however it still shows that I am running a 2.9.3 context.
Any input on how to get LWJGL3 to work properly for testing.
I downloaded Minecraft as they also use LWJGL, they are using version 3.2.1 and that render looks correct when running through rosetta.
I am just trying to get the current renderer to work properly on the Apple Silicon.
It seems to be issues with the Shaders, I am not versed enough to fix this, however I am happy to help test if anyone is will to help me take a stab at it.
The dyncall library that lwjgl depends on has experimental support for arm64. Minecraft uses very primitive opengl calls. Perhaps you can try creating a test app using opengl 1.1 in jmonkeyengine and see if the rendering issues still occur, if not, increase the opengl version until they do. Do this on an app that uses phong and unshaded shaders packaged with jme so that we have a base line of basic functionality that is proven to work on old version of opengl.
If a basic rotating color cube rendered with jme does not work in opengl 1.1, and the equivalent test using pure lwjgl works, then perhaps the issue may be in what calls jme is using for rendering, but regardless it is very likely that the issue is not in jme, but more an issue in lwjgl caused by a dyncall binding not working properly in arm64.
To get the lwjgl 3 jars from the website, use their tool: Customize - LWJGL
Keep in mind that there are no jars for arm64 here.
You can also try building lwjgl yourself for arm64, the ci pipeline here is a reference for how to do so, but it will fail at this point in time. Job #1470.9 - LWJGL-CI/glfw - Travis CI (travis-ci.com)
Your best bet is to wait until dyncall has corrected their issues, so that lwjgl can correct theirs.