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

[BUG]egl:ValueError: Invalid device ID (0) #267

Open
lllllialois opened this issue Aug 22, 2022 · 1 comment
Open

[BUG]egl:ValueError: Invalid device ID (0) #267

lllllialois opened this issue Aug 22, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@lllllialois
Copy link

I met this bug
Traceback (most recent call last):
File "/opt/data/private/VIBE-master/demo.py", line 416, in
main(args)
File "/opt/data/private/VIBE-master/demo.py", line 278, in main
renderer = Renderer(resolution=(orig_width, orig_height), orig_img=True, wireframe=args.wireframe)
File "/opt/data/private/VIBE-master/lib/utils/renderer.py", line 60, in init
point_size=1.0
File "/opt/tools/anaconda3/envs/vibe-env/lib/python3.7/site-packages/pyrender/offscreen.py", line 31, in init
self._create()
File "/opt/tools/anaconda3/envs/vibe-env/lib/python3.7/site-packages/pyrender/offscreen.py", line 122, in _create
egl_device = egl.get_device_by_index(device_id)
File "/opt/tools/anaconda3/envs/vibe-env/lib/python3.7/site-packages/pyrender/platforms/egl.py", line 83, in get_device_by_index
raise ValueError('Invalid device ID ({})'.format(device_id, len(devices)))
ValueError: Invalid device ID (0)

@lllllialois lllllialois added the bug Something isn't working label Aug 22, 2022
@lllllialois lllllialois changed the title [BUG] Traceback (most recent call last): File "/opt/data/private/VIBE-master/demo.py", line 416, in <module> main(args) File "/opt/data/private/VIBE-master/demo.py", line 278, in main renderer = Renderer(resolution=(orig_width, orig_height), orig_img=True, wireframe=args.wireframe) File "/opt/data/private/VIBE-master/lib/utils/renderer.py", line 60, in __init__ point_size=1.0 File "/opt/tools/anaconda3/envs/vibe-env/lib/python3.7/site-packages/pyrender/offscreen.py", line 31, in __init__ self._create() File "/opt/tools/anaconda3/envs/vibe-env/lib/python3.7/site-packages/pyrender/offscreen.py", line 122, in _create egl_device = egl.get_device_by_index(device_id) File "/opt/tools/anaconda3/envs/vibe-env/lib/python3.7/site-packages/pyrender/platforms/egl.py", line 83, in get_device_by_index raise ValueError('Invalid device ID ({})'.format(device_id, len(devices))) ValueError: Invalid device ID (0) [BUG]egl:ValueError: Invalid device ID (0) Aug 22, 2022
@lllllialois
Copy link
Author

lllllialois commented Feb 7, 2023

ok, It seems that there has some elusive bug with the egl. According to the docs of pyrender, we can use osmesa instead of egl.
image
change
os.environ['PYOPENGL_PLATFORM'] = 'egl'
into
os.environ['PYOPENGL_PLATFORM'] = 'osmesa'
to use osmesa.
see the docs to learn how to install osmesa.

sudo apt update
sudo apt-get install llvm-6.0 freeglut3 freeglut3-dev
sudo apt --fix-broken install
sudo wget https://github.com/mmatl/travis_debs/raw/master/xenial/mesa_18.3.3-0.deb
sudo dpkg -i ./mesa_18.3.3-0.deb || true
sudo apt install -f

or
sudo wget --no-check-certificate https://github.com/mmatl/travis_debs/raw/master/xenial/mesa_18.3.3-0.deb

then

git clone https://github.com/mmatl/pyopengl.git
pip install ./pyopengl

if get this error:

output_img = rgb[:, :, :-1] * valid_mask + (1 - valid_mask) * img
ValueError: operands could not be broadcast together with shapes (1080,1920,2) (1080,1920,3)

change output_img = rgb[:, :, :-1] * valid_mask + (1 - valid_mask) * img into output_img = rgb[:, :, :] * valid_mask + (1 - valid_mask) * img or output_img = rgb * valid_mask + (1 - valid_mask) * img

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant