Skip to content

Commit

Permalink
update script to check cudart only for all *.so
Browse files Browse the repository at this point in the history
  • Loading branch information
pxLi committed Jun 27, 2024
1 parent 7c2dcc2 commit 7323ea2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
21 changes: 12 additions & 9 deletions ci/check-cuda-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@
# limitations under the License.
#

# common script to help check if libcudf.so has dynamical link to cuda libs
# common script to help check if packaged *.so files have dynamical link to CUDA Runtime

set -exo pipefail

jar_path=$1
tmp_path=/tmp/"jni-$(date "+%Y%m%d%H%M%S")"
unzip -j "${jar_path}" "*64/Linux/libcudf.so" -d "${tmp_path}"
unzip -j "${jar_path}" "*64/Linux/*.so" -d "${tmp_path}"

if objdump -p "${tmp_path}/libcudf.so" | grep NEEDED | grep -q cuda; then
echo "dynamical link to CUDA lib found in libcudf.so..."
ldd "${tmp_path}/libcudf.so"
exit 1
else
echo "no dynamical link to CUDA lib found in libcudf.so"
fi
find "$tmp_path" -type f -name "*.so" | while read -r so_file; do
# Check if *.so file has a dynamic link to CUDA Runtime
if objdump -p "$so_file" | grep NEEDED | grep -qi cudart; then
echo "Dynamic link to CUDA lib found in $so_file..."
ldd "$so_file"
exit 1
else
echo "No dynamic link to CUDA lib found in $so_file"
fi
done
2 changes: 1 addition & 1 deletion ci/nightly-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ ${MVN} clean package ${MVN_MIRROR} \
-DBUILD_TESTS=ON -DBUILD_FAULTINJ=${BUILD_FAULTINJ} -Dcuda.version=$CUDA_VER \
-DUSE_SANITIZER=${USE_SANITIZER}

build_name=$($MVN help:evaluate -Dexpression=project.build.finalName -q -DforceStdout)
build_name=$(${MVN} help:evaluate -Dexpression=project.build.finalName -q -DforceStdout)
. ci/check-cuda-dependencies.sh "target/${build_name}-${artifact_suffix}.jar"
5 changes: 3 additions & 2 deletions ci/premerge-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ ${MVN} verify ${MVN_MIRROR} \
-DUSE_GDS=ON -Dtest=*,!CuFileTest,!CudaFatalTest,!ColumnViewNonEmptyNullsTest \
-DBUILD_TESTS=ON

build_name=$($MVN help:evaluate -Dexpression=project.build.finalName -q -DforceStdout)
. ci/check-cuda-dependencies.sh "target/${build_name}-cuda11.jar"
build_name=$(${MVN} help:evaluate -Dexpression=project.build.finalName -q -DforceStdout)
cuda_version=$(${MVN} help:evaluate -Dexpression=cuda.version -q -DforceStdout)
. ci/check-cuda-dependencies.sh "target/${build_name}-${cuda_version}.jar"
5 changes: 3 additions & 2 deletions ci/submodule-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ else
echo "Test failed, will update the result"
fi

build_name=$($MVN help:evaluate -Dexpression=project.build.finalName -q -DforceStdout)
. ci/check-cuda-dependencies.sh "target/${build_name}-cuda11.jar"
build_name=$(${MVN} help:evaluate -Dexpression=project.build.finalName -q -DforceStdout)
cuda_version=$(${MVN} help:evaluate -Dexpression=cuda.version -q -DforceStdout)
. ci/check-cuda-dependencies.sh "target/${build_name}-${cuda_version}.jar"

LIBCUDF_BUILD_PATH=$(${MVN} help:evaluate -Dexpression=libcudf.build.path -q -DforceStdout)
# Extract the rapids-cmake sha1 that we need to pin too
Expand Down

0 comments on commit 7323ea2

Please sign in to comment.