OpenGL ES Errors with Unity 5.1.0f3 and Adreno GPUs

Hi,

I have two weird bugs with Unity Android with Adreno GPUs.
Both lead to bad performance in rendering jobs.

First issue:

  • OpenGL ES 3.0 cannot be initialized properly
  • Unity Android settings: (see attached image)
  • ADB Logs:
// Appears 2 times
06-13 11:59:04.893  29180-29199/com.Gaminho.RKWCDev W/Adreno-EGL﹕ <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
// Appears 16 times
06-13 11:59:04.912  29180-29199/com.Gaminho.RKWCDev W/Adreno-EGL﹕ <qeglDrvAPI_eglGetConfigAttrib:606>: EGL_BAD_CONFIG
06-13 11:59:04.913  29180-29199/com.Gaminho.RKWCDev E/Unity﹕ [EGL] eglGetConfigAttrib(): EGL_BAD_CONFIG: An EGLConfig argument does not name a valid EGL frame buffer configuration.
    (Filename: ./Runtime/GfxDevice/egl/ConfigEGL.cpp Line: 163)
// Appears 1 time
06-13 11:59:05.202  29180-29199/com.Gaminho.RKWCDev W/libc﹕ pthread_create sched_setscheduler call failed: Operation not permitted
  • Profile Timeline (see attached image)

When I remove the OpenGLES3 API from the list, the logs and the profile changes:
Log:

// Appears 2 times
06-13 11:59:04.893  29180-29199/com.Gaminho.RKWCDev W/Adreno-EGL﹕ <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
// Appears 1 time
06-13 11:59:05.202  29180-29199/com.Gaminho.RKWCDev W/libc﹕ pthread_create sched_setscheduler call failed: Operation not permitted

Profiler Timeline: (see attached image)

Consequence:

  • CPU is too busy

Second issue:

  • OpenGL ES context is invalid in multithreaded rendering
  • Unity Android settings: Same as before with (multithreaded rendering: true, and without OpenGLES3)
  • ADB Logs:
// Appears 2 times
06-13 12:23:13.008  29838-29872/com.Gaminho.RKWCDev W/Adreno-EGL﹕ <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
// Appears 1 time
06-13 12:23:13.191  29838-29872/com.Gaminho.RKWCDev W/libc﹕ pthread_create sched_setscheduler call failed: Operation not permitted
// Appears 1 time
06-13 12:23:14.759  29838-29872/com.Gaminho.RKWCDev E/libEGL﹕ call to OpenGL ES API with no current context (logged once per thread)
  • Profile Timeline (see attached image)

Consequence:

  • GPU is too busy

Desktop configuration:

  • MacBook Pro (Retina, 15-Inch, Mid 2014)
  • Unity 5.1.0f3

Android mobiles with issues (so far):

  • Motorola moto e (Adreno 302)
  • Archos Helium 4G (Adreno 305)

1 Like

Hey, my problem could be related to this.

My tablet has the Adreno 305 GPU.

Yes this may be related, as the GfxWaitForPresent means that the CPU is waiting for the GPU to complete.
So if the GPU takes more time, it will be the case.

An issue in 5.1 maybe ?

Could be. I try to get some adb logs today. Did you just run adb logcat?

UPDATE:
ADB Logcat shows a significant incease of the following Log Message in the 5.1 build:

[SurfaceView] dequeueBuffer: min undequeued buffer count (1) exceeded (dequeued=2 undequeudCount=0)

In the 5.0 build it appears from time to time but in the 5.1 build it repeats constantly.

Well, I used the Android studios’ logs to get the adb’s logs.

I hope this issue gets patched, any you guys sent a bug report to Unity?

Not yet, I am currently in a rush.

I have got this same error. A metric shit ton of problems occur in Runtime/GfxDevice/egl/ConfigEgl.cpp.

Are you going to make a bug report? Would be great.

@fredpointzero , thanks for the the detailed post.
First regarding performance, the main reason for bad performance in ES 3 is probably caused by Rendering Path “Deferred”. With ES 2 we should fall back to “Forward”, which is much faster.

The “eglGetConfigAttrib” warnings by the Adreno driver are caused Unity’s probing of supported OpenGL ES versions, so some of them are normal.
But the error log by Unity itself could be a real issue.
And “call to OpenGL ES API with no currentcontext (logged once per thread)” is also most likely a bug in Unity.

1 Like

@florianpenzkofer , You are welcome ! It is always easier to investigate with some info :wink:

Well, I’ll try with Forward rendering pipeline with OpenGLES 2.

We are trying to push forward graphics in our games, even on low and mid devices. This is kind of frustrating ><.
I hope there will be a fix soon !

Not sure if I understand… what kind of fix would you like to see? Better deferred rendering performance on mobile in general? Or did I miss something? :slight_smile:
‘call to OpenGL ES API with no currentcontext(logged once per thread)’ will get fixed in a patch release.

I think deferred on mobile is problematic, mostly because of limited bandwidth and high resolutions. GPU features like pixel local storage might solve this but it will take a while until this is available on low- and mid-end devices.

You’re right, I was not clear in my reply.

I am looking forward to the patch fixing the ‘call to OpenGL ES API with no currentcontext(logged once per thread)’ issue, so we can use OpenGLES 3 on those devices.

Using deferred on such devices was an experiment and I was pretty sure I would have to use forward rendering for low and mid end devices.

But still, using OpenGLES 3 should have better performance ^^.