How can OpenAI Gym‘s visualizations work within Docker?

题意:OpenAI Gym 的可视化功能如何在 Docker 中运行?

问题背景:

I'd like to get OpenAI Gym working with the rendered OpenGL visualizations within a docker container.

我想在 Docker 容器中让 OpenAI Gym 与渲染的 OpenGL 可视化一起工作

It's straightforward to get OpenAI Gym running within Docker. However, it's not immediately clear how to get the rendered environment to display in a window on my OS X laptop when you call env.render() on an OpenAI environment within the Docker container.

在 Docker 中运行 OpenAI Gym 是很直接的。然而,当你在 Docker 容器内调用 env.render() 时,如何在我的 OS X 笔记本电脑上显示渲染的环境窗口并不明显

How do I go about this?

我该怎么做呢?

问题解决:

You can try sharing your X11 socket file with your container... That way your container can write to it and it will show on you machine:

你可以尝试将 X11 套接字文件与容器共享......这样容器就可以写入它,渲染的内容将显示在你的机器上

Something like this:

类似这样的:

python 复制代码
docker run --privileged=true --rm \
    -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix \
    ...
相关推荐
Mr. Cao code38 分钟前
Docker:颠覆传统虚拟化的轻量级革命
linux·运维·ubuntu·docker·容器
Dontla44 分钟前
Docker多共享网络配置策略(Docker多网络、Docker networks、Docker Compose网络、Docker网络、Docker共享网络)
网络·docker·容器
新智元1 小时前
不到 10 天,国产「香蕉」突袭!一次 7 图逼真还原,合成大法惊呆歪果仁
人工智能·openai
mabo_9704@163.com1 小时前
SpringAI调用MCP服务的实现思路
spring·ai
Jayin_chan1 小时前
paddlex3.0.1-ocr服务化安装部署(docker)
docker·容器·ocr
ifanatic2 小时前
[每周一更]-(第159期):Go 工程师视角:容器化技术(Docker/Kubernetes)与CI/CD流程的应用场景
docker·golang·kubernetes
新智元2 小时前
学哲学没出路?不好意思,现在哲学就业碾压 CS!
人工智能·openai
机器之心3 小时前
DPad: 扩散大语言模型的中庸之道,杜克大学陈怡然团队免训推理加速61倍
人工智能·openai
算家计算3 小时前
OpenAI百亿美元造芯计划曝光,算力争夺战进入新阶段?
人工智能·openai·资讯
感哥4 小时前
Docker镜像
docker