Spaces:
Running
on
Zero
Running
on
Zero
File size: 1,013 Bytes
d62797d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
#!/bin/bash
set -e
# π§Ύ Config
# APEX_COMMIT=f3a960f80244cf9e80558ab30f7f7e8cbf03c0a0 # Known stable commit
echo "π§Ή Cleaning any previous apex build..."
rm -rf apex
rm -rf *.egg-info build dist
echo "π₯ Cloning NVIDIA/apex..."
git clone https://github.com/NVIDIA/apex.git
cd apex
# git checkout $APEX_COMMIT
echo "π Installing build dependencies..."
sudo apt-get update
sudo apt-get install -y \
build-essential \
ninja-build \
python3-dev \
libffi-dev \
libncurses5-dev \
libncursesw5-dev \
libreadline-dev \
libssl-dev \
libsqlite3-dev \
zlib1g-dev \
libbz2-dev \
liblzma-dev \
git
echo "π Upgrading pip and wheel..."
pip install -U pip setuptools wheel
echo "π§ͺ Verifying PyTorch + CUDA availability..."
python -c "import torch; print('PyTorch:', torch.__version__, '| CUDA:', torch.version.cuda)"
echo "π§ Building Apex with CUDA and C++ extensions..."
python setup.py bdist_wheel --cuda_ext --cpp_ext
echo "β
Done! Built wheel:"
ls -lh dist/*.whl
cd ..
|