GLPROFILE freezes

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

GLPROFILE freezes

Roland Schützig
The call to the GLPROFILE singleton to retrieve the Default profile freezes and never returns. I can't even get started with any serious JOGL work (Hello World etc.).
Does anybody know what's wrong here?

The program is simple enough (Kotlin):

import com.jogamp.opengl.*
fun main() {
    val glprofile = GLProfile.getDefault()
    System.out.println("got to this point")
}

It doesn't go beyond the GLProfile.getDefault() call and never returns.
(Allthough I get that infamous  "WARNING: An illegal reflective access operation has occurred, ..." which I have learned to ignore.

My Specs:
- Windows 11 on ThinkPad P 15 Gen 1, Nvidea Quadro RTX 3000 + Intel UHD,
- Installed the "jogamp-all-platforms.7z" following the instructions in "https://jogamp.org/wiki/index.php/Downloading_and_installing_JOGL"
- IDE: IntelliJ, JARs includes as external Libraries (so, it's not like it can't find the GLProfile singleton. It compiles just fine).

Reply | Threaded
Open this post in threaded view
|

Re: GLPROFILE freezes

gouessej
Administrator
Hello

We don't support Optimus and similar technologies, choose the high performance profile so that the best GPU is chosen.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLPROFILE freezes

Roland Schützig
This post was updated on .
Hi Julien. Thanks for coming back promptly.

You brought me on the right track. I simply skipped the inquiry for the default profile and went directly for one of the profiles in GL_PROFILE_LIST_MAX (e.g. "GL2") and it works now.

    val gp: GLProfile = GLProfile.get(GLProfile.GL2)
    val cap: GLCapabilities = GLCapabilities(gp)
    val gc: GLCanvas = GLCanvas(cap)
    ....

Roland
Reply | Threaded
Open this post in threaded view
|

Re: GLPROFILE freezes

gouessej
Administrator
Thank you for the feedback.

By the way, Nvidia provides a GPU affinity API, I mention it in case you really need a smarter solution.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLPROFILE freezes

Roland Schützig
Thanks for the hint. We can close this particular case here.

Just one remark: I wonder what has changed since 2021. At that time I played around with a range of sample programs (drawing triangles etc.) I found in various tutorials. I always started those with a call to GLProfile.getDefault() and it worked fine.

However, I did have that warning, which is gone now.

WARNING: An illegal reflective access operation has occurred
ARNING: Illegal reflective access by com.jogamp.common.os.NativeLibrary$3 (file:/C:/Users/odiep/.m2/repository/org/jogamp/gluegen/gluegen-rt/2.3.1/gluegen-rt-2.3.1.jar) to method java.lang.ClassLoader.findLibrary(java.lang.String)
WARNING: Please consider reporting this to the maintainers of com.jogamp.common.os.NativeLibrary$3
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

It appears to me as if that issue has been resolved by someone by removing the Optimus option entirely.

Reply | Threaded
Open this post in threaded view
|

Re: GLPROFILE freezes

gouessej
Administrator
Do you use the usual --add-opens clauses? The warnings have nothing to do with Optimus, they are related to some reflective accesses reported by Java since its modularization.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLPROFILE freezes

Roland Schützig
No, I haven't ever dealt with this aspect of my Java installation. So, it's just a coincidence and some update of my IntelliJ IDEA IDE and/or the JDK it's using must have happened since 2021 that causes the warning to go away (like setting that option by default).
Anyway, thanks for your help. It's working now fine.
Roland
Reply | Threaded
Open this post in threaded view
|

Re: GLPROFILE freezes

Sven Gothel
Administrator
I mitigated this warning in our latest JogAmp version AFAIK.
Great that it works out now.