Skip to content
Permalink
Browse files

ARROW-4696: Better CUDA detection in release verification script

- Use a combination of `nvidia-smi` and `nvcc` to detect if cuda is
installed and there is a least one physical gpu.
- Re-use `ARROW_CUDA` variable internally to limit divergence between
what cmake expects.

Author: François Saint-Jacques <fsaintjacques@gmail.com>

Closes #3774 from fsaintjacques/ARROW-4696-release-verify-detect-cuda and squashes the following commits:

744ea40 <François Saint-Jacques> Address review comments
2c8ea69 <François Saint-Jacques> ARROW-4696: Better CUDA detection in release verification script
  • Loading branch information...
fsaintjacques authored and kou committed Mar 1, 2019
1 parent b536457 commit 5035027d2e954d78cf8c6d37b74bf756dda4a8cb
Showing with 13 additions and 8 deletions.
  1. +13 −8 dev/release/verify-release-candidate.sh
@@ -51,12 +51,19 @@ HERE=$(cd `dirname "${BASH_SOURCE[0]:-$0}"` && pwd)

ARROW_DIST_URL='https://dist.apache.org/repos/dist/dev/arrow'

: ${ARROW_HAVE_CUDA:=}
if [ -z "$ARROW_HAVE_CUDA" ]; then
if nvidia-smi --list-gpus 2>&1 > /dev/null; then
ARROW_HAVE_CUDA=yes
detect_cuda() {
if ! (which nvcc && which nvidia-smi) > /dev/null; then
return 1
fi

local n_gpus=$(nvidia-smi --list-gpus | wc -l)
return $((${n_gpus} < 1))
}

if [ -z "${ARROW_CUDA:-}" ] && detect_cuda; then
ARROW_CUDA=ON
fi
: ${ARROW_CUDA:=OFF}

download_dist_file() {
curl \
@@ -202,10 +209,8 @@ ${ARROW_CMAKE_OPTIONS}
-DARROW_BOOST_USE_SHARED=ON
-DCMAKE_BUILD_TYPE=release
-DARROW_BUILD_TESTS=ON
-DARROW_CUDA=${ARROW_CUDA}
"
if [ "$ARROW_HAVE_CUDA" = "yes" ]; then
ARROW_CMAKE_OPTIONS="$ARROW_CMAKE_OPTIONS -DARROW_CUDA=ON"
fi
cmake $ARROW_CMAKE_OPTIONS ..

make -j$NPROC
@@ -273,7 +278,7 @@ test_ruby() {
pushd ruby

local modules="red-arrow red-plasma red-gandiva red-parquet"
if [ "${ARROW_HAVE_CUDA}" = "yes" ]; then
if [ "${ARROW_CUDA}" = "ON" ]; then
modules="${modules} red-arrow-cuda"
fi

0 comments on commit 5035027

Please sign in to comment.
You can’t perform that action at this time.