Initializing JOGL on a laptop with switchable graphics

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

Initializing JOGL on a laptop with switchable graphics

darkkir3
Hello,

When trying to initialize JOGL on my laptop with two graphics devices (internal is Intel HD Graphics 520, secondary is AMD Radeon R7 M360), I get an exception saying there is a problem with shared resources. I setup my application to use the radeon gpu via the radeon settings which seems to run fine. I couldn't detect any issues when running the application this way though.

---
Caught handled GLException: EGLGLXDrawableFactory - Could not initialize shared resources for WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[obj 0x14d34a7]] on thread main-SharedResourceRunner
    [0]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createSharedResource(EGLDrawableFactory.java:518)
    [1]: jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:353)
    [2]: java.lang.Thread.run(Unknown Source)
Caused[0] by InternalError: Nil surface but claimed to be valid: EGLSurface[ displayHandle 0x1dfcdb18
, surfaceHandle 0x0
, size 64x64
, UOB[ OWNS_SURFACE | OWNS_DEVICE ]
, EGLGraphicsConfiguration[DefaultGraphicsScreen[EGLGraphicsDevice[type .egl, v1.4.0, connection decon, unitID 0, handle 0x1dfcdb18, owner true, NullToolkitLock[obj 0x14d34a7]], idx 0],
        eglConfigHandle 0x1d52cb70, eglConfigID 0x9,
        requested GLCaps[rgba 5/5/5/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, one, mono  , hw, GLProfile[GLES2/GLES2.hw], on-scr[.]],
        chosen    GLCaps[egl cfg 0x9, vid 0x8: rgba 8/8/8/8, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GLES2/GLES2.hw], on-scr[.], [0x4d: GL, GLES1, GLES2, GLES3, VG]]]
, surfaceLock <11455f, 1f01e9>[count 0, qsz 0, owner <NULL>]
, EGLUpstreamSurfaceHook[ 64x64, jogamp.nativewindow.windows.GDISurface: 0x0]
, upstreamSurface true ] on thread main-SharedResourceRunner
    [0]: jogamp.opengl.egl.EGLDrawable.destroyHandle(EGLDrawable.java:93)
    [1]: jogamp.opengl.GLDrawableImpl.setRealized(GLDrawableImpl.java:196)
    [2]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.mapAvailableEGLESConfig(EGLDrawableFactory.java:863)
    [3]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createEGLSharedResourceImpl(EGLDrawableFactory.java:613)
    [4]: jogamp.opengl.egl.EGLDrawableFactory$SharedResourceImplementation.createSharedResource(EGLDrawableFactory.java:516)
    [5]: jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:353)
    [6]: java.lang.Thread.run(Unknown Source)
Reply | Threaded
Open this post in threaded view
|

Re: Initializing JOGL on a laptop with switchable graphics

gouessej
Administrator
Hello

I'm not sure that this problem is caused by the presence of two GPUs.

Just as a reminder, what you do is fine, most softwares using OpenGL are unable to handle a change of GPU at runtime, disabling Optimus or similar technologies by choosing which GPU to use is the way to go.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Initializing JOGL on a laptop with switchable graphics

darkkir3
Since it does not involve any issues in the application itself it seems to be fine. Just wanted to check in case I did something wrong there. Thank you for the quick reply.
Reply | Threaded
Open this post in threaded view
|

Re: Initializing JOGL on a laptop with switchable graphics

gouessej
Administrator
You're welcome. It just tries to use EGL and it fails.
Julien Gouesse | Personal blog | Website