EGL initialization error
See original GitHub issueHi,
I’ve recently come across the following error, on a machine with Nvidia driver version: 440.33.01 CUDA version: 10.2, when trying to use EGL for headless rendering. The same exact code was running properly on a machine with CUDA Version 10.1 and driver version 390.
Any idea how to fix the issue? I’ve tried reinstalling dm_control with pip.
File "/home/aj/miniconda3/envs/rlpyt/lib/python3.7/site-packages/dm_control/suite/__init__.py", line 28, in <module>
from dm_control.suite import acrobot
File "/home/aj/miniconda3/envs/rlpyt/lib/python3.7/site-packages/dm_control/suite/acrobot.py", line 24, in <module>
from dm_control import mujoco
File "/home/aj/miniconda3/envs/rlpyt/lib/python3.7/site-packages/dm_control/mujoco/__init__.py", line 18, in <module>
from dm_control.mujoco.engine import action_spec
File "/home/aj/miniconda3/envs/rlpyt/lib/python3.7/site-packages/dm_control/mujoco/engine.py", line 44, in <module>
from dm_control import _render
File "/home/aj/miniconda3/envs/rlpyt/lib/python3.7/site-packages/dm_control/_render/__init__.py", line 75, in <module>
Renderer = import_func()
File "/home/aj/miniconda3/envs/rlpyt/lib/python3.7/site-packages/dm_control/_render/__init__.py", line 36, in _import_egl
from dm_control._render.pyopengl.egl_renderer import EGLContext
File "/home/aj/miniconda3/envs/rlpyt/lib/python3.7/site-packages/dm_control/_render/pyopengl/egl_renderer.py", line 66, in <module>
EGL_DISPLAY = create_initialized_headless_egl_display()
File "/home/aj/miniconda3/envs/rlpyt/lib/python3.7/site-packages/dm_control/_render/pyopengl/egl_renderer.py", line 49, in create_initialized_headless_egl_display
for device in EGL.eglQueryDevicesEXT():
File "/home/aj/miniconda3/envs/rlpyt/lib/python3.7/site-packages/dm_control/_render/pyopengl/egl_ext.py", line 65, in eglQueryDevicesEXT
success = _eglQueryDevicesEXT(max_devices, devices, num_devices)
ctypes.ArgumentError: argument 2: <class 'TypeError'>: expected LP_c_void_p instance instead of EGLDeviceEXT_pointer_Array_10
Thanks, A
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (1 by maintainers)
Top Results From Across the Web
eglInitialize failed - EGL - Khronos Forums
Hi Community, I am trying to run a testing code for EGL, but it failed in initialization. Here is my testing code.
Read more >238513 – [GTK] EGLDisplay Initialization failed on Ubuntu ...
When run from the command line this shows: EGLDisplay Initialization failed: EGL_NOT_INITIALIZED Cannot create EGL context: invalid display ...
Read more >"Failed to create / initialize EGL display"? Can't open anything ...
When I attempt to open any collection / GUI file or anything that draws things, I'm getting the following error: Could not open...
Read more >Avoid crash on EGL initialization failure with multi-GPU - GitLab
This series makes EGL initialization failure not fatal alone. A KMS device that fails EGL can still be used with the CPU copy...
Read more >[RESOLVED] OpenGL fail after re-configuring Optimus driver
[32098:0218/002808.468945:ERROR:gl_surface_egl.cc(780)] EGL Driver message ... Exiting GPU process due to errors during initialization ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ajabri if X display is not available, you can use “osmesa” backend.
(for the interest of others: won’t work even if you install Xvfb and GLFW because they require X-display)
Here is the full setup for a headless linux box with no built-in X display:
@saran-t maybe we can add this to the documentation? 😃
I think this was due to an upstream change in PyOpenGL. In versions newer than 3.1.4,
OpenGL.EGL
has its ownEGLDeviceEXT
member (https://github.com/mcfletch/pyopengl/commit/38f4cc533b2ed3e85c585c4a4f00ed06f7aa6056), which overrides our assignment ofEGLDeviceEXT = ctypes.c_void_p
when we do the wildcard import on the last line. Consequently we end up with mismatching pointer types in_eglQueryDevicesEXT
and in the body ofeglQueryDevicesEXT
. I’ll put together a fix.