【问题标题】:GlfwError: Failed to create GLFW window (windows)GlfwError: 无法创建 GLFW 窗口 (windows)
【发布时间】:2019-04-12 03:47:04
【问题描述】:

我在 windows 10 x64 上使用 openAI gym,通过 windows 远程桌面 使用 python 3.6.7 我成功安装了 atari-py 和 mujoco-py,但是当我尝试运行这段代码时。

import gym

env = gym.make('Humanoid-v2')

for i_episode in range(100):
    env.reset()
    for t in range(100):
        env.render()
        action = env.action_space.sample()
        observation, reward, done, info = env.step(action)
        if done:
            print("Episode finished after {} timesteps".format(t+1))
            break

我收到了这个错误:

GLFW error (code %d): %s 65544 b'Vulkan: Failed to query instance extension count: The requested version of Vulkan is not supported by the driver or is otherwise incompatible'
Creating window glfw
GLFW error (code %d): %s 65542 b'WGL: The driver does not appear to support OpenGL'
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    env.render()
  File "D:\ReinforceLearning\RLenv\lib\site-packages\gym\core.py", line 275, in render
    return self.env.render(mode, **kwargs)
  File "D:\ReinforceLearning\RLenv\lib\site-packages\gym\envs\mujoco\mujoco_env.py", line 118, in render
    self._get_viewer(mode).render()
  File "D:\ReinforceLearning\RLenv\lib\site-packages\gym\envs\mujoco\mujoco_env.py", line 130, in _get_viewer
    self.viewer = mujoco_py.MjViewer(self.sim)
  File "D:\ReinforceLearning\RLenv\lib\site-packages\mujoco_py-1.50.1.0-py3.6.egg\mujoco_py\mjviewer.py", line 130, in __init__
    super().__init__(sim)
  File "D:\ReinforceLearning\RLenv\lib\site-packages\mujoco_py-1.50.1.0-py3.6.egg\mujoco_py\mjviewer.py", line 25, in __init__
    super().__init__(sim)
  File "RLenv\lib\site-packages\mujoco_py-1.50.1.0-py3.6.egg\mujoco_py\mjrendercontext.pyx", line 244, in mujoco_py.cymj.MjRenderContextWindow.__init__
    super().__init__(sim, offscreen=False)
  File "RLenv\lib\site-packages\mujoco_py-1.50.1.0-py3.6.egg\mujoco_py\mjrendercontext.pyx", line 43, in mujoco_py.cymj.MjRenderContext.__init__
    self._setup_opengl_context(offscreen)
  File "RLenv\lib\site-packages\mujoco_py-1.50.1.0-py3.6.egg\mujoco_py\mjrendercontext.pyx", line 92, in mujoco_py.cymj.MjRenderContext._setup_opengl_context
    self._opengl_context = GlfwContext(offscreen=offscreen)
  File "RLenv\lib\site-packages\mujoco_py-1.50.1.0-py3.6.egg\mujoco_py\opengl_context.pyx", line 48, in mujoco_py.cymj.GlfwContext.__init__
    self.window = self._create_window(offscreen)
  File "RLenv\lib\site-packages\mujoco_py-1.50.1.0-py3.6.egg\mujoco_py\opengl_context.pyx", line 97, in mujoco_py.cymj.GlfwContext._create_window
    raise GlfwError("Failed to create GLFW window")
mujoco_py.cymj.GlfwError: Failed to create GLFW window

【问题讨论】:

  • GLFW error (code %d): %s 65542 b'WGL: The driver does not appear to support OpenGL' 检查您的图形驱动程序到底支持什么。
  • @Nadir,谢谢兄弟。我有 GTX 1070ti,它支持最高 4.5 的 OpenGL,可能是因为 PyOpenGL 包(3.1.0)只支持最高 OpenGL 4.4。

标签: python-3.x windows opengl glfw openai-gym


【解决方案1】:

OpenGL over WindowsRemote 在 1.1 之后的 OpenGL 版本的 NVIDIA GPU 上不受支持。 是否有关于存在什么解决方法的文章: Current state and solutions for OpenGL over Windows Remote

要在伤口上加盐:您可以启动 opengl 上下文,然后通过 WindowsRemote 连接。但是如果没有变通方法,直接在会话中启动是不可能的。

【讨论】:

    猜你喜欢
    • 2021-05-15
    • 2017-01-05
    • 2011-08-04
    • 2013-10-24
    • 2020-03-13
    • 1970-01-01
    • 1970-01-01
    • 2019-06-11
    • 1970-01-01
    相关资源
    最近更新 更多