google-deepmind / google-deepmind/dm_control
How to default to EGL on GPU and OSMESA on CPU?
- 主要语言
- Python
- 星标
- 4.7k
- 派生
- 764
- PR 合并指标
- 30 天内没有已合并 PR
描述
Right now, the preference order is glfw > egl > osmesa. In the common scenario of training an RL agent on a GPU machine, this means windows will pop up, which is typically not desired. I could also pin `os.environ['MUJOCO_GL'] = 'egl'` in my code to avoid this behavior. However, then the code will crash when running on a CPU-only machine.
Is there any way to set up my RL training code so that it will do headless rendering on GPU but osmesa on CPU, skipping the glfw backend? The goal here is for my RL training code to work out of the box when other people run it, without them having to set up their own env variable.
The potential workarounds I can think of all have their own downsides:
- Detecting whether the machine has a GPU by asking the deep learning framework, to only set the backend to EGL if a GPU is available: This would require importing JAX inside the env processes and hog GPU memory.
- Detecting whether the machine has a GPU by checking for common executable like nvcc or nvidia-smi: This doesn't work in many server environments (including internally at Google), where those binaries aren't available at runtime.
If DMC would just allow specifying a preference order for the backends or change the default to favor EGL over GLFW, that would simplify things a lot.
贡献指南
调研方向
首先追踪 GLFW、EGL 和 OSMESA 后端的优先级是如何选择的,以及 MUJOCO_GL 是如何处理的。比较可配置后端顺序或基于 GPU 的默认设置方案,然后验证配备 GPU 的机器会选择 headless EGL,而仅有 CPU 的机器会回退到 OSMESA,且不需要用户设置环境。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- computer-graphics, machine-learning
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100