forked from kdh0429/IsaacGymDyros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_conda_env_rlgpu.sh
executable file
·49 lines (37 loc) · 1.11 KB
/
create_conda_env_rlgpu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# should match env name from YAML
ENV_NAME=rlgpu4
pushd "${ROOT_DIR}/python"
# setup conda
CONDA_DIR="$(conda info --base)"
source "${CONDA_DIR}/etc/profile.d/conda.sh"
# deactivate the env, if it is active
ACTIVE_ENV_NAME="$(basename ${CONDA_PREFIX})"
if [ "${ENV_NAME}" = "${ACTIVE_ENV_NAME}" ]; then
conda deactivate
fi
# !!! this removes existing version of the env
conda remove -y -n "${ENV_NAME}" --all
# create the env from YAML
conda env create -f rlgpu_conda_env.yml
if [ $? -ne 0 ]; then
echo "*** Failed to create env"
exit 1
fi
# activate env
conda activate "${ENV_NAME}"
if [ $? -ne 0 ]; then
echo "*** Failed to activate env"
exit 1
fi
# double check that the correct env is active
ACTIVE_ENV_NAME="$(basename ${CONDA_PREFIX})"
if [ "${ENV_NAME}" != "${ACTIVE_ENV_NAME}" ]; then
echo "*** Env is not active, aborting"
exit 1
fi
# install isaacgym package
pip install -e .
popd
echo "SUCCESS"