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

[Question] render error #123

Open
3 tasks done
mumuyanyan opened this issue Sep 26, 2024 · 3 comments
Open
3 tasks done

[Question] render error #123

mumuyanyan opened this issue Sep 26, 2024 · 3 comments
Labels
question Further information is requested

Comments

@mumuyanyan
Copy link

Required prerequisites

Questions

My code is


import safety_gymnasium

env_id = 'SafetyPointGoal1-v0'
render_mode = "human" if True else None
env = safety_gymnasium.make(env_id,
                            render_mode=render_mode)
obs, info = env.reset()
while True:
    act = env.action_space.sample()
    obs, reward, cost, terminated, truncated, info = env.step(act)
    if terminated or truncated:
        break
    env.render()

The error is

warning: queue 0x2123a10 destroyed while proxies still attached:
  wl_registry#21 still attached
WARNING: OpenGL error 0x502 in or before mjr_makeContext

[destroyed object]: error 7: failed to import supplied dmabufs: Arguments are inconsistent (for example, a valid context requires buffers not supplied by a 
warning: queue 0x23aa930 destroyed while proxies still attached:
  wl_callback#43 still attached
warning: queue 0x2123d30 destroyed while proxies still attached:
  zwp_linux_dmabuf_v1#23 still attached
/home/xx/anaconda3/envs/safe/lib/python3.8/site-packages/glfw/__init__.py:914: GLFWError: (65537) b'The GLFW library is not initialized'
  warnings.warn(message, GLFWError)
Exception ignored in: <function WindowViewer.__del__ at 0x780a67fbe940>
Traceback (most recent call last):
  File "/home/xx/anaconda3/envs/safe/lib/python3.8/site-packages/gymnasium/envs/mujoco/mujoco_rendering.py", line 335, in __del__
  File "/home/xx/anaconda3/envs/safe/lib/python3.8/site-packages/gymnasium/envs/mujoco/mujoco_rendering.py", line 328, in free
AttributeError: 'NoneType' object has no attribute 'get_current_context'
@mumuyanyan mumuyanyan added the question Further information is requested label Sep 26, 2024
@muchvo
Copy link
Collaborator

muchvo commented Oct 10, 2024

Sorry for the late response. It seems I missed this issue. It looks like you encountered this error when exiting the render process? This issue is inherited from Gymnasium, and I’ve had discussions with its developers about it. Unfortunately, resolving this problem is quite challenging, but it shouldn’t affect normal usage. If you need further assistance, feel free to reach out to me.

@mumuyanyan
Copy link
Author

mumuyanyan commented Oct 31, 2024

Sorry for the late response. It seems I missed this issue. It looks like you encountered this error when exiting the render process? This issue is inherited from Gymnasium, and I’ve had discussions with its developers about it. Unfortunately, resolving this problem is quite challenging, but it shouldn’t affect normal usage. If you need further assistance, feel free to reach out to me.

If this problem cannot be solved, is the example provided on the homepage also wrong?
Screenshot

@muchvo
Copy link
Collaborator

muchvo commented Nov 1, 2024

It is important to note that this issue primarily affects the process of destruction and does not impact the normal functioning of the code.

The issue with this example is that it does not specify render_mode within the make function. It should be:
env = safety_gymnasium.make(env_id, render_mode='rgb_array')
The render_mode can be set to 'human', 'rgb_array', or 'depth_array'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants