We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2616

Summary: Failed creating opengles renderer
Product: SDL Reporter: Sylvain <sylvain.becker>
Component: renderAssignee: Gabriel Jacobo <gabomdq>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: log.txt

Description Sylvain 2014-06-29 17:23:22 UTC
On linux, 

It failed creating a renderer opengles.

I got an error from SDL_CreateRenderer :

"Could not create GL context GLXBadProfileARB"

(That happens in X11_GL_CreateContext)
Comment 1 Sylvain 2014-06-30 07:04:54 UTC
problem seems to be introduced by the common EGL code: https://hg.libsdl.org/SDL/rev/ac4ce59c40e7
Comment 2 Gabriel Jacobo 2014-06-30 14:43:26 UTC
It works for me on Ubuntu 14.04, nVidia and Mesa drivers with testrendercopyex. Can you specify which system you get this with ?
Comment 3 Sylvain 2014-06-30 14:50:37 UTC
I tried the test case from this ticket and also with my app (only rendered opengles 1 is not creating!)

https://bugzilla.libsdl.org/show_bug.cgi?id=2421

I have also ubuntu 14.04 !
And a recent laptop with inegrated graphic card: NVIDIA Optimus Graphics (NVS 5400M, 1GB)
Comment 4 Gabriel Jacobo 2014-06-30 14:54:39 UTC
Can you try "testrendercopyex --renderer opengles" ?

Also, what do you get from: glxinfo | grep es2

I get:
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile, 
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile, 
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
Comment 5 Sylvain 2014-06-30 14:58:33 UTC
I give you the information in a couple of hours !
Comment 6 Sylvain 2014-06-30 16:59:54 UTC
glxinfo | grep es2, is a little different :
    GLX_EXT_create_context_es2_profile, GLX_EXT_framebuffer_sRGB, 
    GLX_EXT_create_context_es2_profile, GLX_EXT_fbconfig_packed_float, 
    GLX_EXT_create_context_es2_profile, GLX_EXT_framebuffer_sRGB, 


./testrendercopyex --renderer opengles
is not working. And fails the same way as my other app.

Error message I got is : "Couldn't create renderer: Unknown OpenGL context profile 32649"

the word "GLXBadProfileARB" comes from error handler "x11_error_locale".
(src/video/x11/SDL_x11opengl.c)


(Seems a still the pb with locale conversion).
Comment 7 Sylvain 2014-06-30 17:19:09 UTC
ignore the "locale" stuff.

I have the two errors in cascade : 

Could not create GL context: GLXBadProfileARB
Couldn't create renderer: Unknown OpenGL context profile 32540


see the attached file logging all : 

./testrendercopyex --renderer opengles --log all
Comment 8 Sylvain 2014-06-30 17:19:39 UTC
Created attachment 1717 [details]
log.txt
Comment 9 Gabriel Jacobo 2014-06-30 17:21:02 UTC
Comment out https://hg.libsdl.org/SDL/file/8ca9ce569f65/src/video/x11/SDL_x11opengl.c#l388

And let me know if that solves the problem.
Comment 10 Sylvain 2014-06-30 17:25:06 UTC
yes,  if I comment this line, it works !
Comment 11 Gabriel Jacobo 2014-06-30 17:39:12 UTC
Do you use nvidia's binaries? which version? We were assuming having the GLX_EXT_create_context_es2_profile extension is enough to create a ES context, it seems that's not the case.
Gotta love cross platform development, even on the same architecture with the same drivers, you still have problems :)
Comment 12 Sylvain 2014-06-30 17:46:40 UTC
I am not sure of what I have :) I don't remember to have been to nvidia downloading it !
Below is the list of packages.

Also, my SDL lib is compiled with renderer : software/opengl/opengles/opengles2
(software/opengl/opengles2) are working correctly.

I am reporting the problem only because of the other ticket of rendercopyex issue!



Building Shared Libraries
Building Static Libraries
Enabled modules : atomic audio video render events joystick haptic power filesystem threads timers file loadso cpuinfo assembly
Assembly Math   : mmx 3dnow sse sse2
Audio drivers   : disk dummy oss alsa(dynamic) pulse(dynamic) nas(dynamic)
Video drivers   : dummy x11(dynamic) opengl opengl_es1 opengl_es2 mir(dynamic) wayland(dynamic)
X11 libraries   : xcursor xinerama xinput2 xinput2_multitouch xrandr xscrnsaver xshape xvidmode
Input drivers   : linuxev linuxkd
Using libudev   : YES
Using dbus      : YES
Using ibus      : NO



$> dpkg -l | grep nvidia
ii  nvidia-common                                         1:0.2.91.5                                          amd64        transitional package for ubuntu-drivers-common
ii  nvidia-libopencl1-331-updates                         331.38-0ubuntu7                                     amd64        NVIDIA OpenCL Driver and ICD Loader library

$> dpkg -l | grep mesa  
ii  libegl1-mesa:amd64                                    10.1.3-0ubuntu0.1                                   amd64        free implementation of the EGL API -- runtime
ii  libegl1-mesa-dev                                      10.1.3-0ubuntu0.1                                   amd64        free implementation of the EGL API -- development files
ii  libegl1-mesa-drivers:amd64                            10.1.3-0ubuntu0.1                                   amd64        free implementation of the EGL API -- hardware drivers
ii  libgl1-mesa-dev                                       10.1.3-0ubuntu0.1                                   amd64        free implementation of the OpenGL API -- GLX development files
ii  libgl1-mesa-dri:amd64                                 10.1.3-0ubuntu0.1                                   amd64        free implementation of the OpenGL API -- DRI modules
ii  libgl1-mesa-dri:i386                                  10.1.3-0ubuntu0.1                                   i386         free implementation of the OpenGL API -- DRI modules
ii  libgl1-mesa-glx:amd64                                 10.1.3-0ubuntu0.1                                   amd64        free implementation of the OpenGL API -- GLX runtime
ii  libgl1-mesa-glx:i386                                  10.1.3-0ubuntu0.1                                   i386         free implementation of the OpenGL API -- GLX runtime
ii  libglapi-mesa:amd64                                   10.1.3-0ubuntu0.1                                   amd64        free implementation of the GL API -- shared library
ii  libglapi-mesa:i386                                    10.1.3-0ubuntu0.1                                   i386         free implementation of the GL API -- shared library
ii  libgles1-mesa:amd64                                   10.1.3-0ubuntu0.1                                   amd64        free implementation of the OpenGL|ES 1.x API -- runtime
ii  libgles1-mesa-dev                                     10.1.3-0ubuntu0.1                                   amd64        free implementation of the OpenGL|ES 1.x API -- development files
ii  libgles2-mesa:amd64                                   10.1.3-0ubuntu0.1                                   amd64        free implementation of the OpenGL|ES 2.x API -- runtime
ii  libgles2-mesa-dev                                     10.1.3-0ubuntu0.1                                   amd64        free implementation of the OpenGL|ES 2.x API -- development files
ii  libglu1-mesa:amd64                                    9.0.0-2                                             amd64        Mesa OpenGL utility library (GLU)
rc  libglu1-mesa:i386                                     9.0.0-1                                             i386         Mesa OpenGL utility library (GLU)
ii  libglu1-mesa-dev                                      9.0.0-2                                             amd64        Mesa OpenGL utility library -- development files
ii  libmirclientplatform-mesa:amd64                       0.1.8+14.04.20140411-0ubuntu1                       amd64        Display server for Ubuntu - client platform library for Mesa
ii  libmirplatformgraphics-mesa:amd64                     0.1.8+14.04.20140411-0ubuntu1                       amd64        Display server for Ubuntu - platform library for Mesa
ii  libopenvg1-mesa:amd64                                 10.1.3-0ubuntu0.1                                   amd64        free implementation of the OpenVG API -- runtime
ii  libwayland-egl1-mesa:amd64                            10.1.3-0ubuntu0.1                                   amd64        implementation of the Wayland EGL platform -- runtime
ii  mesa-common-dev                                       10.1.3-0ubuntu0.1                                   amd64        Developer documentation for Mesa
ii  mesa-utils                                            8.1.0-2                                             amd64        Miscellaneous Mesa GL utilities
Comment 13 Gabriel Jacobo 2014-06-30 19:57:45 UTC
I know the Nvidia Optimus line is tricky to get running properly on Linux, so who know what drivers you are running :)

Anyway, I'll get this particular issue fixed.
Comment 14 Sylvain 2016-10-14 10:43:10 UTC
This issue is probably too old. I don't see it anymore.
Comment 15 Sam Lantinga 2016-10-14 13:46:30 UTC
This appears to have been fixed.