[英]Error in eglInitialize() using PyOpenGl (err = 12296)
I am trying to set up a headless render on my NanoPi M1 Plus with Mali400 GPU using PyOpenGL with EGL.我正在尝试使用带有 EGL 的 PyOpenGL 在带有 Mali400 GPU 的 NanoPi M1 Plus 上设置无头渲染。 When I run eglInitalize I get the following error:
当我运行 eglInitalize 时,出现以下错误:
Error:错误:
File "ferb_gpu_1.py", line 22, in <module>
if not eglInitialize( display, major, minor):
File "/home/fa/berryconda3/lib/python3.6/site-packages/OpenGL/platform/baseplatform.py", line 402, in __call__
return self( *args, **named )
File "/home/fa/berryconda3/lib/python3.6/site-packages/OpenGL/error.py", line 232, in glCheckError
baseOperation = baseOperation,
OpenGL.error.GLError: GLError(
err = 12296,
baseOperation = eglInitialize,
cArguments = (
<OpenGL._opaque.EGLDisplay_pointer object at 0xb603f800>,
c_long(0),
c_long(0),
),
result = 0
)
Here is the code I have written:这是我写的代码:
if not os.environ.get( 'PYOPENGL_PLATFORM' ):
os.environ['PYOPENGL_PLATFORM'] = 'egl'
os.environ['DISPLAY'] = '0.0'
if os.environ.get( 'TEST_NO_ACCELERATE' ):
OpenGL.USE_ACCELERATE = False
display = eglGetDisplay(EGL_DEFAULT_DISPLAY)
if(display == EGL_NO_DISPLAY):
print("Failed to get EGL display! Error: %s", eglGetError())
exit()
major,minor = ctypes.c_long(),ctypes.c_long()
if not eglInitialize( display, major, minor):
print("Unable to initialize")
exit()
The problem was, I was using os.environ['DISPLAY'] = '0.0'
but it should have been os.environ['DISPLAY'] = ':0.0'
.问题是,我使用的是
os.environ['DISPLAY'] = '0.0'
但它应该是os.environ['DISPLAY'] = ':0.0'
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.