title: Android Emulator and OpenGL ES3: EGL_BAD_CONFIG
body: <p>I am running an <a href="https://developer.android.com/studio/run/managing-avds.html" rel="noreferrer">Android Virtual Device</a> on my Ubuntu host.
  It is using the CPU/ABI Intel Atom (x86) and I am using the host GPU.
  The emulator is using a <a href="https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine" rel="noreferrer">Kernel-based Virtual Machine</a>.</p>
  
  <p><a href="https://i.stack.imgur.com/GvtEV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GvtEV.png" alt="settings used"></a></p>
  
  <p>This works splendidly as long as I use an OpenGL ES2 context.
  If my app attempts to create an OpenGL ES3 context however, using...</p>
  
  <pre><code>const EGLint contextAttribs[] = {
      EGL_CONTEXT_CLIENT_VERSION, 3,
      EGL_NONE
  };
  context = eglCreateContext(display, config, NULL, contextAttribs);
  </code></pre>
  
  <p>...then I get an <strong>EGL_BAD_CONFIG</strong> error:</p>
  
  <pre><code>I/biplane ( 2839): EGL: vendor Android version 1.4 Android META-EGL
  I/biplane ( 2839): EGL: client apis OpenGL_ES
  I/biplane ( 2839): number of EGL configurations that match our preferred criteria: 1
  I/biplane ( 2839): R8 G8 B8 A8 DEPTH24
  E/EGL_emulation( 2839): tid 2852: eglCreateContext(919): error 0x3005 (EGL_BAD_CONFIG)
  </code></pre>
  
  <p>Requesting ES3 on a hardware mobile device, works well.
  But when requesting it from the emulator, it fails.
  The host machine is perfectly capable of doing OpenGL ES3.0, ES3.1 and ES3.2 as can be seen from glxinfo:</p>
  
  <pre><code>$ glxinfo | grep ES3
      GL_ARB_ES2_compatibility, GL_ARB_ES3_1_compatibility, 
      GL_ARB_ES3_2_compatibility, GL_ARB_ES3_compatibility, 
      GL_NV_ES3_1_compatibility, GL_NV_bindless_multi_draw_indirect, 
      GL_ARB_ES2_compatibility, GL_ARB_ES3_1_compatibility, 
      GL_ARB_ES3_2_compatibility, GL_ARB_ES3_compatibility, 
      GL_NV_ES3_1_compatibility, GL_NV_bindless_multi_draw_indirect, 
  </code></pre>
  
  <p>Is there a way to run OpenGL ES3 apps on an Android Virtual Device on top of kvm?</p>