Skip to content

Commit 89a6244

Browse files
authored
Fix binding_utils to work on windows (#751)
mujoco.dll is not distributed with robosuite. This change looks for the mujoco dll in the mujoco site-packages, and sets the correct MUJOCO_GL environment variable
1 parent 9f28fb9 commit 89a6244

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

robosuite/utils/binding_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
_SYSTEM = platform.system()
2626
if _SYSTEM == "Windows":
27-
ctypes.WinDLL(os.path.join(os.path.dirname(__file__), "mujoco.dll"))
27+
ctypes.WinDLL(os.path.join(os.path.dirname(mujoco.__file__), "mujoco.dll"))
2828

2929
CUDA_VISIBLE_DEVICES = os.environ.get("CUDA_VISIBLE_DEVICES", "")
3030
if CUDA_VISIBLE_DEVICES != "":
@@ -39,6 +39,8 @@
3939
# option for rendering
4040
if _SYSTEM == "Darwin":
4141
os.environ["MUJOCO_GL"] = "cgl"
42+
elif _SYSTEM == "Windows":
43+
os.environ["MUJOCO_GL"] = "wgl"
4244
else:
4345
os.environ["MUJOCO_GL"] = "egl"
4446
_MUJOCO_GL = os.environ.get("MUJOCO_GL", "").lower().strip()

0 commit comments

Comments
 (0)