Skip to content

Commit

Permalink
Merge branch 'og-develop' into fix-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cgokmen committed Jul 25, 2024
2 parents 9565ef8 + bfe5af8 commit 201bae3
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docker/prod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ RUN micromamba run -n omnigibson /bin/bash --login -c 'source /isaac-sim/setup_c
RUN micromamba run -n omnigibson python -c "from ompl import base"

# Add setup to be executed on bash launch
RUN echo "OMNIGIBSON_NO_OMNIVERSE=1 python scripts/download_datasets.py" >> /root/.bashrc
RUN echo "OMNIGIBSON_NO_OMNIVERSE=1 python omnigibson/download_datasets.py" >> /root/.bashrc

# Copy over omnigibson source
ADD . /omnigibson-src
Expand Down
75 changes: 70 additions & 5 deletions docs/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,77 @@ Please make sure your system meets the following specs:

## 💻 **Setup**

There are two ways to setup **`OmniGibson`**:
There are three ways to setup **`OmniGibson`**, all built upon different ways of installing NVIDIA Isaac Sim:

- **🐳 Install with Docker (Linux only)**: You can quickly get **`OmniGibson`** immediately up and running from our pre-built docker image.
- **🧪 Install from source (Linux / Windows)**: This method is recommended for deeper users looking to develop upon **`OmniGibson`** or use it extensively for research.
- **🐍 Pip Install (Linux / Windows, Recommended)**: You can clone **`Omnigibson`** and automatically install Isaac Sim through pip for the fastest startup.
- **🐳 Install with Docker (Linux only)**: You can quickly get **`OmniGibson`** immediately up and running from our pre-built docker image that includes Isaac Sim.
- **🧪 Install with Omniverse Launcher (Linux / Windows)**: You can install Isaac Sim via the Omniverse launcher and hook **`OmniGibson`** up to it.

!!! tip ""
=== "🐍 Pip Install (Linux / Windows)"

<div class="annotate" markdown>

1. Create a conda environment with Python version **`3.10`**:

```shell
conda create -n omnigibson python=3.10
conda activate omnigibson
```

2. Install OmniGibson with the optional Isaac Sim dependency:

<div class="grid" markdown>

!!! note "Install from PyPI (source not editable)"

```shell
pip install --no-cache-dir omnigibson[isaac]
```

!!! example "Install from GitHub (source editable)"

```shell
git clone https://github.com/StanfordVL/OmniGibson.git
cd OmniGibson
pip install --no-cache-dir -e .[isaac]
```

</div>

If this step fails, we recommend trying the [source installation](#-install-from-source-linux--windows) method.

4. Run Isaac Sim to accept the EULA:

```shell
isaacsim
```

!!! important "EULA Acceptance"
It is necessary to accept the Omniverse License Agreement (EULA) in order to use Isaac Sim.
The first time `isaacsim` is imported, you will be prompted to accept the EULA:

```
By installing or using Omniverse Kit, I agree to the terms of NVIDIA OMNIVERSE LICENSE AGREEMENT (EULA)
in https://docs.omniverse.nvidia.com/platform/latest/common/NVIDIA_Omniverse_License_Agreement.html
Do you accept the EULA? (Yes/No)
```

You must respond with 'Yes' to proceed. Once the EULA is accepted, it should not appear on subsequent Isaac Sim calls. If the EULA is not accepted, the execution will be terminated.

**You might get some error dialogs that are safe to ignore. After accepting the EULA, you can close Isaac Sim.**

5. Download **`OmniGibson`** dataset and assets:

```shell
python -m omnigibson.download_datasets
```

</div>

!!! note "More information"
For more details on installing Isaac Sim via pip, please refer to the [official Isaac Sim documentation](https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html).

=== "🐳 Install with Docker (Linux only)"

Install **`OmniGibson`** with Docker is supported for **🐧 Linux** only.
Expand Down Expand Up @@ -119,7 +184,7 @@ There are two ways to setup **`OmniGibson`**:
4. Download **`OmniGibson`** dataset (within the conda env):

```shell
python scripts/download_datasets.py
python -m omnigibson.download_datasets
```

</div>
Expand Down Expand Up @@ -158,7 +223,7 @@ There are two ways to setup **`OmniGibson`**:
4. Download **`OmniGibson`** dataset (within the conda env):

```powershell
python scripts\download_datasets.py
python -m omnigibson.download_datasets
```

</div>
Expand Down
12 changes: 7 additions & 5 deletions docs/tutorials/running_on_a_compute_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ _This documentation is a work in progress._

We assume the SLURM cluster using the _enroot_ container software, which is a replacement for Docker that allows containers to be run as the current user rather than as root. _enroot_ needs to be installed on your SLURM cluster by an administrator.

**All of the below commands assume version 1.0.0 of OmniGibson and will not be updated. Please update the paths to match the version you are installing in order to ensure you use the correct version of the dataset going forward.**

With enroot installed, you can follow the below steps to run OmniGibson on SLURM:

1. Download the dataset to a location that is accessible by cluster nodes. To do this, you can use the download_dataset.py script inside OmniGibson's scripts directory, and move it to the right spot later. In the below example, /cvgl/ is a networked drive that is accessible by the cluster nodes. **For Stanford users, this step is already done for SVL and Viscam nodes**
1. Download the dataset to a location that is accessible by cluster nodes. To do this, you can use the download_datasets.py script inside OmniGibson's scripts directory, and move it to the right spot later. In the below example, /cvgl/ is a networked drive that is accessible by the cluster nodes. **For Stanford users, this step is already done for SVL and Viscam nodes**
```{.shell .annotate}
OMNIGIBSON_NO_OMNIVERSE=1 python scripts/download_dataset.py
mv omnigibson/data /cvgl/group/Gibson/og-data-0-2-1
OMNIGIBSON_NO_OMNIVERSE=1 python omnigibson/download_datasets.py
mv omnigibson/data /cvgl/group/Gibson/og-data-1-0-0
```

2. (Optional) Distribute the dataset to the individual nodes.
Expand All @@ -28,7 +30,7 @@ sinfo -p svl -o "%N,%n" -h | \
xargs -L1 -I{} \
sbatch \
--account=cvgl --partition=svl --nodelist={} --mem=8G --cpus-per-task=4 \
--wrap 'cp -R /cvgl/group/Gibson/og-data-0-2-1 /scr-ssd/og-data-0-2-1'
--wrap 'cp -R /cvgl/group/Gibson/og-data-1-0-0 /scr-ssd/og-data-1-0-0'
```

3. Download your desired image to a location that is accessible by the cluster nodes. (Replace the path with your own path, and feel free to replace `latest` with your desired branch tag). You have the option to mount code (meaning you don't need the container to come with all the code you want to run, just the right dependencies / environment setup)
Expand Down Expand Up @@ -69,7 +71,7 @@ done
# Define mounts to create (maps local directory to container directory)
declare -A MOUNTS=(
[/scr-ssd/og-data-0-2-1]=/data
[/scr-ssd/og-data-1-0-0]=/data
[${ISAAC_CACHE_PATH}/isaac-sim/kit/cache/Kit]=/isaac-sim/kit/cache/Kit
[${ISAAC_CACHE_PATH}/isaac-sim/cache/ov]=/root/.cache/ov
[${ISAAC_CACHE_PATH}/isaac-sim/cache/pip]=/root/.cache/pip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def main():
print(f" dataset (~25GB): {gm.DATASET_PATH}")
print(f" assets (~2.5GB): {gm.ASSET_PATH}")
print(
f"If you want to install data under a different path, please change the DATA_PATH variable in omnigibson/macros.py and rerun scripts/download_dataset.py."
f"If you want to install data under a different path, please change the DATA_PATH variable in omnigibson/macros.py and rerun omnigibson/download_datasets.py."
)
if click.confirm("Do you want to continue?"):
# Only download if the dataset path doesn't exist
Expand All @@ -37,7 +37,7 @@ def main():
print("\nOmniGibson setup completed!\n")
else:
print(
"You chose not to install dataset for now. You can install it later by running python scripts/download_dataset.py."
"You chose not to install dataset for now. You can install it later by running python omnigibson/download_datasets.py."
)


Expand Down
10 changes: 5 additions & 5 deletions omnigibson/omnigibson_4_0_0.kit
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords = ["experience", "app", "usd"]
# Isaac Sim extensions
"omni.isaac.cloner" = {}
"omni.isaac.core" = {}
"omni.isaac.core_archive" = {}
## "omni.isaac.core_archive" = {}
"omni.isaac.core_nodes" = {}
"omni.isaac.cortex" = {}
"omni.isaac.cortex.sample_behaviors" = {}
Expand All @@ -22,7 +22,7 @@ keywords = ["experience", "app", "usd"]
"omni.isaac.kit" = {}
"omni.isaac.lula" = {}
"omni.isaac.manipulators" = {}
"omni.isaac.ml_archive" = {}
## "omni.isaac.ml_archive" = {}
"omni.isaac.motion_generation" = {}
"omni.isaac.menu" = {}
"omni.isaac.nucleus" = {}
Expand All @@ -35,9 +35,9 @@ keywords = ["experience", "app", "usd"]
"omni.isaac.universal_robots" = {}
"omni.isaac.utils" = {}
"omni.isaac.wheeled_robots" = {}
# "omni.kit.property.isaac" = {}
"omni.pip.cloud" = {}
"omni.pip.compute" = {}
## "omni.kit.property.isaac" = {}
## "omni.pip.cloud" = {}
## "omni.pip.compute" = {}
"omni.replicator.isaac" = {}

# Kit extensions
Expand Down
24 changes: 20 additions & 4 deletions omnigibson/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,17 @@ def _launch_app():
# sys.argv.append("--/log/outputStreamLevel=error")
warnings.simplefilter("ignore", category=NumbaPerformanceWarning)

# Try to import the isaacsim module that only shows up when pip installing omniverse
try:
import isaacsim # noqa: F401
except ImportError:
isaacsim = None

# Compute the Isaac Path next
isaac_path = os.path.dirname(isaacsim.__file__) if isaacsim is not None else os.environ["ISAAC_PATH"]

# First obtain the Isaac Sim version
version_file_path = os.path.join(os.environ["ISAAC_PATH"], "VERSION")
version_file_path = os.path.join(isaac_path, "VERSION")
assert os.path.exists(version_file_path), f"Isaac Sim version file not found at {version_file_path}"
with open(version_file_path, "r") as file:
version_content = file.read().strip()
Expand All @@ -118,9 +127,13 @@ def _launch_app():
# Copy the OmniGibson kit file to the Isaac Sim apps directory. This is necessary because the Isaac Sim app
# expects the extensions to be reachable in the parent directory of the kit file. We copy on every launch to
# ensure that the kit file is always up to date.
assert "EXP_PATH" in os.environ, "The EXP_PATH variable is not set. Are you in an Isaac Sim installed environment?"
assert (
"EXP_PATH" in os.environ or isaacsim is not None
), "The EXP_PATH variable is not set. Are you in an Isaac Sim installed environment?"
exp_path = os.path.join(isaac_path, "apps") if isaacsim is not None else os.environ["EXP_PATH"]
kit_file = Path(__file__).parent / kit_file_name
kit_file_target = Path(os.environ["EXP_PATH"]) / kit_file_name
kit_file_target = Path(exp_path) / kit_file_name

try:
shutil.copy(kit_file, kit_file_target)
except Exception as e:
Expand All @@ -129,7 +142,10 @@ def _launch_app():
launch_context = nullcontext if gm.DEBUG else suppress_omni_log

with launch_context(None):
app = lazy.omni.isaac.kit.SimulationApp(config_kwargs, experience=str(kit_file_target.resolve(strict=True)))
if isaacsim is not None:
app = isaacsim.SimulationApp(config_kwargs, experience=str(kit_file_target.resolve(strict=True)))
else:
app = lazy.omni.isaac.kit.SimulationApp(config_kwargs, experience=str(kit_file_target.resolve(strict=True)))

# Close the stage so that we can create a new one when a Simulator Instance is created
assert lazy.omni.isaac.core.utils.stage.close_stage()
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@
"aenum~=3.1.15",
"rtree~=1.2.0",
"graphviz~=0.20",
"numba~=0.60.0",
],
extras_require={
"isaac": ["isaacsim-for-omnigibson>=4.0.0"],
},
tests_require=[],
python_requires=">=3",
include_package_data=True,
Expand Down

0 comments on commit 201bae3

Please sign in to comment.