roll-ai commited on
Commit
02bc3cb
Β·
verified Β·
1 Parent(s): 84c744d

Update setup_runtime.sh

Browse files
Files changed (1) hide show
  1. setup_runtime.sh +7 -28
setup_runtime.sh CHANGED
@@ -1,45 +1,24 @@
1
  #!/bin/bash
2
 
3
- echo "πŸš€ Starting runtime setup..."
4
 
5
- # Set a writable conda install location
6
- export CONDA_DIR="/tmp/miniconda3"
7
- export PATH="$CONDA_DIR/bin:$PATH"
8
-
9
- # Download and install Miniconda
10
- mkdir -p $CONDA_DIR
11
- wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh
12
- bash /tmp/miniconda.sh -b -u -p $CONDA_DIR
13
- rm /tmp/miniconda.sh
14
-
15
- # Activate conda (no source in non-interactive shell)
16
- . "$CONDA_DIR/etc/profile.d/conda.sh"
17
- conda activate base
18
-
19
- # Create and activate the custom environment
20
- conda env create --file /cosmos-predict1.yaml
21
- conda activate cosmos-predict1
22
-
23
- # Pip install
24
  pip install --no-cache-dir -r /requirements.txt
25
 
26
- # CUDA symlinks (optional, safe to fail)
27
- ln -sf $CONDA_PREFIX/lib/python3.10/site-packages/nvidia/*/include/* $CONDA_PREFIX/include/ || true
28
- ln -sf $CONDA_PREFIX/lib/python3.10/site-packages/nvidia/*/include/* $CONDA_PREFIX/include/python3.10 || true
29
- ln -sf $CONDA_PREFIX/lib/python3.10/site-packages/triton/backends/nvidia/include/* $CONDA_PREFIX/include/ || true
30
-
31
  # Transformer Engine
32
  pip install transformer-engine[pytorch]==1.12.0
33
 
34
- # Apex compilation
35
  git clone https://github.com/NVIDIA/apex
36
  cd apex
37
- CUDA_HOME=$CONDA_PREFIX pip install -v --no-cache-dir --disable-pip-version-check --no-build-isolation \
38
  --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" .
 
39
 
40
  # MoGe
41
  pip install git+https://github.com/microsoft/MoGe.git
42
 
43
- # Return to app
44
  cd /app
45
  python app.py
 
1
  #!/bin/bash
2
 
3
+ echo "πŸš€ Installing Python packages..."
4
 
5
+ # Install core dependencies from pip
6
+ pip install --upgrade pip
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  pip install --no-cache-dir -r /requirements.txt
8
 
 
 
 
 
 
9
  # Transformer Engine
10
  pip install transformer-engine[pytorch]==1.12.0
11
 
12
+ # Apex
13
  git clone https://github.com/NVIDIA/apex
14
  cd apex
15
+ CUDA_HOME=/usr/local/cuda pip install -v --no-cache-dir --disable-pip-version-check --no-build-isolation \
16
  --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" .
17
+ cd ..
18
 
19
  # MoGe
20
  pip install git+https://github.com/microsoft/MoGe.git
21
 
22
+ # Launch your app
23
  cd /app
24
  python app.py