jkorstad commited on
Commit
960b35f
·
verified ·
1 Parent(s): 1be0478

Update setup_blender.sh

Browse files
Files changed (1) hide show
  1. setup_blender.sh +8 -6
setup_blender.sh CHANGED
@@ -29,7 +29,7 @@ FLASH_ATTN_VERSION_TO_INSTALL="2.5.8"
29
  # --- Set Environment Variables for Build ---
30
  export CUDA_HOME=${CUDA_HOME:-/usr/local/cuda}
31
  export PATH="${CUDA_HOME}/bin:${LOCAL_BIN_DIR}:${PATH}"
32
- export MAX_JOBS=${MAX_JOBS:-4}
33
 
34
  PYTHON_INCLUDE_DIR="/usr/include/python${BLENDER_PYTHON_VERSION#python}"
35
  export CPATH="${PYTHON_INCLUDE_DIR}:${CPATH}"
@@ -96,6 +96,9 @@ fi
96
  echo "Upgrading pip for Blender Python..."
97
  "${BLENDER_PY_EXEC}" -m pip install --no-cache-dir --upgrade pip setuptools wheel -vvv
98
 
 
 
 
99
  echo "Step 1: Installing PyTorch ${TORCH_VERSION} (for CUDA ${TARGET_CUDA_VERSION_SHORT}) and Torchvision ${TORCHVISION_VERSION}..."
100
  "${BLENDER_PY_EXEC}" -m pip install --no-cache-dir \
101
  torch==${TORCH_VERSION} \
@@ -103,12 +106,11 @@ echo "Step 1: Installing PyTorch ${TORCH_VERSION} (for CUDA ${TARGET_CUDA_VERSIO
103
  --index-url ${TORCH_INDEX_URL} -vvv
104
  echo "PyTorch and Torchvision installation attempted."
105
 
106
- echo "Step 2: Installing flash-attn==${FLASH_ATTN_VERSION_TO_INSTALL} from PyPI (binary only)..."
107
- # Install flash-attn from PyPI, specifying version and forcing binary only.
108
- # This command does NOT use the PyTorch index-url, allowing pip to search PyPI normally for flash-attn.
109
- # The --only-binary flag applies to the package name immediately following it.
110
  "${BLENDER_PY_EXEC}" -m pip install --no-cache-dir \
111
- --only-binary flash-attn \
112
  flash-attn==${FLASH_ATTN_VERSION_TO_INSTALL} -vvv
113
  echo "flash-attn installation attempted from PyPI."
114
 
 
29
  # --- Set Environment Variables for Build ---
30
  export CUDA_HOME=${CUDA_HOME:-/usr/local/cuda}
31
  export PATH="${CUDA_HOME}/bin:${LOCAL_BIN_DIR}:${PATH}"
32
+ export MAX_JOBS=${MAX_JOBS:-4} # Already set, good for potential compilations
33
 
34
  PYTHON_INCLUDE_DIR="/usr/include/python${BLENDER_PYTHON_VERSION#python}"
35
  export CPATH="${PYTHON_INCLUDE_DIR}:${CPATH}"
 
96
  echo "Upgrading pip for Blender Python..."
97
  "${BLENDER_PY_EXEC}" -m pip install --no-cache-dir --upgrade pip setuptools wheel -vvv
98
 
99
+ echo "Installing packaging and ninja for flash-attn build (if needed)..."
100
+ "${BLENDER_PY_EXEC}" -m pip install --no-cache-dir packaging ninja -vvv
101
+
102
  echo "Step 1: Installing PyTorch ${TORCH_VERSION} (for CUDA ${TARGET_CUDA_VERSION_SHORT}) and Torchvision ${TORCHVISION_VERSION}..."
103
  "${BLENDER_PY_EXEC}" -m pip install --no-cache-dir \
104
  torch==${TORCH_VERSION} \
 
106
  --index-url ${TORCH_INDEX_URL} -vvv
107
  echo "PyTorch and Torchvision installation attempted."
108
 
109
+ echo "Step 2: Installing flash-attn==${FLASH_ATTN_VERSION_TO_INSTALL} from PyPI with --no-build-isolation..."
110
+ # Install flash-attn from PyPI, specifying version and using --no-build-isolation
111
+ # This allows flash-attn to use the already installed PyTorch and other packages.
 
112
  "${BLENDER_PY_EXEC}" -m pip install --no-cache-dir \
113
+ --no-build-isolation \
114
  flash-attn==${FLASH_ATTN_VERSION_TO_INSTALL} -vvv
115
  echo "flash-attn installation attempted from PyPI."
116