Skip to content

install

_find_isaac_sim_path()

Try to find the path of a launcher-based Isaac Sim installation.

Source code in omnigibson/install.py
def _find_isaac_sim_path():
    """Try to find the path of a launcher-based Isaac Sim installation."""
    if platform.system() == "Windows":
        base_path = Path.home() / "AppData" / "Local" / "ov" / "pkg"
    else:
        base_path = Path.home() / ".local" / "share" / "ov" / "pkg"

    # If the pkg dir is missing, we definitely can't find an Isaac Sim installation
    if not base_path.exists():
        return None

    isaac_dirs = list(base_path.glob("isaac*"))
    if not isaac_dirs:
        return None

    return isaac_dirs[-1]

_is_glibc_older()

Check if the system's GLIBC version is older than the one used in the NVIDIA PyPI packages.

Source code in omnigibson/install.py
def _is_glibc_older():
    """Check if the system's GLIBC version is older than the one used in the NVIDIA PyPI packages."""
    try:
        dist_info = subprocess.check_output(["ldd", "--version"]).decode("utf-8")
        if any(version in dist_info for version in ["2.31", "2.32", "2.33"]):
            return True
        elif any(version in dist_info for version in ["2.34", "2.35", "2.36", "2.37", "2.38", "2.39"]):
            return False
        else:
            raise ValueError("Incompatible GLIBC version")
    except subprocess.CalledProcessError:
        raise ValueError("Failed to check GLIBC version. `ldd` was not accessible. Try running it yourself to see why.")

_pip_install(filenames)

Install a package using pip.

Source code in omnigibson/install.py
def _pip_install(filenames: List[Path]):
    """Install a package using pip."""
    try:
        subprocess.run(["pip", "install"] + [str(x) for x in filenames], check=True)
    except subprocess.CalledProcessError:
        return False

    return True

_rename_if_necessary(filename)

Rename the file if the system's GLIBC version is older than the one used in the NVIDIA PyPI packages.

This is permissible because the manylinux wheels are compatible with older GLIBC versions even though the filename suggests not - so we apply this hacky workaround. This allows pip to try to install them.

Source code in omnigibson/install.py
def _rename_if_necessary(filename: Path):
    """
    Rename the file if the system's GLIBC version is older than the one used in the NVIDIA PyPI packages.

    This is permissible because the manylinux wheels are compatible with older GLIBC versions even though
    the filename suggests not - so we apply this hacky workaround. This allows pip to try to install them.
    """
    # Rename the file if the system's GLIBC version is older than the one used in the NVIDIA PyPI packages
    if platform.system() == "Linux" and _is_glibc_older():
        new_filename = filename.with_name(filename.name.replace("manylinux_2_34", "manylinux_2_31"))
        shutil.move(filename, new_filename)
        return new_filename

    # If the file is not renamed, return the original filename
    return filename