简体   繁体   中英

pyglet No standard config is available, when trying to run openai gym inside a docker container

I was able to get GUI from withing a docker container by following the instructions as seen in the video . (Tested by trying to start up firefox)

I have installed OpenAI gym.

On trying to run the sample code as seen here I get the following error

libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast Traceback (most recent call last): File "<stdin>", line 2, in <module> File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/core.py", line 153, in render return self._render(mode=mode, close=close) File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/core.py", line 285, in _render return self.env.render(mode, close) File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/core.py", line 153, in render return self._render(mode=mode, close=close) File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/envs/classic_control/cartpole.py", line 114, in _render from gym.envs.classic_control import rendering File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/envs/classic_control/rendering.py", line 23, in <module> from pyglet.gl import * File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/gl/__init__.py", line 239, in <module> import pyglet.window File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/window/__init__.py", line 1896, in <module> gl._create_shadow_window() File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/gl/__init__.py", line 208, in _create_shadow_window _shadow_window = Window(width=1, height=1, visible=False) File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/window/xlib/__init__.py", line 166, in __init__ super(XlibWindow, self).__init__(*args, **kwargs) File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/window/__init__.py", line 517, in __init__ raise NoSuchConfigException('No standard config is available.') pyglet.window.NoSuchConfigException: No standard config is available.

If you didn't opt out the opengl lib (eg specifying the -no-opengl-files option for the .run file) when installing the NVIDIA GPU driver, it may be the problem. I've got a laptop without those lib installed and got the container from a image containing gym environment to work. But on my PC with those opengl lib installed in addition to nvidia driver, the very same image as mentioned above didn't work and pyglet.window.NoSuchConfigException was raised. PS: I've tested on my PC via python3 console and found that Window could be created manually with pyglet outside container.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM