Skip to content

Commit

Permalink
CI: build without cuFile (#100)
Browse files Browse the repository at this point in the history
Test that KvikIO can be build even when cuFile isn't available and fixes a `unused variable` compile warning

Authors:
  - Mads R. B. Kristensen (https://github.com/madsbk)
  - Jordan Jacobelli (https://github.com/Ethyling)

Approvers:
  - Jordan Jacobelli (https://github.com/Ethyling)
  - https://github.com/jakirkham

URL: #100
  • Loading branch information
madsbk authored Aug 3, 2022
1 parent 09f5549 commit 70b5e0f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 11 deletions.
36 changes: 27 additions & 9 deletions ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,41 @@ gpuci_mamba_retry install -c "${CONDA_BLD_DIR}" libkvikio kvikio
gpuci_logger "Install test dependencies"
gpuci_mamba_retry install -c conda-forge -c rapidsai-nightly cudf

gpuci_logger "Python py.test for kvikio"
cd "${WORKSPACE}/python"
py.test --cache-clear --basetemp="${WORKSPACE}/cudf-cuda-tmp" --junitxml="${WORKSPACE}/junit-kvikio.xml" -v

cd "${WORKSPACE}"
gpuci_logger "Clean previous conda builds"
gpuci_mamba_retry uninstall libkvikio kvikio
rm -rf "${CONDA_BLD_DIR}"

gpuci_logger "Build and run libkvikio-debug"
mkdir "${WORKSPACE}/libkvikio-debug-build"
cd "${WORKSPACE}/libkvikio-debug-build"
cmake ${WORKSPACE}/cpp -DCMAKE_BUILD_TYPE=Debug
make
export CMAKE_EXTRA_ARGS="-DCMAKE_BUILD_TYPE=Debug"
gpuci_conda_retry mambabuild --croot ${CONDA_BLD_DIR} --no-remove-work-dir --keep-old-work conda/recipes/libkvikio
gpuci_mamba_retry install -c "${CONDA_BLD_DIR}" libkvikio

# Check that `libcuda.so` is NOT being linked
LDD_BASIC_IO=`ldd ${WORKSPACE}/libkvikio-debug-build/examples/basic_io`
LDD_BASIC_IO=$(ldd "${CONDA_BLD_DIR}/work/cpp/build/examples/basic_io")
if [[ "$LDD_BASIC_IO" == *"libcuda.so"* ]]; then
echo "[ERROR] examples/basic_io shouln't link to libcuda.so: ${LDD_BASIC_IO}"
return 1
fi

# Run basic_io
${WORKSPACE}/libkvikio-debug-build/examples/basic_io
"${CONDA_BLD_DIR}/work/cpp/build/examples/basic_io"

cd "${WORKSPACE}/python"
gpuci_logger "Python py.test for kvikio"
py.test --cache-clear --basetemp="${WORKSPACE}/cudf-cuda-tmp" --junitxml="${WORKSPACE}/junit-kvikio.xml" -v
gpuci_logger "Clean previous conda builds"
gpuci_mamba_retry uninstall libkvikio
rm -rf "${CONDA_BLD_DIR}"

gpuci_logger "Build and run libkvikio-no-cufile"
export CMAKE_EXTRA_ARGS="-DCMAKE_DISABLE_FIND_PACKAGE_cuFile=TRUE"
gpuci_conda_retry mambabuild --croot ${CONDA_BLD_DIR} --no-remove-work-dir --keep-old-work conda/recipes/libkvikio
gpuci_mamba_retry install -c "${CONDA_BLD_DIR}" libkvikio

# Run basic_io
"${CONDA_BLD_DIR}/work/cpp/build/examples/basic_io"

if [ -n "${CODECOV_TOKEN}" ]; then
codecov -t $CODECOV_TOKEN
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/libkvikio/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mkdir cpp/build
pushd cpp/build
cmake .. \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \

${CMAKE_EXTRA_ARGS}
make
make install
popd
1 change: 1 addition & 0 deletions conda/recipes/libkvikio/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ build:
- SCCACHE_BUCKET=rapids-sccache
- SCCACHE_REGION=us-west-2
- SCCACHE_IDLE_TIMEOUT=32768
- CMAKE_EXTRA_ARGS
run_exports:
- {{ pin_subpackage("libkvikio", max_pin="x.x") }}
ignore_run_exports_from:
Expand Down
3 changes: 3 additions & 0 deletions cpp/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ target_link_libraries(basic_io PRIVATE kvikio CUDA::cudart)

if(CMAKE_COMPILER_IS_GNUCXX)
set(KVIKIO_CXX_FLAGS "-Wall;-Werror;-Wno-unknown-pragmas")
if(NOT cuFile_FOUND)
set(KVIKIO_CXX_FLAGS "${KVIKIO_CXX_FLAGS};-DKVIKIO_DISABLE_CUFILE")
endif()
target_compile_options(
basic_io PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${KVIKIO_CXX_FLAGS}>"
)
Expand Down
5 changes: 4 additions & 1 deletion cpp/include/kvikio/driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,13 @@ class DriverProperties {

#else
struct DriverInitializer {
// Implement a non-default constructor to avoid `unused variable` warnings downstream
DriverInitializer() {}
};

struct DriverProperties {
DriverProperties() = default;
// Implement a non-default constructor to avoid `unused variable` warnings downstream
DriverProperties() {}

static bool is_gds_available() { return false; }

Expand Down

0 comments on commit 70b5e0f

Please sign in to comment.