google-deepmind / google-deepmind/dm_control

Can the viewer work properly on WSL2?

オープン
#383 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
4.7k
フォーク
764
PR マージ指標
30日以内にマージされた PR はありません

説明

Hello,

I am trying to call the `viewer` on WSL2 (ubuntu20.04 with WSLg) and followed the example:

```python
env = suite.load(domain_name="humanoid", task_name="stand")
action_spec = env.action_spec()

# Define a uniform random policy.
def random_policy(time_step):
del time_step # Unused.
return np.random.uniform(low=action_spec.minimum,
high=action_spec.maximum,
size=action_spec.shape)
viewer.launch(
env, policy=random_policy,
)
```

However, I got an error:

`OpenGL.error.Error: Attempt to retrieve context when no valid context`

Error info

```python3
Traceback (most recent call last):
File "test_gym.py", line 64, in
dmc_rollout("humanoid_run")
File "test_gym.py", line 57, in dmc_rollout
viewer.launch(
File "/home/yan/miniconda3/envs/RL/lib/python3.8/site-packages/dm_control/viewer/__init__.py", line 39, in launch
app = application.Application(title=title, width=width, height=height)
File "/home/yan/miniconda3/envs/RL/lib/python3.8/site-packages/dm_control/viewer/application.py", line 187, in __init__
self._window = gui.RenderWindow(width, height, title)
File "/home/yan/miniconda3/envs/RL/lib/python3.8/site-packages/dm_control/viewer/gui/glfw_gui.py", line 196, in __init__
self._fullscreen_quad = ctx.call(self._glfw_setup, self._context.window)
File "/home/yan/miniconda3/envs/RL/lib/python3.8/site-packages/dm_control/_render/executor/render_executor.py", line 138, in call
return func(*args, **kwargs)
File "/home/yan/miniconda3/envs/RL/lib/python3.8/site-packages/dm_control/viewer/gui/glfw_gui.py", line 204, in _glfw_setup
return fullscreen_quad.FullscreenQuadRenderer()
File "/home/yan/miniconda3/envs/RL/lib/python3.8/site-packages/dm_control/viewer/gui/fullscreen_quad.py", line 66, in __init__
self._init_shaders()
File "/home/yan/miniconda3/envs/RL/lib/python3.8/site-packages/dm_control/viewer/gui/fullscreen_quad.py", line 95, in _init_shaders
GL.glVertexAttribPointer(
File "src/latebind.pyx", line 51, in OpenGL_accelerate.latebind.Curry.__call__
File "/home/yan/miniconda3/envs/RL/lib/python3.8/site-packages/OpenGL/GL/VERSION/GL_2_0.py", line 469, in glVertexAttribPointer
contextdata.setValue( key, array )
File "/home/yan/miniconda3/envs/RL/lib/python3.8/site-packages/OpenGL/contextdata.py", line 59, in setValue
context = getContext( context )
File "/home/yan/miniconda3/envs/RL/lib/python3.8/site-packages/OpenGL/contextdata.py", line 38, in getContext
context = platform.GetCurrentContext()
OpenGL.error.Error: Attempt to retrieve context when no valid context
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。