Spaces:
Running
on
Zero
Running
on
Zero
Update setup_blender.sh
Browse files- setup_blender.sh +11 -9
setup_blender.sh
CHANGED
@@ -23,10 +23,8 @@ TORCHVISION_VERSION="0.18.1"
|
|
23 |
TARGET_CUDA_VERSION_SHORT="cu121" # PyTorch 2.3.1 wheels are available for cu121
|
24 |
TORCH_INDEX_URL="https://download.pytorch.org/whl/${TARGET_CUDA_VERSION_SHORT}"
|
25 |
|
26 |
-
#
|
27 |
-
|
28 |
-
# Corresponds to Python 3.11 (cp311), PyTorch 2.3.1+cu121
|
29 |
-
FLASH_ATTN_WHEEL_URL="https://github.com/Dao-AILab/flash-attention/releases/download/v2.5.8/flash_attn-2.5.8+pt23cu121-cp311-cp311-linux_x86_64.whl"
|
30 |
|
31 |
# --- Set Environment Variables for Build ---
|
32 |
export CUDA_HOME=${CUDA_HOME:-/usr/local/cuda}
|
@@ -46,7 +44,7 @@ echo "Blender Python Executable: ${BLENDER_PY_EXEC}"
|
|
46 |
echo "Using CUDA_HOME=${CUDA_HOME}"
|
47 |
echo "Targeting PyTorch for CUDA: ${TARGET_CUDA_VERSION_SHORT}"
|
48 |
echo "TORCH_CUDA_ARCH_LIST: ${TORCH_CUDA_ARCH_LIST}"
|
49 |
-
echo "Attempting to install flash-attn
|
50 |
|
51 |
# --- Download and Extract Blender ---
|
52 |
mkdir -p "${BLENDER_INSTALL_BASE}"
|
@@ -104,14 +102,18 @@ echo "Step 1: Installing PyTorch ${TORCH_VERSION} (for CUDA ${TARGET_CUDA_VERSIO
|
|
104 |
--index-url ${TORCH_INDEX_URL} -vvv
|
105 |
echo "PyTorch and Torchvision installation attempted."
|
106 |
|
107 |
-
echo "Step 2: Installing flash-attn
|
108 |
-
# Install flash-attn from
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
111 |
|
112 |
echo "Step 3: Installing remaining dependencies from ${UNIRIG_REQS_FILE_IN_SPACE}..."
|
113 |
# Ensure flash-attn is REMOVED from unirig_requirements.txt to avoid conflicts or reinstallation attempts.
|
114 |
# This will install torch-scatter, torch-cluster, spconv, bpy, etc.
|
|
|
115 |
"${BLENDER_PY_EXEC}" -m pip install --no-cache-dir \
|
116 |
-r "${UNIRIG_REQS_FILE_IN_SPACE}" -vvv
|
117 |
|
|
|
23 |
TARGET_CUDA_VERSION_SHORT="cu121" # PyTorch 2.3.1 wheels are available for cu121
|
24 |
TORCH_INDEX_URL="https://download.pytorch.org/whl/${TARGET_CUDA_VERSION_SHORT}"
|
25 |
|
26 |
+
# flash-attn version known to have compatible wheels (Python 3.11, PyTorch 2.3.1+cu121)
|
27 |
+
FLASH_ATTN_VERSION="2.5.8"
|
|
|
|
|
28 |
|
29 |
# --- Set Environment Variables for Build ---
|
30 |
export CUDA_HOME=${CUDA_HOME:-/usr/local/cuda}
|
|
|
44 |
echo "Using CUDA_HOME=${CUDA_HOME}"
|
45 |
echo "Targeting PyTorch for CUDA: ${TARGET_CUDA_VERSION_SHORT}"
|
46 |
echo "TORCH_CUDA_ARCH_LIST: ${TORCH_CUDA_ARCH_LIST}"
|
47 |
+
echo "Attempting to install flash-attn version: ${FLASH_ATTN_VERSION}"
|
48 |
|
49 |
# --- Download and Extract Blender ---
|
50 |
mkdir -p "${BLENDER_INSTALL_BASE}"
|
|
|
102 |
--index-url ${TORCH_INDEX_URL} -vvv
|
103 |
echo "PyTorch and Torchvision installation attempted."
|
104 |
|
105 |
+
echo "Step 2: Installing flash-attn==${FLASH_ATTN_VERSION} from PyPI (binary only)..."
|
106 |
+
# Install flash-attn from PyPI, specifying version and forcing binary only
|
107 |
+
# The --only-binary flag applies to the package name immediately following it.
|
108 |
+
"${BLENDER_PY_EXEC}" -m pip install --no-cache-dir \
|
109 |
+
--only-binary flash-attn \
|
110 |
+
flash-attn==${FLASH_ATTN_VERSION} -vvv
|
111 |
+
echo "flash-attn installation attempted from PyPI."
|
112 |
|
113 |
echo "Step 3: Installing remaining dependencies from ${UNIRIG_REQS_FILE_IN_SPACE}..."
|
114 |
# Ensure flash-attn is REMOVED from unirig_requirements.txt to avoid conflicts or reinstallation attempts.
|
115 |
# This will install torch-scatter, torch-cluster, spconv, bpy, etc.
|
116 |
+
# These packages should find the PyTorch and flash-attn already installed.
|
117 |
"${BLENDER_PY_EXEC}" -m pip install --no-cache-dir \
|
118 |
-r "${UNIRIG_REQS_FILE_IN_SPACE}" -vvv
|
119 |
|