Skip to content

Commit

Permalink
Merge pull request #29 from dperozzi/cuda-detection-build-fix
Browse files Browse the repository at this point in the history
Force CUDA for Extension Installation
  • Loading branch information
CuiRuikai authored Oct 19, 2024
2 parents 534d59c + fcc1694 commit 0eba154
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
#!/usr/bin/env sh
HOME=`pwd`

# Check if CUDA is available
if python -c "import torch; print(torch.cuda.is_available())" | grep -q True; then
echo "CUDA detected, forcing CUDA build for both extensions..."
USE_CUDA=1
else
echo "No CUDA detected, proceeding with standard build..."
USE_CUDA=0
fi

# Chamfer Distance
cd $HOME/extensions/chamfer_dist
python setup.py install --user
if [ "$USE_CUDA" = "1" ]; then
FORCE_CUDA=1 python setup.py install --user
else
python setup.py install --user
fi

# PointOps
cd $HOME/extensions/pointops
python setup.py install --user
if [ "$USE_CUDA" = "1" ]; then
FORCE_CUDA=1 python setup.py install --user
else
python setup.py install --user
fi

0 comments on commit 0eba154

Please sign in to comment.