Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mujoco-py fails to install on GPU node that has nvidia-smi #18640

Closed
boegel opened this issue Aug 24, 2023 · 0 comments · Fixed by #18641
Closed

mujoco-py fails to install on GPU node that has nvidia-smi #18640

boegel opened this issue Aug 24, 2023 · 0 comments · Fixed by #18641
Milestone

Comments

@boegel
Copy link
Member

boegel commented Aug 24, 2023

mujoco-py's setup.py detects presence of nvidia-smi, and is too smart for its own good by default

https://github.com/openai/mujoco-py/blob/a13903b82f1ab316815e63b3575526005b3b2ae1/mujoco_py/builder.py#L27

    File "setup.py", line 29, in run
      import mujoco_py  # noqa: force build
    File "/tmp/eb-r3ftepka/pip-req-build-uv9v_78g/mujoco_py/__init__.py", line 2, in <module>
      from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
    File "/tmp/eb-r3ftepka/pip-req-build-uv9v_78g/mujoco_py/builder.py", line 505, in <module>
      cymj = load_cython_ext(mujoco_path)
    File "/tmp/eb-r3ftepka/pip-req-build-uv9v_78g/mujoco_py/builder.py", line 76, in load_cython_ext
      _ensure_set_env_var("LD_LIBRARY_PATH", get_nvidia_lib_dir())
    File "/tmp/eb-r3ftepka/pip-req-build-uv9v_78g/mujoco_py/builder.py", line 121, in _ensure_set_env_var
      raise Exception("\nMissing path to your environment variable. \n"
  Exception:
  Missing path to your environment variable.
  Current values LD_LIBRARY_PATH=/software/MuJoCo/2.1.1-GCCcore-11.2.0/lib:...
  Please add following line to .bashrc:
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia
  Building wheel for mujoco-py (PEP 517): finished with status 'error'
  ERROR: Failed building wheel for mujoco-py

This shenanigans can be overridden by setting $MUJOCO_PY_FORCE_CPU, cfr. https://github.com/openai/mujoco-py/blob/a13903b82f1ab316815e63b3575526005b3b2ae1/mujoco_py/builder.py#L75C23-L75C42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant