Skip to content

Commit

Permalink
set CMAKE_CUDA_ARCHITECTURES
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Jul 31, 2023
1 parent 68db06b commit c6ecb04
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ set -ex
mkdir build
cd build

ARCHES=(53 62 72 75 80)
LATEST_ARCH=86
for arch in "${ARCHES[@]}"; do
CMAKE_CUDA_ARCHS="${CMAKE_CUDA_ARCHS+${CMAKE_CUDA_ARCHS};}${arch}-real"
done
# for -real vs. -virtual, see cmake.org/cmake/help/latest/prop_tgt/CUDA_ARCHITECTURES.html
# this is to support PTX JIT compilation; see first link above or cf.
# devblogs.nvidia.com/cuda-pro-tip-understand-fat-binaries-jit-caching
CMAKE_CUDA_ARCHS="${CMAKE_CUDA_ARCHS+${CMAKE_CUDA_ARCHS};}${LATEST_ARCH}"

# workaround for cmake-vs-nvcc: make sure we pick up the our own c-compiler
ln -s $BUILD_PREFIX/bin/x86_64-conda-linux-gnu-cc $BUILD_PREFIX/bin/gcc
ln -s $BUILD_PREFIX/bin/x86_64-conda-linux-gnu-c++ $BUILD_PREFIX/bin/c++
Expand All @@ -15,6 +25,7 @@ ln -s $BUILD_PREFIX/bin/x86_64-conda-linux-gnu-g++ $BUILD_PREFIX/bin/g++
cmake \
${CMAKE_ARGS} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHS} \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY="lib" \
-DCUTLASS_ENABLE_F16C=ON \
-DCUTLASS_ENABLE_CUDNN=ON \
Expand Down

0 comments on commit c6ecb04

Please sign in to comment.