Apple Silicone, OpenAL and OpenGL issues

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.

EDIT 2: There is currently an issue open for this: https://github.com/LWJGL/lwjgl3/issues/601

1 Like

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.

I have run it both ways with the arm java and x86 java.

Where would I tell what version of LWJGL I am using? I am using the 3.2 stable set of Binaries.

There is no error dump when I run the program with the x86 Java.

I am using AdoptOpenJDK 11

As you can see in the image it does not look correct.

What would the steps be to change to LWJGL 3?

When i run on an intel mac with the x86 It looks correct.

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 am using jme3-lwjgl, I dont have an option for jme3-lwjgl3.
Where is the download for jme3lwjgl3?

In my settings I am using AppSettings.LWJGL_OPENGL3.

Do you know which version of 3.2 you are using, is it 3.2.4?

I downloaded just the 3.2. I can install any version that you think would be best and go from there.

I am just trying to get it to work.

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.

@dm1056 you may want to attempt to migrate to jme 3.3. Keep in mind, there will be some code changes required when doing this.

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.

Are you using the jme-lwjgl3 jar inplace of the jme-lwjgl jar?