Skip to content

Commit

Permalink
Using cmake < 3.17 to find CUDA
Browse files Browse the repository at this point in the history
  • Loading branch information
stemann committed Mar 18, 2022
1 parent 35e09b5 commit ec1a022
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions T/Torch/Torch/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ if [[ $bb_full_target == *cuda* ]]; then
cuda_version=`echo $bb_full_target | sed -E -e 's/.*cuda\+([0-9]+\.[0-9]+).*/\1/'`
cuda_version_major=`echo $cuda_version | cut -d . -f 1`
cuda_version_minor=`echo $cuda_version | cut -d . -f 2`
cuda_full_path="$WORKSPACE/srcdir/CUDA_full.v$cuda_version"
cmake_extra_args="-DUSE_CUDA=ON -DUSE_MAGMA=ON -DCAFFE2_USE_CUDA=ON -DCUDAToolkit_ROOT=${cuda_full_path}/cuda -DCUDA_CUDART_LIBRARY=${cuda_full_path}/cuda/lib64/libcudart.so"
atomic_patch -p1 ../patches/pytorch-cmake-find-cuda.patch
cuda_full_path="$WORKSPACE/srcdir/CUDA_full.v$cuda_version/cuda"
apk del cmake
apk add 'cmake<3.17' --repository=http://dl-cdn.alpinelinux.org/alpine/v3.11/main
cmake_extra_args="-DUSE_CUDA=ON -DUSE_MAGMA=ON -DCUDA_TOOLKIT_ROOT_DIR=$cuda_full_path -DCUDA_CUDART_LIBRARY=$cuda_full_path/lib64/libcudart.so"
micromamba install -y magma-cuda${cuda_version_major}${cuda_version_minor} -c pytorch
else
cmake_extra_args="-DUSE_CUDA=OFF -DUSE_MAGMA=OFF"
fi
git submodule update --init --recursive third_party/{QNNPACK,FXdiv,psimd,FP16,NNPACK,fbgemm}
git submodule update --init third_party/{breakpad,fmt,foxi,onnx,tensorpipe,gloo,QNNPACK,FXdiv,psimd,FP16,NNPACK,fbgemm}
mkdir build
cd build
cmake \
Expand Down

0 comments on commit ec1a022

Please sign in to comment.