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

eglInitialize() failed with error: 3008 #54

Open
lahavlipson opened this issue May 24, 2021 · 2 comments
Open

eglInitialize() failed with error: 3008 #54

lahavlipson opened this issue May 24, 2021 · 2 comments

Comments

@lahavlipson
Copy link

lahavlipson commented May 24, 2021

When I try to run the bullet_scene_renderer, I get an eglInitialize() failed with error: 3008 error. I am able to reproduce the issue with the following code

import os
import subprocess
import xml.etree.ElementTree as ET
import pkgutil
import pybullet as pb


_client_id = pb.connect(pb.DIRECT)
os.environ['MESA_GL_VERSION_OVERRIDE'] = '3.3'
os.environ['MESA_GLSL_VERSION_OVERRIDE'] = '330'
# Get EGL device
assert 'CUDA_VISIBLE_DEVICES' in os.environ
devices = os.environ.get('CUDA_VISIBLE_DEVICES', ).split(',')
device_id = str(devices[-1])
out = subprocess.check_output(['nvidia-smi', '--id='+device_id, '-q', '--xml-format'])
tree = ET.fromstring(out)
gpu = tree.findall('gpu')[0]
dev_id = gpu.find('minor_number').text
os.environ['EGL_VISIBLE_DEVICES'] = str(dev_id)
egl = pkgutil.get_loader('eglRenderer')
assert egl
pb.loadPlugin(egl.get_filename(), "_eglRendererPlugin", physicsClientId=_client_id) # Fails here

Which outputs:

pybullet build time: May 24 2021 16:57:46 
EGL device choice: 8 of 13 (from EGL_VISIBLE_DEVICES) 
eglInitialize() failed with error: 3008   

The rendering code works when I change "_eglRendererPlugin" to "eglRendererPlugin" but then the rendering slows down a ton.

It looks like the error is maybe triggered here. For reference, I am working on a headless machine / cluster. Please let me know if there is any additional information I can provide. Thanks!

@dedoogong
Copy link

me too I got the same issue!! I want to train cosypose on the GPU server~! but I seems like, EGL prevent it. It supports only local, GUI available environment... Please help us.

@lahavlipson
Copy link
Author

lahavlipson commented May 23, 2022

@dedoogong NVidia seems to have released a driver update which may fix this issue: https://forums.developer.nvidia.com/t/linux-solaris-and-freebsd-driver-465-27-new-feature-branch-release/176631

In any event, I wrote my own renderer using pytorch3d which creates nearly identical renders: https://github.com/princeton-vl/Coupled-Iterative-Refinement/blob/main/utils/pt_renderer.py

You can substitute this for the pybullet renderer and cosypose will still get the exact same performance.

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

2 participants