Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There are still some problems with 'Headless Rendering' #46

Closed
GraceJary opened this issue Sep 19, 2019 · 7 comments
Closed

There are still some problems with 'Headless Rendering' #46

GraceJary opened this issue Sep 19, 2019 · 7 comments

Comments

@GraceJary
Copy link

run 'export PYOPENGL_PLATFORM='egl'', and then run "ae_train exp_group/my_autoencoder -d"
but it occured to have this error:
OpenGL.error.GLError: GLError(
err = 12297,
baseOperation = eglCreateContext,
cArguments = (
<OpenGL._opaque.EGLDisplay_pointer object at 0x7fec2fd053b0>,
<OpenGL._opaque.EGLConfig_pointer object at 0x7fec2fd05320>,
<OpenGL._opaque.EGLContext_pointer object at 0x7fec2fdc5560>,
<OpenGL.arrays.lists.c_int_Array_7 object at 0x7fec2fd054d0>,
),
result = <OpenGL._opaque.EGLContext_pointer object at 0x7fec2fd057a0>
)

@MartinSmeyer
Copy link
Member

Hi,
1.) Did you change PyOpenGL according to mcfletch/pyopengl#27?
2.) The -d option attempts to open a window for debugging purposes. Is it working without -d?

@GraceJary
Copy link
Author

I changed the egl.py like this:

"""EGL (cross-platform) platform library"""
import ctypes, ctypes.util
from OpenGL.platform import baseplatform, ctypesloader

class EGLPlatform( baseplatform.BasePlatform ):
    try:
        return ctypesloader.loadLibrary(
                ctypes.cdll,
                'OpenGL',
                mode=ctypes.RTLD_GLOBAL
            )
    except OSError:

@MartinSmeyer
Copy link
Member

Okay, good. But if you don't have a display connected, you can't run the code in debugging mode, i.e. with the -d flag. This is also mentioned in the README. Does it run without the flag?

@MartinSmeyer
Copy link
Member

I assume it does, closing the issue for now.

@GabrielQuik
Copy link

GabrielQuik commented Oct 18, 2019

I came upon the same issue, I changed my code to be like in the comment above yet still it doesn't work and nothing changed.
using egl 0% | | 0 / 20000 ETA: --:--:-- libEGL warning: DRI2: failed to authenticate Traceback (most recent call last): File "/home/ros/.local/bin/ae_train", line 11, in <module> load_entry_point('auto-pose==0.9', 'console_scripts', 'ae_train')() File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/ae/ae_train.py", line 87, in main dataset.get_training_images(dataset_path, args) File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/ae/dataset.py", line 92, in get_training_images self.render_training_images() File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/ae/dataset.py", line 244, in render_training_images bgr_x, depth_x = self.renderer.render( File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/ae/utils.py", line 15, in decorator setattr(self, attribute, function(self)) File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/ae/dataset.py", line 75, in renderer float(self._kw['vertex_scale']) File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/meshrenderer/meshrenderer_phong.py", line 18, in __init__ self._context = gu.OffscreenContext() File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/meshrenderer/gl_utils/egl_offscreen_context.py", line 74, in __init__ EGL_NO_CONTEXT, context_attributes File "/home/ros/.local/lib/python2.7/site-packages/OpenGL/platform/baseplatform.py", line 409, in __call__ return self( *args, **named ) File "src/errorchecker.pyx", line 53, in OpenGL_accelerate.errorchecker._ErrorChecker.glCheckError OpenGL.error.GLError: GLError( err = 12297, baseOperation = eglCreateContext, cArguments = ( <OpenGL._opaque.EGLDisplay_pointer object at 0x7f1f05e19ef0>, <OpenGL._opaque.EGLConfig_pointer object at 0x7f1f05e19e60>, <OpenGL._opaque.EGLContext_pointer object at 0x7f1f05e190e0>, <OpenGL.arrays.lists.c_int_Array_7 object at 0x7f1f05915050>, ), result = <OpenGL._opaque.EGLContext_pointer object at 0x7f1f05915320> )

I'm using OpenGL version 4.6.0

@B-Acharya
Copy link

I came upon the same issue, I changed my code to be like in the comment above yet still it doesn't work and nothing changed.
using egl 0% | | 0 / 20000 ETA: --:--:-- libEGL warning: DRI2: failed to authenticate Traceback (most recent call last): File "/home/ros/.local/bin/ae_train", line 11, in <module> load_entry_point('auto-pose==0.9', 'console_scripts', 'ae_train')() File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/ae/ae_train.py", line 87, in main dataset.get_training_images(dataset_path, args) File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/ae/dataset.py", line 92, in get_training_images self.render_training_images() File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/ae/dataset.py", line 244, in render_training_images bgr_x, depth_x = self.renderer.render( File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/ae/utils.py", line 15, in decorator setattr(self, attribute, function(self)) File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/ae/dataset.py", line 75, in renderer float(self._kw['vertex_scale']) File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/meshrenderer/meshrenderer_phong.py", line 18, in __init__ self._context = gu.OffscreenContext() File "/home/ros/.local/lib/python2.7/site-packages/auto_pose/meshrenderer/gl_utils/egl_offscreen_context.py", line 74, in __init__ EGL_NO_CONTEXT, context_attributes File "/home/ros/.local/lib/python2.7/site-packages/OpenGL/platform/baseplatform.py", line 409, in __call__ return self( *args, **named ) File "src/errorchecker.pyx", line 53, in OpenGL_accelerate.errorchecker._ErrorChecker.glCheckError OpenGL.error.GLError: GLError( err = 12297, baseOperation = eglCreateContext, cArguments = ( <OpenGL._opaque.EGLDisplay_pointer object at 0x7f1f05e19ef0>, <OpenGL._opaque.EGLConfig_pointer object at 0x7f1f05e19e60>, <OpenGL._opaque.EGLContext_pointer object at 0x7f1f05e190e0>, <OpenGL.arrays.lists.c_int_Array_7 object at 0x7f1f05915050>, ), result = <OpenGL._opaque.EGLContext_pointer object at 0x7f1f05915320> )

I'm using OpenGL version 4.6.0

Hey I have similar issues , did you manage to fix these errors ?

@saqib1707
Copy link

Hey @B-Acharya , I am facing the same issue as you mentioned above. Did you manage to resolve it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants