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

OpenGL.error.GLError: GLError( err = 12289, baseOperation = eglInitialize, cArguments = ( <OpenGL._opaque.EGLDisplay_pointer object at 0x7f7565840040>, c_long(0), c_long(0), ), result = 0 ) libEGL warning: DRI2: failed to create dri screen libEGL warning: Not allowed to force software rendering when API explicitly selects a hardware device. #35

Closed
monacv opened this issue Jan 29, 2021 · 7 comments

Comments

@monacv
Copy link

monacv commented Jan 29, 2021

I get the following error when running it for a folder with only one image:

(expose) mona@goku:~/research/code/expose$ python demo.py --image-folder ~/Downloads/sample1     --exp-cfg data/conf.yaml     --show=True     --output-folder ~/Downloads/sample_out     --save-params True     --save-vis True     --save-mesh True
INFO - 2021-01-29 16:33:41,267 - acceleratesupport - No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
Processing with R-CNN: 100%|█████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00,  1.74s/it]
2021-01-29 16:33:46.356 | INFO     | __main__:main:241 - Saving results to: /home/mona/Downloads/sample_out
2021-01-29 16:33:46.359 | WARNING  | expose.models.attention.predictor:__init__:91 - Apply hand network on body: True
2021-01-29 16:33:46.359 | WARNING  | expose.models.attention.predictor:__init__:93 - Apply hand network on hands: True
2021-01-29 16:33:46.360 | WARNING  | expose.models.attention.predictor:__init__:95 - Predict hands: True
2021-01-29 16:33:46.360 | WARNING  | expose.models.attention.predictor:__init__:102 - Predict head: True
2021-01-29 16:33:46.360 | INFO     | expose.models.attention.predictor:__init__:109 - Condition hand on body: True
2021-01-29 16:33:46.360 | INFO     | expose.models.attention.predictor:__init__:112 - Condition hand wrist pose on body: True
2021-01-29 16:33:46.360 | INFO     | expose.models.attention.predictor:__init__:117 - Condition hand finger pose on body: True
2021-01-29 16:33:46.360 | INFO     | expose.models.attention.predictor:__init__:121 - Condition hand shape on body shape: False
2021-01-29 16:33:46.360 | INFO     | expose.models.attention.predictor:__init__:169 - Condition head on body: True
2021-01-29 16:33:46.360 | INFO     | expose.models.attention.predictor:__init__:170 - Condition expression on body: True
2021-01-29 16:33:46.360 | INFO     | expose.models.attention.predictor:__init__:172 - Condition shape on body: False
2021-01-29 16:33:46.360 | INFO     | expose.models.attention.predictor:__init__:173 - Condition neck pose on body: False
2021-01-29 16:33:46.360 | INFO     | expose.models.attention.predictor:__init__:175 - Condition jaw pose on body: True
2021-01-29 16:33:46.987 | INFO     | expose.models.attention.predictor:__init__:252 - Body model: SMPLXLayer(
  Gender: NEUTRAL
  Number of joints: 55
  Betas: 10
  Number of PCA components: 6
  Flat hand mean: False
  Number of Expression Coefficients: 10
  (vertex_joint_selector): VertexJointSelector()
)
2021-01-29 16:33:47.343 | INFO     | expose.models.backbone.hrnet:init_weights:487 - => init weights from normal distribution
2021-01-29 16:33:47.980 | WARNING  | expose.models.backbone.hrnet:load_weights:519 - => please download pre-trained models first!
2021-01-29 16:33:47.980 | WARNING  | expose.models.backbone.hrnet:load_weights:520 - data/network_weights/hrnet/imagenet/hrnet_w48-8ef0771d.pth does not exist!
2021-01-29 16:33:48.000 | INFO     | expose.models.common.networks:__init__:267 - Building iterative regressor with 3 stages
2021-01-29 16:33:48.001 | INFO     | expose.models.common.networks:__init__:282 - Detach mean: False
2021-01-29 16:33:48.134 | INFO     | expose.models.backbone.resnet:resnet18:113 - Loading pretrained ResNet-18
2021-01-29 16:33:48.258 | INFO     | expose.models.common.networks:__init__:267 - Building iterative regressor with 3 stages
2021-01-29 16:33:48.258 | INFO     | expose.models.common.networks:__init__:282 - Detach mean: False
2021-01-29 16:33:48.260 | INFO     | expose.models.attention.head_predictor:__init__:81 - Building head predictor with 3 stages
2021-01-29 16:33:48.398 | INFO     | expose.models.backbone.resnet:resnet18:113 - Loading pretrained ResNet-18
2021-01-29 16:33:48.471 | INFO     | expose.models.common.networks:__init__:267 - Building iterative regressor with 3 stages
2021-01-29 16:33:48.471 | INFO     | expose.models.common.networks:__init__:282 - Detach mean: False
2021-01-29 16:33:48.472 | INFO     | expose.models.attention.predictor:__init__:490 - 2D Head crop keyps loss: KeypointLoss(Norm type: L1)
2021-01-29 16:33:48.472 | INFO     | expose.models.attention.predictor:__init__:502 - 2D Left hand crop keyps loss: KeypointLoss(Norm type: L1)
2021-01-29 16:33:48.473 | INFO     | expose.models.attention.predictor:__init__:515 - 2D Left hand crop keyps loss: KeypointLoss(Norm type: L1)
2021-01-29 16:33:48.473 | INFO     | expose.models.common.smplx_loss_modules:__init__:48 - Stages to penalize: [-1]
2021-01-29 16:33:48.473 | INFO     | expose.models.common.smplx_loss_modules:__init__:400 - Stages to regularize: [-1]
2021-01-29 16:33:48.676 | INFO     | expose.utils.checkpointer:__init__:44 - Creating directory data/checkpoints
2021-01-29 16:33:48.676 | INFO     | expose.utils.checkpointer:load_checkpoint:90 - Load pretrained: False
2021-01-29 16:33:48.676 | WARNING  | expose.utils.checkpointer:load_checkpoint:93 - Loading checkpoint from data/checkpoints/model.ckpt!
2021-01-29 16:33:49.287 | WARNING  | expose.utils.checkpointer:load_checkpoint:121 - The following keys were not found: ['smplx.head_idxs', 'smplx.body_model.left_hand_components', 'smplx.body_model.right_hand_components', 'smplx.body_model.left_hand_mean', 'smplx.body_model.right_hand_mean', 'smplx.body_model.pose_mean', 'smplx.body_model.dynamic_lmk_bary_coords']
2021-01-29 16:33:49.287 | WARNING  | expose.utils.checkpointer:load_checkpoint:124 - The following keys were not expected: ['smplx.body_model.source_idxs', 'smplx.body_model.target_idxs', 'smplx.body_model.extra_joint_regressor', 'smplx.body_model.dynamic_lmk_b_coords', 'smplx.hand_predictor.hand_offset', 'smplx.hand_predictor.hand_model.extra_joints_idxs', 'smplx.hand_predictor.hand_model.faces_tensor', 'smplx.hand_predictor.hand_model.v_template', 'smplx.hand_predictor.hand_model.shapedirs', 'smplx.hand_predictor.hand_model.J_regressor', 'smplx.hand_predictor.hand_model.posedirs', 'smplx.hand_predictor.hand_model.parents', 'smplx.hand_predictor.hand_model.lbs_weights', 'smplx.hand_predictor.pca_decoder.pca_basis', 'smplx.hand_predictor.pca_decoder.inv_pca_basis', 'smplx.hand_predictor.pca_decoder.mean', 'smplx.head_predictor.head_offset', 'smplx.head_predictor.head_vertices_ids', 'smplx.head_predictor.head_model.faces_tensor', 'smplx.head_predictor.head_model.v_template', 'smplx.head_predictor.head_model.shapedirs', 'smplx.head_predictor.head_model.expr_dirs', 'smplx.head_predictor.head_model.J_regressor', 'smplx.head_predictor.head_model.posedirs', 'smplx.head_predictor.head_model.parents', 'smplx.head_predictor.head_model.lbs_weights', 'smplx.head_predictor.head_model.lmk_faces_idx', 'smplx.head_predictor.head_model.lmk_bary_coords', 'smplx.head_predictor.head_model.dynamic_lmk_faces_idx', 'smplx.head_predictor.head_model.dynamic_lmk_b_coords', 'smplx.head_predictor.head_model.neck_kin_chain', 'smplx.body_loss.edge_loss.gt_connections', 'smplx.body_loss.edge_loss.est_connections', 'smplx.hand_loss.edge_loss.gt_connections', 'smplx.hand_loss.edge_loss.est_connections', 'smplx.head_loss.edge_loss.gt_connections', 'smplx.head_loss.edge_loss.est_connections']
libEGL warning: DRI2: failed to create dri screen
libEGL warning: Not allowed to force software rendering when API explicitly selects a hardware device.
libEGL warning: DRI2: failed to create dri screen
Traceback (most recent call last):
  File "demo.py", line 554, in <module>
    main(
  File "/home/mona/venv/expose/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 26, in decorate_context
    return func(*args, **kwargs)
  File "demo.py", line 271, in main
    hd_renderer = HDRenderer(img_size=body_crop_size)
  File "/home/mona/research/code/expose/expose/utils/plot_utils.py", line 735, in __init__
    super(HDRenderer, self).__init__(**kwargs)
  File "/home/mona/research/code/expose/expose/utils/plot_utils.py", line 576, in __init__
    super(OverlayRenderer, self).__init__(faces=faces, img_size=img_size)
  File "/home/mona/research/code/expose/expose/utils/plot_utils.py", line 418, in __init__
    self.renderer = pyrender.OffscreenRenderer(
  File "/home/mona/venv/expose/lib/python3.8/site-packages/pyrender/offscreen.py", line 31, in __init__
    self._create()
  File "/home/mona/venv/expose/lib/python3.8/site-packages/pyrender/offscreen.py", line 149, in _create
    self._platform.init_context()
  File "/home/mona/venv/expose/lib/python3.8/site-packages/pyrender/platforms/egl.py", line 177, in init_context
    assert eglInitialize(self._egl_display, major, minor)
  File "/home/mona/venv/expose/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py", line 402, in __call__
    return self( *args, **named )
  File "/home/mona/venv/expose/lib/python3.8/site-packages/OpenGL/error.py", line 228, in glCheckError
    raise GLError(
OpenGL.error.GLError: GLError(
	err = 12289,
	baseOperation = eglInitialize,
	cArguments = (
		<OpenGL._opaque.EGLDisplay_pointer object at 0x7f7565840040>,
		c_long(0),
		c_long(0),
	),
	result = 0
)

Also, check https://stackoverflow.com/questions/65962222/solving-opengl-error-glerror-glerror-err-12289-opengl-opaque-egldisplay for more details

@monacv monacv changed the title OpenGL.error.GLError: GLError( err = 12289, baseOperation = eglInitialize, cArguments = ( <OpenGL._opaque.EGLDisplay_pointer object at 0x7f7565840040>, c_long(0), c_long(0), ), result = 0 ) OpenGL.error.GLError: GLError( err = 12289, baseOperation = eglInitialize, cArguments = ( <OpenGL._opaque.EGLDisplay_pointer object at 0x7f7565840040>, c_long(0), c_long(0), ), result = 0 ) libEGL warning: DRI2: failed to create dri screen libEGL warning: Not allowed to force software rendering when API explicitly selects a hardware device. Jan 29, 2021
@monacv
Copy link
Author

monacv commented Feb 4, 2021

Thanks a lot @vchoutas for your help :)
solved the problem by changing
os.environ['PYOPENGL_PLATFORM'] = 'egl'
in demo.py and inference.py to:
os.environ['PYOPENGL_PLATFORM'] = 'osmesa'

and also:

$ cd ..
$ git clone git@github.com:mmatl/pyopengl.git
$ pip install ./pyopengl

@monacv monacv closed this as completed Feb 4, 2021
@fuziwang
Copy link

Hello, I use your method, but i get a new failed "AttributeError: 'NoneType' object has no attribute 'glGetError'" ! Can you tell me the pyrender's version?

@xiaoxingrunning
Copy link

你好,我使用你的方法,但我得到一个新的失败“AttributeError:'NoneType'对象没有属性'glGetError'”!你能告诉我pyrender的版本吗?

I have encountered the same problem as you. Have you solved it

@Schatz8
Copy link

Schatz8 commented Sep 25, 2022

我也,请问解决了吗

@fuziwang
Copy link

fuziwang commented Sep 25, 2022 via email

@herochen7372
Copy link

os.environ['PYOPENGL_PLATFORM'] = 'osmesa'
I try it,but there is a new problem. Could you help me?
('Unable to load OpenGL library', 'libgcrypt.so.11: cannot open shared object file: No such file or directory', '/home/chen/APP/anaconda3/envs/py38/lib/libOSMesa.so.8', '/home/chen/APP/anaconda3/envs/py38/lib/libOSMesa.so.8')

@fuziwang
Copy link

fuziwang commented Apr 28, 2024 via email

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