google-deepmind / google-deepmind/dm_control

Can the viewer work properly on WSL2?

未关闭
#383 0 条评论 0 个 reaction 已指派 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
```

贡献指南

打开贡献指南

调研方向

Start by reproducing the viewer.launch example on WSL2 and inspect viewer/application.py, viewer/gui/glfw_gui.py, and viewer/gui/fullscreen_quad.py around context creation and _glfw_setup. Use the traceback to trace the failure through dm_control/_render/executor/render_executor.py. Done means the viewer no longer raises the invalid-context error in the reported WSL2 environment.

由索引模型根据 Issue 内容生成。

评估

技术栈
linux, python, ubuntu
领域
computer-graphics, desktop, operating-systems
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。