jkorstad commited on
Commit
90ea438
·
verified ·
1 Parent(s): d3b0ec8

Update setup_blender.sh

Browse files
Files changed (1) hide show
  1. setup_blender.sh +8 -2
setup_blender.sh CHANGED
@@ -18,9 +18,14 @@ TORCH_CUDA_SUFFIX="cu121"
18
  TORCH_INDEX_URL="https://download.pytorch.org/whl/${TORCH_CUDA_SUFFIX}"
19
  # Define the PyG wheel index URL (use the one compatible with torch 2.3.1, even if named 2.3.0)
20
  PYG_WHEEL_INDEX="https://data.pyg.org/whl/torch-2.3.0+cu121.html" # Compatible with 2.3.1
 
 
21
  # Define CUDA Home (adjust if the path is different in the Space environment)
22
  export CUDA_HOME=/usr/local/cuda
23
  echo "Setting CUDA_HOME=${CUDA_HOME}"
 
 
 
24
 
25
 
26
  # --- Download and Extract Blender ---
@@ -54,12 +59,13 @@ if [ ! -f "${UNIRIG_REQS_FILE}" ]; then
54
  fi
55
 
56
  # Upgrade pip, setuptools, and wheel within Blender's Python environment
 
57
  echo "Upgrading pip for Blender Python..."
58
  "${BLENDER_PY_EXEC}" -m pip install --upgrade pip setuptools wheel
59
 
60
  # Install PyTorch and Torchvision first using the specified index URL
61
  echo "Installing PyTorch ${TORCH_VERSION} and Torchvision ${TORCHVISION_VERSION} (CUDA: ${TORCH_CUDA_SUFFIX})..."
62
- # Ensure CUDA_HOME is available for this step too if needed by torch install hooks
63
  "${BLENDER_PY_EXEC}" -m pip install --no-cache-dir \
64
  torch==${TORCH_VERSION} \
65
  torchvision==${TORCHVISION_VERSION} \
@@ -67,7 +73,7 @@ echo "Installing PyTorch ${TORCH_VERSION} and Torchvision ${TORCHVISION_VERSION}
67
 
68
  # Install remaining dependencies from the requirements file
69
  # Use the -f flag to point pip to the PyG wheel index page
70
- # CUDA_HOME should be inherited by this pip process
71
  echo "Installing remaining packages from ${UNIRIG_REQS_FILE} with PyG wheel index..."
72
  "${BLENDER_PY_EXEC}" -m pip install --no-cache-dir -r "${UNIRIG_REQS_FILE}" -f ${PYG_WHEEL_INDEX}
73
 
 
18
  TORCH_INDEX_URL="https://download.pytorch.org/whl/${TORCH_CUDA_SUFFIX}"
19
  # Define the PyG wheel index URL (use the one compatible with torch 2.3.1, even if named 2.3.0)
20
  PYG_WHEEL_INDEX="https://data.pyg.org/whl/torch-2.3.0+cu121.html" # Compatible with 2.3.1
21
+
22
+ # --- Set Environment Variables for Build ---
23
  # Define CUDA Home (adjust if the path is different in the Space environment)
24
  export CUDA_HOME=/usr/local/cuda
25
  echo "Setting CUDA_HOME=${CUDA_HOME}"
26
+ # Add CUDA bin directory to PATH to help find nvcc
27
+ export PATH="${CUDA_HOME}/bin:${PATH}"
28
+ echo "Prepending CUDA bin to PATH: ${PATH}"
29
 
30
 
31
  # --- Download and Extract Blender ---
 
59
  fi
60
 
61
  # Upgrade pip, setuptools, and wheel within Blender's Python environment
62
+ # Run this with the modified PATH and CUDA_HOME set
63
  echo "Upgrading pip for Blender Python..."
64
  "${BLENDER_PY_EXEC}" -m pip install --upgrade pip setuptools wheel
65
 
66
  # Install PyTorch and Torchvision first using the specified index URL
67
  echo "Installing PyTorch ${TORCH_VERSION} and Torchvision ${TORCHVISION_VERSION} (CUDA: ${TORCH_CUDA_SUFFIX})..."
68
+ # Ensure CUDA_HOME and updated PATH are available for this step too
69
  "${BLENDER_PY_EXEC}" -m pip install --no-cache-dir \
70
  torch==${TORCH_VERSION} \
71
  torchvision==${TORCHVISION_VERSION} \
 
73
 
74
  # Install remaining dependencies from the requirements file
75
  # Use the -f flag to point pip to the PyG wheel index page
76
+ # CUDA_HOME and updated PATH should be inherited by this pip process
77
  echo "Installing remaining packages from ${UNIRIG_REQS_FILE} with PyG wheel index..."
78
  "${BLENDER_PY_EXEC}" -m pip install --no-cache-dir -r "${UNIRIG_REQS_FILE}" -f ${PYG_WHEEL_INDEX}
79