NetLogo / NetLogo

turtles, patches, and links for kids, teachers, and scientists
http://ccl.northwestern.edu/netlogo/
1.02k stars 246 forks source link

Incompatible JOGL library shipped with Linux(?) #1699

Closed TheBizzle closed 3 years ago

TheBizzle commented 5 years ago

A user wrote in and mentioned that, on Linux, running the 'NetLogo 3D' was failing to launch NetLogo, and giving this output instead:

NetLogo Error invoking method. NetLogo Failed to launch JVM

I can confirm that I'm seeing the same behavior on Linux, and that there is no problem in this regard when trying to launch NetLogo 3D on Windows. All of the other Linux NetLogo executables for 6.0.4 work for me, just not the NetLogo 3D one. It looks like the NetLogo 3D executables for 6.0.0, 5.3.1, and 5.3.0 all fail to load, as well. However, NetLogo 5.2.1's 'netlogo-headless.sh' works perfectly fine for me. It seems that this problem was introduced in 5.3.0.

I tried to launch NetLogo 3D for 6.0.4 by using this modified version of netlogo-headless.sh:

cd "`dirname "$0"`"
java -Djava.library.path=./natives -Djava.ext.dir= -XX:MaxPermSize=128m -Xmx1024m -Dfile.encoding=UTF-8 -Dorg.nlogo.is3d=true -jar netlogo-6.0.4.jar "$@"

I got this error:

Caused by: java.lang.InternalError: XXX0 profile[1]: GL3bc -> profileImpl GL4bc !!! not mapped at com.jogamp.opengl.GLProfile.computeProfileMap(GLProfile.java:2071) at com.jogamp.opengl.GLProfile.initProfilesForDeviceCritical(GLProfile.java:1924) at com.jogamp.opengl.GLProfile.initProfilesForDevice(GLProfile.java:1875) at com.jogamp.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1843) at com.jogamp.opengl.GLProfile.access$000(GLProfile.java:80) at com.jogamp.opengl.GLProfile$1.run(GLProfile.java:230) at java.base/java.security.AccessController.doPrivileged(Native Method) at com.jogamp.opengl.GLProfile.initSingleton(GLProfile.java:216) at com.jogamp.opengl.GLProfile.getProfileMap(GLProfile.java:2297) at com.jogamp.opengl.GLProfile.get(GLProfile.java:988) at com.jogamp.opengl.GLProfile.get(GLProfile.java:1004) at org.nlogo.gl.view.View.createCanvas(View.scala:47) at org.nlogo.gl.view.View.(View.scala:39) at org.nlogo.gl.view.ObserverView.(ObserverView.scala:8) at org.nlogo.gl.view.ObserverView.(ObserverView.scala:11) at org.nlogo.gl.view.ViewManager.init(ViewManager.scala:62) at org.nlogo.gl.view.ViewManager.open(ViewManager.scala:42) at org.nlogo.window.GUIWorkspace.open3DView(GUIWorkspace.java:743) at org.nlogo.window.GUIWorkspace.handle(GUIWorkspace.java:730) at org.nlogo.window.Events$AfterLoadEvent.beHandledBy(Events.java:138) at org.nlogo.window.Event.doRaise(Event.java:198) at org.nlogo.window.Event.raise(Event.java:122) at org.nlogo.window.ReconfigureWorkspaceUI$Loader.$anonfun$loadHelper$5(ReconfigureWorkspaceUI.scala:40) at org.nlogo.window.ReconfigureWorkspaceUI$Loader.$anonfun$loadHelper$5$adapted(ReconfigureWorkspaceUI.scala:40) at scala.collection.immutable.List.foreach(List.scala:389) at org.nlogo.window.ReconfigureWorkspaceUI$Loader.loadHelper(ReconfigureWorkspaceUI.scala:40) at org.nlogo.window.ReconfigureWorkspaceUI$.apply(ReconfigureWorkspaceUI.scala:19) at org.nlogo.app.FileManager.org$nlogo$app$FileManager$$runLoad(FileManager.scala:302) at org.nlogo.app.FileManager.openFromModel(FileManager.scala:359) at org.nlogo.app.FileManager.newModel(FileManager.scala:322) at org.nlogo.app.App.loadDefaultModel(App.scala:561) at org.nlogo.app.App.org$nlogo$app$App$$finishStartup(App.scala:443) at org.nlogo.app.App$.$anonfun$mainWithAppHandler$1(App.scala:162) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303) [snip]

If I remove the JOGL library from the place where NetLogo expects to find it, I get a different error altogether about the library being missing (as one would expect). I take that all to mean that there is no problem with finding the libraries, but, once loaded, there is some problem with the libraries themselves.

Checking MD5 hashes on the 'libjogl' files, the Linux libraries (.so files) for JOGL definitely changed between 5.2.0 and 5.3.0, and have been the same since 5.3.0. I think the likeliest culprit of this bug is that we're bundling an incompatible JOGL library on Linux, and have been doing so since 5.3.0.

nicolaspayette commented 5 years ago

NetLogo 3D 6.0.4 works fine for me on Ubuntu 16.04. Happy to provide more info about my system if it can help diagnose the problem.

TheBizzle commented 5 years ago

Interesting....

My Linux system is running Linux Mint 19.1. The same was true for the person who initially reported the bug.

charlesres commented 5 years ago

On Ubuntu 18.04, NetLogo/NetLogo3D binaries work for me with the following versions: 5.1.0, 5.3.1, 6.0, 6.0.2, and 6.0.3. NetLogo/NetLogo3D 6.0.4 fail to invoke the JVM on 18.04 for my machine, though @LaCuneta rendered NetLogo3D on 18.04. I probably have some missing packages or an incorrect path, but I'll test that out along with the netlogo-headless.sh issue. EDIT: NetLogo/NetLogo3D 6.0.4 works for me

charlesres commented 5 years ago

I ran some tests on netlogo-headless.sh and those ran as expected with 2D and 3D models. After that I tried the shellscript java -Djava.library.path=./natives -Djava.ext.dir= -XX:MaxPermSize=128m -Xmx1024m -Dfile.encoding=UTF-8 -Dorg.nlogo.is3d=true -jar netlogo-version.jar "$@" with slight adjustments and was able to get an error from NetLogo with JOGL. This happened until NetLogo 5.2.1 (from 6.0.4 to 5.3.0), which was mentioned earlier. EDIT: For future reference, java -Dorg.nlogo.is3d=true -jar ./netlogo-6.0.4.jar works with the latest

TheBizzle commented 5 years ago

Okay, I've looked into this a bit more. According to this ticket...

This affects all java programs which use OpenGL via jogl in systems with AMD GPU.

The upstream jogl bug report is here: https://jogamp.org/bugzilla/show_bug.cgi?id=1357

It is fixed upstream in jogl 2.3.3

We're currently on JOGL 2.3.2. However, neither Maven Central nor the JOGL website currently list any release after 2.3.2. So fixing this will have to wait until a new version of JOGL becomes available.

LaCuneta commented 3 years ago

As of this commit we're using a pre-release of JOGL that should resolve this issue (in addition to some other issues). I was never able to recreate the original problem to test it out to be sure, but the updated library is included in NetLogo 6.1.2-beta2 if anyone else who is affected can check.

nikitamankovskii commented 3 years ago

Thank you for reply! This is just for information: NetLogo 6.1.2-beta2 - works on Ubuntu 20.04, sometimes getting crushes, but at least it possible to work on it!) about crashes, i will report it, when i will get it again.

LaCuneta commented 3 years ago

The updated JOGL was released with NetLogo 3D 6.2.0, and things appear to work better. If anyone finds they still get the errors listed in the original comment free to note it here and we can re-open this issue.