File size: 1,041 Bytes
14c58d8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #!/usr/bin/env bash
# Run from the project root (the folder that contains code/): bash code/setup_env.sh
# Your driver is 470 (CUDA 11.4). PyTorch's CUDA 11.8 build runs on it through CUDA
# minor-version compatibility. The default pip wheels (CUDA 12/13) need a newer driver.
set -e
pip install torch==2.7.1 torchvision==0.22.1 --index-url https://download.pytorch.org/whl/cu118
pip install -r code/requirements.txt
if ! command -v ffmpeg >/dev/null; then
echo "ffmpeg not found. Preferred: sudo apt install ffmpeg (includes the H.264 encoder)"
echo "Without sudo: conda install -y -c conda-forge ffmpeg"
fi
python - <<'PY'
import torch
print("torch", torch.__version__, "| CUDA available:", torch.cuda.is_available())
if torch.cuda.is_available():
p = torch.cuda.get_device_properties(0)
print(f"GPU: {p.name}, {p.total_memory/1e9:.1f} GB, compute {p.major}.{p.minor}")
if (p.major, p.minor) < (3, 7):
print("This GPU is too old for current PyTorch - the pipeline will run on CPU automatically.")
PY
|