We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42b3509 commit 5ced979Copy full SHA for 5ced979
1 file changed
build.sh
@@ -193,7 +193,15 @@ if [ -z "$CUDNN_LFLAG" ]; then
193
fi
194
195
NVCC="ccache $CUDA_HOME/bin/nvcc"
196
-ARCH=${NVCC_ARCH:-native}
+if [ -n "$NVCC_ARCH" ]; then
197
+ ARCH=$NVCC_ARCH
198
+elif command -v nvidia-smi &>/dev/null; then
199
+ CC=$(nvidia-smi --query-gpu=compute_cap --format=csv,noheader 2>/dev/null | head -1 | tr -d '.')
200
+ ARCH=${CC:+sm_$CC}
201
+ ARCH=${ARCH:-native}
202
+else
203
+ ARCH=native
204
+fi
205
206
PYTHON_INCLUDE=$(python -c "import sysconfig; print(sysconfig.get_path('include'))")
207
PYBIND_INCLUDE=$(python -c "import pybind11; print(pybind11.get_include())")
0 commit comments