Skip to content

Offscreen render does not work (GLEW initalization error: Missing GL version) #408

Open
@caprest

Description

@caprest

Describe the bug
Rendering with off screen fails to initialize.

To Reproduce

import mujoco_py
model = """
<mujoco model="cartpole">
  <worldbody>
    <geom name="floor" pos="0 0 -3.0" size="40 40 40" type="plane"/>
  </worldbody>
</mujoco>
"""


model = mujoco_py.load_model_from_xml(model)
sim = mujoco_py.MjSim(model)
mujoco_py.MjRenderContextOffscreen(sim, device_id=0)

Error Messages
ERROR: GLEW initalization error: Missing GL version

It seems like the error occurs at the first line of this function (mjr_makeContext(self._model_ptr, &self._con, mjFONTSCALE_150))

def _set_mujoco_buffers(self):
mjr_makeContext(self._model_ptr, &self._con, mjFONTSCALE_150)
if self.offscreen:
mjr_setBuffer(mjFB_OFFSCREEN, &self._con);
if self._con.currentBuffer != mjFB_OFFSCREEN:
raise RuntimeError('Offscreen rendering not supported')
else:
mjr_setBuffer(mjFB_WINDOW, &self._con);
if self._con.currentBuffer != mjFB_WINDOW:
raise RuntimeError('Window rendering not supported')
self.con = WrapMjrContext(&self._con)

(found by print debug)

Furthermore when I add "None" argument at mysterious position
mujoco_py.MjRenderContextOffscreen(sim, None,device_id=0)
images are correctly rendered, though black winodow appears.

Desktop (please complete the following information):

  • OS: [Ubuntu18.04 ]
  • Python Version [3.7.3]
  • Mujoco Version [2.0.0]
  • mujoco-py version [2.0.2.2]

Environment

  • output of: echo $LD_LIBRARY_PATH /home/user/.mujoco/mujoco200/bin

Additional context
OpenGL version: 4.6.0
Nvidia Driver: 418.67

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions