Skip to content

Commit 305662f

Browse files
Default GPU_COUNT to 1 in cmake file (#2336)
Closes #2314 Rather than relying on the output from nvidia-smi, MG C++ tests will default to 1 GPU. This default can be overridden by the developer by calling `cmake` with the option: `-DGPU_COUNT=` and specifying the desired number of GPUs. Note that the user can always run individual tests by directly calling `mpirun`. This only affects the default used by `ctest`, `make test` or `ninja test` to run the entire suite of tests. Authors: - Chuck Hastings (https://github.com/ChuckHastings) Approvers: - Rick Ratzel (https://github.com/rlratzel) URL: #2336
1 parent 5ae30cc commit 305662f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

cpp/tests/CMakeLists.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -512,13 +512,11 @@ if(BUILD_CUGRAPH_MG_TESTS)
512512
# - find MPI - only enabled if MG tests are to be built
513513
find_package(MPI REQUIRED)
514514

515-
execute_process(
516-
COMMAND nvidia-smi -L
517-
COMMAND wc -l
518-
OUTPUT_VARIABLE GPU_COUNT)
519-
520-
string(REGEX REPLACE "\n$" "" GPU_COUNT ${GPU_COUNT})
521-
MESSAGE(STATUS "GPU_COUNT: " ${GPU_COUNT})
515+
# Set the GPU count to 1. If the caller wants to execute MG tests using
516+
# more than 1, override from the command line using -DGPU_COUNT=<gpucount>
517+
if (NOT DEFINED GPU_COUNT)
518+
set(GPU_COUNT "1")
519+
endif()
522520

523521
if(MPI_CXX_FOUND)
524522
###########################################################################################

0 commit comments

Comments
 (0)