Apple Silicon build help

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Apple Silicon build help

0x241B
Hi all,

I am currently attempting to get an open source project, Constellation, that uses JOGL to work on Apple MacBooks.

It already faced the problem other apps had with the changes in MacOS Ventura. OS menus in-app menus stopped appearing after a new OpenGL instance was created. To try fix this I have been looking to update the project's OpenGL-related packages (JOGL, JOCL, Gluegen-rt, nativewindow, and newt) JAR files to newer versions, but am having trouble getting them to work.

I'm using the zulu11.48.21-ca-fx-jdk11.0.11-macosx_aarch64 JDK to build the application.

What I've tried:
- The JogAmp 2.4.0 release in Maven, as well as the 2.5.0 builds, to no luck.
- Martin's Apple Silicon builds, with no luck.


I hit the following error when opening a new graph and wanted to see whether this is an obvious issue or something that would require a lot more time and expertise.



com.jogamp.opengl.GLException: Thread[AWT-EventQueue-0,6,main] glGetError() returned the following error codes after a call to glGenTextures(<int> 0x1, <[I>, <int> 0x0): Unknown glGetError() return value: ( 1286 0x506),

com.jogamp.opengl.DebugGL4bc.writeGLError(DebugGL4bc.java:31781)
com.jogamp.opengl.DebugGL4bc.glGenTextures(DebugGL4bc.java:6366)
au.gov.asd.tac.constellation.visual.opengl.utilities.SharedDrawable.init(SharedDrawable.java:107)
au.gov.asd.tac.constellation.visual.opengl.utilities.SharedDrawable.getSharedAutoDrawable(SharedDrawable.java:182)
au.gov.asd.tac.constellation.visual.opengl.renderer.GLVisualProcessor.initialise(GLVisualProcessor.java:208)
au.gov.asd.tac.constellation.utilities.visual.VisualProcessor.startVisualising(VisualProcessor.java:150)
au.gov.asd.tac.constellation.graph.interaction.visual.GLInteractiveVisualManagerFactory.constructVisualManager(GLInteractiveVisualManagerFactory.java:60)
au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphTopComponent.<init>(VisualGraphTopComponent.java:450)
au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener$GraphFileOpener.done(VisualGraphOpener.java:318)
java.desktop/javax.swing.SwingWorker$5.run(SwingWorker.java:750)
java.desktop/javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:847)
java.desktop/sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
java.desktop/javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingWorker.java:857)
java.desktop/javax.swing.Timer.fireActionPerformed(Timer.java:317)
java.desktop/javax.swing.Timer$DoPostEvent.run(Timer.java:249)
java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
java.base/java.security.AccessController.doPrivileged(Native Method)
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Reply | Threaded
Open this post in threaded view
|

Re: Apple Silicon build help

Sven Gothel
Administrator
Please test using latest 2.5.0 RC
https://forum.jogamp.org/Release-2-5-0-tp4042507p4042831.html

Send jogamp.txt to here (attach as file), produced via:
java -jar jogamp-fat.jar 2>&1 | tee jogamp.txt

And / or perhaps run the script ..
https://jogamp.org/cgit/jogl.git/tree/make/scripts/test-fat-jars.sh
(have a look at it beforehand please)

+++

Issue-01: "OS menus in-app menus stopped appearing after a new OpenGL instance was created"
I am not aware of this issue, I also tested on MacOS 13.1
Please describe this issue in more detail.

With above produced JogAmp info log files
and your additional OS version (in detail)
and a detailed description, we might can resolve it.

Would be great if I can reproduce the issue here as well.
Hence attach a most small little demo code (don't dump in post please)

Later we can open a bug report, or can do this right away if you like.
But then please send me your real world name and use a 'proper email' address,
thank you!

+++

Issue-02: zulu11.48.21-ca-fx-jdk11.0.11-macosx_aarch64
Its curious, you are the 2nd user using this OpenJDK build.

Please test with Adoptium's OpenJDK17 as well.
Lately I have tested
- OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.8_7.pkg  
- OpenJDK17U-jdk_x64_mac_hotspot_17.0.8_7.pkg
via https://adoptium.net/temurin/releases/

Reply | Threaded
Open this post in threaded view
|

Re: Apple Silicon build help

Sven Gothel
Administrator
copied from https://forum.jogamp.org/Release-2-5-0-tp4042507p4042853.html
Some test-fat-jars.sh logs ... all working w/ OpenJDK11 + 17, adoptium + zulu

(Currently only for macos 13.1 aarch64 as there are some reports)
https://jogamp.org/deployment/archive/rc/v2.5.0-rc-20230813/test-fat-jars.logs/
Reply | Threaded
Open this post in threaded view
|

Re: Apple Silicon build help

0x241B
In reply to this post by Sven Gothel
Hi Sven, thanks for your prompt reply here!

I have downloaded the latest 2.5.0 RC, please find the jogamp.txt output attached.

Issue-01: It's an odd one, I found a few other applications having this issue, perhaps it's not related to OpenGL but it only happens after I open a new graph/instantiate OpenGL. Here are a couple of other projects with the same issue: https://github.com/eclipse-platform/eclipse.platform.swt/issues/256
and
https://forum.step.esa.int/t/toolbar-issue-on-macos-ventura/37760

My OS version is: Ventura 13.4 on an Apple M1 MacBook Air.

Issue-02: I have tried to use Adoptium's JDK 11 (that's what the Constellation project is built with) but the build is unfortunately failing. I believe this is because Adoptium doesn't come with JavaFX.


jogamp.txt
Reply | Threaded
Open this post in threaded view
|

Re: Apple Silicon build help

Sven Gothel
Administrator
(your name please, I am too old to talk w/ hex-numbers :)

Please complete the test, i.e. also run the standalone demos as shown in the script.

As you saw, I also tested one demo (NEWT only) on MacOS 13.1 w/ all JDKs, OK.

Just for confirmation .. thank you.
At least then we know JogAmp works well :)

+++

So it seems to be an SWT issue?
Which SWT version are you using?
Eclipse 2022-06 is probably what we have tested, SWT 4.26
- Eclipse 4.26.0 Release Build: 4.26
- https://download.eclipse.org/eclipse/downloads/drops4/R-4.26-202211231800/

I already prepared to test SWT 4.29M1 (now in stable for this years release)

In case this is an SWT issue w/ said MacOS version .. well ..

EDIT: Yup, they confirmed this is an SWT issue
https://github.com/eclipse-platform/eclipse.platform.swt/issues/256
This has also been reported here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=580322

An interesting comment there is that "Eclipse 2022.03 works just fine". @turesheim Can you confirm that?
+++

Your remark regarding Issue-02 .. not getting it fully, but doesn't matter as it is not related to the Azul build
of OpenJDK (zulu).

Note: I used today's latest builds, hence a slightly newer version than your OpenJDK zulu build.
But shall not really matter I guess.


Reply | Threaded
Open this post in threaded view
|

Re: Apple Silicon build help

Sven Gothel
Administrator
Sigh, with every new macOS version they introduce new trouble
.. chuckles .. I agree :-/
Reply | Threaded
Open this post in threaded view
|

Re: Apple Silicon build help

0x241B
In reply to this post by Sven Gothel
Sorry Sven, my name is Thomas.

I have run the full script, please find it attached. It looked like all the tests ran fine and Jogamp is running well. It must be something in the application's code itself.

jogamp-next.log

On SWT, the only references to SWT I can see is:
               
<package>com.jogamp.nativewindow.swt</package>
<package>com.jogamp.newt.swt</package>
<package>com.jogamp.opengl.swt</package>
<package>jogamp.newt.swt</package>
<package>jogamp.newt.swt.event</package>

But I'm unfamiliar with what SWT is and unsure how to find what version I'm using (if this project is using it at all?)

On Issue-02, I tried to build the Constellation application using the Adoptium JDK but had no luck. I think I was misinterpreting what you said, apologies.
Reply | Threaded
Open this post in threaded view
|

Re: Apple Silicon build help

Sven Gothel
Administrator
Thank you Thomas!

So good news, JogAmp works on your system,
at least regarding NEWT and our newt GraphUI.
OK.

I glanced at your app Constellation,
very interesting - maybe add a JogAmp link on your site?
I should do that on the JOGL app page I guess.

If your app uses SWT, it probably is the issue as stated there.

If you app does not SWT, ask your team what are you using for UI menus etc.
Perhaps that toolkit (AWT, Swing or OpenJFX) has a similar bug?
Or is the bug only visible _after_ using a JOGL feature?

OS menus in-app menus stopped appearing after a new OpenGL instance was created
 (quote from your top post)

If this is the case, we might cause the hickup.
To investigate:
- Which UI toolkit do you use?
- Can you produce a tiny test application demonstrating the issue
- Please add build + launch/run script

Then I will transfer this issue to our bugzilla, reproduce and so forth ..

Thank you.

~Sven
Reply | Threaded
Open this post in threaded view
|

Re: Apple Silicon build help

Sven Gothel
Administrator
https://github.com/constellation-app/constellation/tree/master/CoreViewFramework/src/au/gov/asd/tac/constellation/views

Looks like the app is using either Swing or OpenJFX (hence the Zulu + JFX) for their UI.
Hmm .. I would test with the Swing variant if available and
compare with OpenJFX.

Then if isolated, let's produce a simple test case with and without using JOGL.
If it only fails with JOGL usage .. I guess I should fix it,
even though I am not sure yet how we possible interact with the OS menu :)