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

Problem with pyopengl !!! #86

Closed
v-wewei opened this issue Dec 4, 2019 · 9 comments
Closed

Problem with pyopengl !!! #86

v-wewei opened this issue Dec 4, 2019 · 9 comments

Comments

@v-wewei
Copy link

v-wewei commented Dec 4, 2019

Hi, @mmatl
i seem to always get the problem below,
Traceback (most recent call last):
File "test.py", line 31, in
r = pyrender.OffscreenRenderer(640, 480)
File "/home/v-wewei/anaconda3/envs/sdmaskrcnn/lib/python3.6/site-packages/pyrender/offscreen.py", line 32, in init
self._create()
File "/home/v-wewei/anaconda3/envs/sdmaskrcnn/lib/python3.6/site-packages/pyrender/offscreen.py", line 129, in _create
self._platform.init_context()
File "/home/v-wewei/anaconda3/envs/sdmaskrcnn/lib/python3.6/site-packages/pyrender/platforms.py", line 148, in init_context
EGL_NO_CONTEXT, context_attributes
File "/home/v-wewei/anaconda3/envs/sdmaskrcnn/lib/python3.6/site-packages/OpenGL/platform/baseplatform.py", line 402, in call
return self( *args, **named )
File "/home/v-wewei/anaconda3/envs/sdmaskrcnn/lib/python3.6/site-packages/OpenGL/error.py", line 232, in glCheckError
baseOperation = baseOperation,
OpenGL.error.GLError: GLError(
err = 12297,
baseOperation = eglCreateContext,
cArguments = (
<OpenGL._opaque.EGLDisplay_pointer object at 0x7ff8c4d6ee18>,
<OpenGL._opaque.EGLConfig_pointer object at 0x7ff8c4d6ed90>,
<OpenGL._opaque.EGLContext_pointer object at 0x7ff8c4da0b70>,
<OpenGL.arrays.lists.c_int_Array_7 object at 0x7ff8af5c9048>,
),
result = <OpenGL._opaque.EGLContext_pointer object at 0x7ff8c4902e18>
)

could you help to give me the solution for this opengl problem?
Thanks advance.

@ahangchen
Copy link

I met this problem too. any solution?

@v-wewei v-wewei closed this as completed Dec 8, 2019
@v-wewei
Copy link
Author

v-wewei commented Dec 8, 2019

i found this problem cas caused by the mistake when i install the nvidia-driver, reinstall the driver make everything works as expected.

@lisa676
Copy link

lisa676 commented Feb 24, 2020

@v-wewei How you install new driver? From run file?

@MengXinChengXuYuan
Copy link

@v-wewei I also met this, are you running the code on a server machine?
And I just don't understand, what mistake can be made installing the nvidia-driver ? :(

@v-wewei
Copy link
Author

v-wewei commented Mar 17, 2020

@lan786 @MengXinChengXuYuan
i run my program on a local machine , not on a remote server.
i install the nvidia-driver with openGL installed, then i am able to overcome this problem. sorry for so late to reply your question. Also you need to check the version with opengl with cm: "glxinfo | grep OpenGL" for the machine. you can have a try if you miss some of the step above.
Best wish !

@lcit
Copy link

lcit commented Jan 26, 2021

I run into this problem on a kubernetes pod running Ubuntu 18.04.5 LTS. I assume Nvidia driver are installed correctly as I can use GPU computation and nvidia-smi.

The error is EGL_BAD_MATCH=12297 and it is thrown by eglCreateContext. This function in my case was called here

self._egl_context = eglCreateContext(

after several attempts I found that the problem was the OpenGL version. For some reason by default the machine was running version 3.3 but pyrender expects version 4.1 as for here:

EGL_CONTEXT_MAJOR_VERSION, 4,

in theory my machine should have access to OpenGL 4.x but the version used is 3.3 (you can check with glxinfo). To fix this I had to use this macro in front of the script to run MESA_GL_VERSION_OVERRIDE=4.1 python code.py

At this point I had another problem. My machine for some reason has GL_MAX_SAMPLES=1 which seems to be the upperbound on the number of samples for multisampling. In pyrender the number of samples is set to 4 in both line 1091 and 1096:

glRenderbufferStorageMultisample(

I had to change these two to 1.

I have no clue why GL_MAX_SAMPLES is just 1. Should be much higher.

@ALLinLLM
Copy link

@lcit Thanks! it works for me!

@fabioo29
Copy link

fabioo29 commented May 5, 2021

@lcit thanks a lot! It works now!

@BrianG13
Copy link

@lcit Thanks for your post! This solved all my issues in order to render over GPU

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

8 participants