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

Unable to initialize an OpenGL 3+ context #219

Open
gulj9 opened this issue Dec 21, 2024 · 4 comments
Open

Unable to initialize an OpenGL 3+ context #219

gulj9 opened this issue Dec 21, 2024 · 4 comments

Comments

@gulj9
Copy link

gulj9 commented Dec 21, 2024

runtime error while running hello_genesis.py:

[Genesis] [21:53:58] [INFO] ╭─────────────────────────────────────────────────────────────────────────────────────╮
[Genesis] [21:53:58] [INFO] │┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉ Genesis ┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉│
[Genesis] [21:53:58] [INFO] ╰─────────────────────────────────────────────────────────────────────────────────────╯
[Genesis] [21:53:58] [INFO] Running on [11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz] with backend gs.cpu. Device memory: 31.06 GB.
[Genesis] [21:53:58] [INFO] 🚀 Genesis initialized. 🔖 version: 0.2.0, 🌱 seed: None, 📏 precision: '32', 🐛 debug: False, 🎨 theme: 'dark'.
[Genesis] [21:53:58] [INFO] Scene created.
[Genesis] [21:53:58] [INFO] Adding <gs.RigidEntity>. idx: 0, uid: <51f6c52>, morph: <gs.morphs.Plane>, material: <gs.materials.Rigid>.
[Genesis] [21:53:58] [INFO] Adding <gs.RigidEntity>. idx: 1, uid: <6ab75b7>, morph: <gs.morphs.MJCF(file='/home/gentex/miniconda3/envs/g5/lib/python3.10/site-packages/genesis/assets/xml/franka_emika_panda/panda.xml')>, material: <gs.materials.Rigid>.
[Genesis] [21:53:59] [INFO] Building scene ...
[Genesis] [21:54:02] [INFO] Compiling simulation kernels...
[Genesis] [21:54:06] [INFO] Building visualizer...
Exception in thread Thread-2 (_init_and_start_app):
Traceback (most recent call last):
File "/home/gentex/miniconda3/envs/g5/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/home/gentex/miniconda3/envs/g5/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/gentex/miniconda3/envs/g5/lib/python3.10/site-packages/genesis/ext/pyrender/viewer.py", line 1134, in _init_and_start_app
raise ValueError("Unable to initialize an OpenGL 3+ context")
ValueError: Unable to initialize an OpenGL 3+ context

@gulj9 gulj9 closed this as completed Dec 21, 2024
@gulj9
Copy link
Author

gulj9 commented Dec 21, 2024

@gulj9 gulj9 reopened this Dec 21, 2024
@gulj9
Copy link
Author

gulj9 commented Dec 21, 2024

@QinghuaZH
Copy link

I hava the same question.Did you have solved the questions?

@gulj9
Copy link
Author

gulj9 commented Dec 22, 2024

I haven't solve that yet but I got around it. If you disable the viewer you can dump the video to disk without using the viewer.
I found this video helpful: https://www.youtube.com/watch?v=K0mSOAXOtDs&t=283s
I used this code:

import genesis as gs
import numpy as np
gs.init(backend=gs.cuda)

scene = gs.Scene(show_viewer=False)

plane = scene.add_entity(
gs.morphs.Plane(),
)
franka = scene.add_entity(
# gs.morphs.URDF(
# file='urdf/panda_bullet/panda.urdf',
# fixed=True,
# ),
gs.morphs.MJCF(file="xml/franka_emika_panda/panda.xml"),
)

cam = scene.add_camera(res=(640, 480), pos = (0,3,2), lookat=(0,0,0.5), fov=30, GUI=False)
scene.build()
cam.start_recording()

for i in range(360):
scene.step()
cam.set_pose(
pos= (3.0 * np.sin(i/60), 3.0*np.cos(i/60),2),
lookat=(0,0,0.3)
)
cam.render()
cam.stop_recording(save_to_filename='test1.mp4', fps=60)

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