Skip to content

Commit 68c603e

Browse files
saran-tcopybara-github
authored andcommitted
Rename EGL_DEVICE_ID to MUJOCO_EGL_DEVICE_ID to be consistent with mujoco.
Fixes google-deepmind#345. PiperOrigin-RevId: 493014875 Change-Id: I54babc50d9e5f1e970e9738bb3594c5ba1b55412
1 parent f2e246b commit 68c603e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ By default, `dm_control` will attempt to use GLFW first, then EGL, then OSMesa.
113113
You can also specify a particular backend to use by setting the `MUJOCO_GL=`
114114
environment variable to `"glfw"`, `"egl"`, or `"osmesa"`, respectively. When
115115
rendering with EGL, you can also specify which GPU to use for rendering by
116-
setting the environment variable `EGL_DEVICE_ID=` to the target GPU ID.
116+
setting the environment variable `MUJOCO_EGL_DEVICE_ID=` to the target GPU ID.
117117
118118
## Additional instructions for Homebrew users on macOS
119119

dm_control/_render/pyopengl/egl_renderer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@
4343
def create_initialized_headless_egl_display():
4444
"""Creates an initialized EGL display directly on a device."""
4545
all_devices = EGL.eglQueryDevicesEXT()
46-
selected_device = os.environ.get('EGL_DEVICE_ID', None)
46+
selected_device = os.environ.get('MUJOCO_EGL_DEVICE_ID', None)
4747
if selected_device is None:
4848
candidates = all_devices
4949
else:
5050
device_idx = int(selected_device)
5151
if not 0 <= device_idx < len(all_devices):
5252
raise RuntimeError(
53-
f'EGL_DEVICE_ID must be an integer between 0 and '
53+
f'MUJOCO_EGL_DEVICE_ID must be an integer between 0 and '
5454
f'{len(all_devices) - 1} (inclusive), got {device_idx}.')
5555
candidates = all_devices[device_idx:device_idx + 1]
5656
for device in candidates:

0 commit comments

Comments
 (0)