mkocabas / VIBE

Official implementation of CVPR2020 paper "VIBE: Video Inference for Human Body Pose and Shape Estimation"
https://arxiv.org/abs/1912.05656
Other
2.88k stars 548 forks source link

[BUG] Unable to load EGL library #101

Open mayoudong1993 opened 4 years ago

mayoudong1993 commented 4 years ago

My operation system is Windows 10, and my GPU driver is GeForce Game Ready Driver. I got this error below, could you give me some hints, what's this error talking about?

Traceback (most recent call last): File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\OpenGL\platform\egl.py", line 70, in EGL mode=ctypes.RTLD_GLOBAL File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\OpenGL\platform\ctypesloader.py", line 45, in loadLibrary return dllType( name, mode ) File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\ctypes__init.py", line 364, in init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 126] 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:/projects/pycharm/VIBE/demo.py", line 33, in from lib.utils.renderer import Renderer File "C:\projects\pycharm\VIBE\lib\utils\renderer.py", line 19, in import pyrender File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\pyrender__init.py", line 3, in from .light import Light, PointLight, DirectionalLight, SpotLight File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\pyrender\light.py", line 11, in from .texture import Texture File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\pyrender\texture.py", line 8, in from OpenGL.GL import * File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\OpenGL\GL__init.py", line 3, in from OpenGL import error as _error File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\OpenGL\error.py", line 12, in from OpenGL import platform, _configflags File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\OpenGL\platform__init__.py", line 35, in _load() File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\OpenGL\platform\init__.py", line 32, in _load plugin.install(globals()) File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\OpenGL\platform\baseplatform.py", line 92, in install namespace[ name ] = getattr(self,name,None) File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\OpenGL\platform\baseplatform.py", line 14, in get value = self.fget( obj ) File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\OpenGL\platform\egl.py", line 93, in GetCurrentContext return self.EGL.eglGetCurrentContext File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\OpenGL\platform\baseplatform.py", line 14, in get__ value = self.fget( obj ) File "C:\Users\youdo\anaconda3\envs\vibe-env\lib\site-packages\OpenGL\platform\egl.py", line 73, in EGL raise ImportError("Unable to load EGL library", *err.args) ImportError: ('Unable to load EGL library', 22, '找不到指定的模块。', None, 126, None, 'EGL', None)

mkocabas commented 4 years ago

Hi @mayoudong1993,

We didn't test our code on Windows, so it is a bit difficult to figure out the problem. And it seems the problem is related to pyrender installation, so I would suggest you to refer pyrender docs/issues to find a solution.

polar99 commented 4 years ago

@mkocabas @mayoudong1993 This problem should not be from pyrender. The biggest problem is the code : os.environ['PYOPENGL_PLATFORM'] = 'egl' in demo.py. It will use EGL as OpenGL Platform. So when initializing opengl, the problem raise ImportError("Unable to load EGL library", *err.args) occured.

(1) About EGL on Windows system In fact, there is nothing like egl.dll in python\Lib\site-packages\OpenGL\DLLS\, so it can't load EGL library.

(2) As for pyrender Pyrender\offscreen.py

 def _create(self):
        if 'PYOPENGL_PLATFORM' not in os.environ:
            from pyrender.platforms.pyglet_platform import PygletPlatform
            self._platform = PygletPlatform(self.viewport_width,
                                            self.viewport_height)
        elif os.environ['PYOPENGL_PLATFORM'] == 'egl':
            from pyrender.platforms import egl
            device_id = int(os.environ.get('EGL_DEVICE_ID', '0'))
            egl_device = egl.get_device_by_index(device_id)
            self._platform = egl.EGLPlatform(self.viewport_width,
                                             self.viewport_height,
                                             device=egl_device)

The default is PygletPlatform. So just comment os.environ['PYOPENGL_PLATFORM'] = 'egl' in demo.py.
It works well on my experiment. (Win10 64 bit)

mkocabas commented 4 years ago

Thanks @StephenGreat for the solution. Is this the only modification you did to make VIBE work on Windows?

polar99 commented 4 years ago

Thanks @StephenGreat for the solution. Is this the only modification you did to make VIBE work on Windows?

You need to install ffmpeg (windows latest version) which can download from official website. Put ffmpeg.exe in system variable Path. Other settings are same as requirements.txt https://github.com/mkocabas/VIBE/blob/master/requirements.txt Any questions are welcome.

AngioC commented 3 years ago

@mkocabas @mayoudong1993 This problem should not be from pyrender. The biggest problem is the code : os.environ['PYOPENGL_PLATFORM'] = 'egl' in demo.py. It will use EGL as OpenGL Platform. So when initializing opengl, the problem raise ImportError("Unable to load EGL library", *err.args) occured.

(1) About EGL on Windows system In fact, there is nothing like egl.dll in python\Lib\site-packages\OpenGL\DLLS, so it can't load EGL library.

(2) As for pyrender Pyrender\offscreen.py

def _create(self):
     if 'PYOPENGL_PLATFORM' not in os.environ:
         from pyrender.platforms.pyglet_platform import PygletPlatform
         self._platform = PygletPlatform(self.viewport_width,
                                         self.viewport_height)
     elif os.environ['PYOPENGL_PLATFORM'] == 'egl':
         from pyrender.platforms import egl
         device_id = int(os.environ.get('EGL_DEVICE_ID', '0'))
         egl_device = egl.get_device_by_index(device_id)
         self._platform = egl.EGLPlatform(self.viewport_width,
                                          self.viewport_height,
                                          device=egl_device)

The default is PygletPlatform. So just comment os.environ['PYOPENGL_PLATFORM'] = 'egl' in demo.py. It works well on my experiment. (Win10 64 bit)

After commenting this line I got this error: "ValueError: Failed to initialize Pyglet window with an OpenGL >= 3+ context. If you're logged in via SSH, ensure that you're running your script with vglrun (i.e. VirtualGL). The internal error message was "Cannot connect to "None"". I'm trying to render the results on a ubuntu server.

elk-april commented 3 years ago

@mkocabas @mayoudong1993 This problem should not be from pyrender. The biggest problem is the code : os.environ['PYOPENGL_PLATFORM'] = 'egl' in demo.py. It will use EGL as OpenGL Platform. So when initializing opengl, the problem raise ImportError("Unable to load EGL library", *err.args) occured. (1) About EGL on Windows system In fact, there is nothing like egl.dll in python\Lib\site-packages\OpenGL\DLLS, so it can't load EGL library. (2) As for pyrender Pyrender\offscreen.py

def _create(self):
     if 'PYOPENGL_PLATFORM' not in os.environ:
         from pyrender.platforms.pyglet_platform import PygletPlatform
         self._platform = PygletPlatform(self.viewport_width,
                                         self.viewport_height)
     elif os.environ['PYOPENGL_PLATFORM'] == 'egl':
         from pyrender.platforms import egl
         device_id = int(os.environ.get('EGL_DEVICE_ID', '0'))
         egl_device = egl.get_device_by_index(device_id)
         self._platform = egl.EGLPlatform(self.viewport_width,
                                          self.viewport_height,
                                          device=egl_device)

The default is PygletPlatform. So just comment os.environ['PYOPENGL_PLATFORM'] = 'egl' in demo.py. It works well on my experiment. (Win10 64 bit)

After commenting this line I got this error: "ValueError: Failed to initialize Pyglet window with an OpenGL >= 3+ context. If you're logged in via SSH, ensure that you're running your script with vglrun (i.e. VirtualGL). The internal error message was "Cannot connect to "None"". I'm trying to render the results on a ubuntu server.

Hi, have you solved it? I meet it too.....

emepetres commented 3 years ago

Hi, # apt-get install libosmesa6-dev freeglut3-dev fixes the issue.

sklipnoty commented 3 years ago

@mkocabas @mayoudong1993 This problem should not be from pyrender. The biggest problem is the code : os.environ['PYOPENGL_PLATFORM'] = 'egl' in demo.py. It will use EGL as OpenGL Platform. So when initializing opengl, the problem raise ImportError("Unable to load EGL library", *err.args) occured. (1) About EGL on Windows system In fact, there is nothing like egl.dll in python\Lib\site-packages\OpenGL\DLLS, so it can't load EGL library. (2) As for pyrender Pyrender\offscreen.py

def _create(self):
     if 'PYOPENGL_PLATFORM' not in os.environ:
         from pyrender.platforms.pyglet_platform import PygletPlatform
         self._platform = PygletPlatform(self.viewport_width,
                                         self.viewport_height)
     elif os.environ['PYOPENGL_PLATFORM'] == 'egl':
         from pyrender.platforms import egl
         device_id = int(os.environ.get('EGL_DEVICE_ID', '0'))
         egl_device = egl.get_device_by_index(device_id)
         self._platform = egl.EGLPlatform(self.viewport_width,
                                          self.viewport_height,
                                          device=egl_device)

The default is PygletPlatform. So just comment os.environ['PYOPENGL_PLATFORM'] = 'egl' in demo.py. It works well on my experiment. (Win10 64 bit)

After commenting this line I got this error: "ValueError: Failed to initialize Pyglet window with an OpenGL >= 3+ context. If you're logged in via SSH, ensure that you're running your script with vglrun (i.e. VirtualGL). The internal error message was "Cannot connect to "None"". I'm trying to render the results on a ubuntu server.

Hi, have you solved it? I meet it too.....

I would also be interested in a solution specifically for windows 10 and python 3.7.

bravewhh commented 3 years ago

@mkocabas @mayoudong1993 This problem should not be from pyrender. The biggest problem is the code : os.environ['PYOPENGL_PLATFORM'] = 'egl' in demo.py. It will use EGL as OpenGL Platform. So when initializing opengl, the problem raise ImportError("Unable to load EGL library", *err.args) occured. (1) About EGL on Windows system In fact, there is nothing like egl.dll in python\Lib\site-packages\OpenGL\DLLS, so it can't load EGL library. (2) As for pyrender Pyrender\offscreen.py

def _create(self):
     if 'PYOPENGL_PLATFORM' not in os.environ:
         from pyrender.platforms.pyglet_platform import PygletPlatform
         self._platform = PygletPlatform(self.viewport_width,
                                         self.viewport_height)
     elif os.environ['PYOPENGL_PLATFORM'] == 'egl':
         from pyrender.platforms import egl
         device_id = int(os.environ.get('EGL_DEVICE_ID', '0'))
         egl_device = egl.get_device_by_index(device_id)
         self._platform = egl.EGLPlatform(self.viewport_width,
                                          self.viewport_height,
                                          device=egl_device)

The default is PygletPlatform. So just comment os.environ['PYOPENGL_PLATFORM'] = 'egl' in demo.py. It works well on my experiment. (Win10 64 bit)

After commenting this line I got this error: "ValueError: Failed to initialize Pyglet window with an OpenGL >= 3+ context. If you're logged in via SSH, ensure that you're running your script with vglrun (i.e. VirtualGL). The internal error message was "Cannot connect to "None"". I'm trying to render the results on a ubuntu server.

Hi, have you solved it? I meet it too.....

I would also be interested in a solution specifically for windows 10 and python 3.7.

have you solved this problem?please contact me with qq:1305966853,thank you very much!

Mapleaf-Lau commented 1 year ago

comment os.environ['PYOPENGL_PLATFORM'] = 'egl' is effective, but it doesn't seem to be the main reason. I fixed it by install pyglet==1.5.24. And 1.5.20 or newer 2.0.0 all have error of no GLU or Unable to load EGL.

stevejaehyeok commented 1 year ago

sudo apt-get install libglfw3-dev libgles2-mesa-dev This saved my life

wwwpkol commented 1 year ago

Thanks @StephenGreat for the solution. Is this the only modification you did to make VIBE work on Windows?

You need to install ffmpeg (windows latest version) which can download from official website. Put ffmpeg.exe in system variable Path. Other settings are same as requirements.txt https://github.com/mkocabas/VIBE/blob/master/requirements.txt Any questions are welcome.

I have installed ffmpeg.exe, and passed the CMD test, but there is still an ImportError: ('Unable to load EGL library', "Could not find module 'EGL' (or one of its dependencies). Try using the full path with constructor syntax.", 'EGL', None) I am using the script from https://github.com/eth-siplab/AvatarPoser thanks for your help

lidonghaoharry commented 11 months ago

comment os.environ['PYOPENGL_PLATFORM'] = 'egl' is effective, but it doesn't seem to be the main reason. I fixed it by install pyglet==1.5.24. And 1.5.20 or newer 2.0.0 all have error of no GLU or Unable to load EGL.

Hi, may I ask how you installed pyglet==1.5.24? I tried downloading it using the source code zip folder, but it still has the same GLUE and EGL issues. Thanks!

HYJ-EIS commented 6 months ago

@mkocabas @mayoudong1993 This problem should not be from pyrender. The biggest problem is the code : os.environ['PYOPENGL_PLATFORM'] = 'egl' in demo.py. It will use EGL as OpenGL Platform. So when initializing opengl, the problem occured.raise ImportError("Unable to load EGL library", *err.args)

(1) About EGL on Windows system In fact, there is nothing like egl.dll in python\Lib\site-packages\OpenGL\DLLS, so it can't load EGL library.

(2) As for pyrender Pyrender\offscreen.py

def _create(self):
     if 'PYOPENGL_PLATFORM' not in os.environ:
         from pyrender.platforms.pyglet_platform import PygletPlatform
         self._platform = PygletPlatform(self.viewport_width,
                                         self.viewport_height)
     elif os.environ['PYOPENGL_PLATFORM'] == 'egl':
         from pyrender.platforms import egl
         device_id = int(os.environ.get('EGL_DEVICE_ID', '0'))
         egl_device = egl.get_device_by_index(device_id)
         self._platform = egl.EGLPlatform(self.viewport_width,
                                          self.viewport_height,
                                          device=egl_device)

The default is PygletPlatform. So just comment os.environ['PYOPENGL_PLATFORM'] = 'egl' in demo.py. It works well on my experiment. (Win10 64 bit)

After commenting this line,the error ImportError: ('Unable to load EGL library', 22, '找不到指定的模块。', None, 126, None, 'EGL', None) remain the same,this solution doesn't work.

I would also be interested in a solution specifically for windows 10 and python 3.7.

nitinmukesh commented 6 months ago

I am also stuck becuase of EGL issue. Anyone have any idea how to fix this on Windows 11.

yangxiaoleyxl commented 3 months ago

Traceback (most recent call last): File "inference.py", line 188, in main() File "inference.py", line 57, in main from utils.vis import render_mesh, save_obj File "/Volumes/Work/Chinese_CV/CCM/Papers/SMPLer-X/main/../common/utils/vis.py", line 9, in import pyrender File "/Volumes/Work/Anaconda/anaconda3/envs/smplerx/lib/python3.8/site-packages/pyrender/init.py", line 3, in from .light import Light, PointLight, DirectionalLight, SpotLight File "/Volumes/Work/Anaconda/anaconda3/envs/smplerx/lib/python3.8/site-packages/pyrender/light.py", line 10, in from OpenGL.GL import File "/Volumes/Work/Anaconda/anaconda3/envs/smplerx/lib/python3.8/site-packages/OpenGL/GL/init.py", line 3, in from OpenGL import error as _error File "/Volumes/Work/Anaconda/anaconda3/envs/smplerx/lib/python3.8/site-packages/OpenGL/error.py", line 12, in from OpenGL import platform, _configflags File "/Volumes/Work/Anaconda/anaconda3/envs/smplerx/lib/python3.8/site-packages/OpenGL/platform/init.py", line 35, in _load() File "/Volumes/Work/Anaconda/anaconda3/envs/smplerx/lib/python3.8/site-packages/OpenGL/platform/init.py", line 32, in _load plugin.install(globals()) File "/Volumes/Work/Anaconda/anaconda3/envs/smplerx/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py", line 92, in install namespace[ name ] = getattr(self,name,None) File "/Volumes/Work/Anaconda/anaconda3/envs/smplerx/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py", line 14, in get value = self.fget( obj ) File "/Volumes/Work/Anaconda/anaconda3/envs/smplerx/lib/python3.8/site-packages/OpenGL/platform/egl.py", line 93, in GetCurrentContext return self.EGL.eglGetCurrentContext File "/Volumes/Work/Anaconda/anaconda3/envs/smplerx/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py", line 14, in get value = self.fget( obj ) File "/Volumes/Work/Anaconda/anaconda3/envs/smplerx/lib/python3.8/site-packages/OpenGL/platform/egl.py", line 73, in EGL raise ImportError("Unable to load EGL library", err.args) ImportError: ('Unable to load EGL library', "dlopen(EGL, 0x000A): tried: 'EGL' (no such file), '/System/Volumes/Preboot/Cryptexes/OSEGL' (no such file), '/Volumes/Work/Anaconda/anaconda3/envs/smplerx/lib/python3.8/lib-dynload/../../EGL' (no such file), '/Volumes/Work/Anaconda/anaconda3/envs/smplerx/bin/../lib/EGL' (no such file), '/usr/lib/EGL' (no such file, not in dyld cache), 'EGL' (no such file), '/usr/local/lib/EGL' (no such file), '/usr/lib/EGL' (no such file, not in dyld cache)", 'EGL', None)

Hi, I meet the same error when running slurm_inference.sh of https://github.com/caizhongang/SMPLer-X. Could any one give a solution ? Thanks