From dd465ca9ca0bbc4a013fc5b464434c9abba65c74 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 7 Feb 2024 10:45:42 -0500 Subject: [PATCH 01/27] Build generate_ctest_json in a try_compile() --- .../generate_resource_spec/CMakeLists.txt | 31 +++++++++++++++++++ .../generate_resource_spec.cpp | 2 +- .../test/generate_resource_spec.cmake | 20 +++++------- 3 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt rename rapids-cmake/test/detail/{ => generate_resource_spec}/generate_resource_spec.cpp (97%) diff --git a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt new file mode 100644 index 00000000..f1d20efb --- /dev/null +++ b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt @@ -0,0 +1,31 @@ +#============================================================================= +# Copyright (c) 2024, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============================================================================= +cmake_minimum_required(VERSION 3.23.1) +project(generate_resource_spec CXX) + +find_package(CUDAToolkit QUIET) +find_package(Threads REQUIRED) + +add_executable(generate_ctest_json generate_resource_spec.cpp) +target_link_libraries(generate_ctest_json PRIVATE Threads::Threads rt ${CMAKE_DL_LIBS}) +if(CUDAToolkit_FOUND) + target_link_libraries(generate_ctest_json PRIVATE CUDA::cudart) + target_compile_definitions(generate_ctest_json PRIVATE HAVE_CUDA) +endif() + +add_custom_command(TARGET generate_ctest_json POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ + "${output_file}" COMMENT "Copying executable to destination") diff --git a/rapids-cmake/test/detail/generate_resource_spec.cpp b/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp similarity index 97% rename from rapids-cmake/test/detail/generate_resource_spec.cpp rename to rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp index c0d93ca3..111993d6 100644 --- a/rapids-cmake/test/detail/generate_resource_spec.cpp +++ b/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/rapids-cmake/test/generate_resource_spec.cmake b/rapids-cmake/test/generate_resource_spec.cmake index 02609412..f0494303 100644 --- a/rapids-cmake/test/generate_resource_spec.cmake +++ b/rapids-cmake/test/generate_resource_spec.cmake @@ -62,7 +62,6 @@ function(rapids_test_generate_resource_spec DESTINATION filepath) ]=]) include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/default_names.cmake) - set(eval_file ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec.cpp) set(eval_exe ${PROJECT_BINARY_DIR}/rapids-cmake/${rapids_test_generate_exe_name}) set(error_file ${PROJECT_BINARY_DIR}/rapids-cmake/detect_gpus.stderr.log) @@ -70,24 +69,21 @@ function(rapids_test_generate_resource_spec DESTINATION filepath) find_package(CUDAToolkit QUIET) file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/rapids-cmake/") - if(CUDAToolkit_FOUND) - set(cuda_include_options ${CUDAToolkit_INCLUDE_DIRS}) - list(TRANSFORM cuda_include_options PREPEND "-I") - set(compile_options ${cuda_include_options} "-DHAVE_CUDA") - endif() - set(link_options ${CUDA_cudart_LIBRARY} -lpthread -lrt -ldl) set(compiler "${CMAKE_CXX_COMPILER}") if(NOT DEFINED CMAKE_CXX_COMPILER) set(compiler "${CMAKE_CUDA_COMPILER}") endif() - execute_process(COMMAND "${compiler}" "${eval_file}" ${compile_options} ${link_options} -o - "${eval_exe}" OUTPUT_VARIABLE compile_output - ERROR_VARIABLE compile_output RESULT_VARIABLE result) + try_compile(result PROJECT + generate_resource_spec SOURCE_DIR + "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec" + CMAKE_FLAGS "-DCMAKE_CXX_COMPILER=${compiler}" + "-DCUDAToolkit_ROOT=${CUDAToolkit_ROOT}" "-Doutput_file=${eval_exe}" + OUTPUT_VARIABLE compile_output) - if(NOT result EQUAL 0) + if(NOT result) string(REPLACE "\n" "\n " compile_output "${compile_output}") - message(FATAL_ERROR "rapids_test_generate_resource_spec failed to build detection executable.\nrapids_test_generate_resource_spec compile[${compiler} ${compile_options} ${link_options}] failure details are:\n ${compile_output}" + message(FATAL_ERROR "rapids_test_generate_resource_spec failed to build detection executable.\nfailure details are:\n ${compile_output}" ) endif() endif() From 69ddc60822ac07525996f7318a06d32695bdd1ae Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 7 Feb 2024 11:15:34 -0500 Subject: [PATCH 02/27] Use execute_process() instead --- .../test/generate_resource_spec.cmake | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/rapids-cmake/test/generate_resource_spec.cmake b/rapids-cmake/test/generate_resource_spec.cmake index f0494303..c636cb0a 100644 --- a/rapids-cmake/test/generate_resource_spec.cmake +++ b/rapids-cmake/test/generate_resource_spec.cmake @@ -74,14 +74,27 @@ function(rapids_test_generate_resource_spec DESTINATION filepath) set(compiler "${CMAKE_CUDA_COMPILER}") endif() - try_compile(result PROJECT - generate_resource_spec SOURCE_DIR - "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec" - CMAKE_FLAGS "-DCMAKE_CXX_COMPILER=${compiler}" + execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -S + "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec" -B + "${PROJECT_BINARY_DIR}/rapids-cmake/generate_resource_spec-build" + "-DCMAKE_CXX_COMPILER=${compiler}" "-DCUDAToolkit_ROOT=${CUDAToolkit_ROOT}" "-Doutput_file=${eval_exe}" - OUTPUT_VARIABLE compile_output) + OUTPUT_VARIABLE compile_output + ERROR_VARIABLE compile_output + RESULT_VARIABLE result) + if(NOT result EQUAL 0) + string(REPLACE "\n" "\n " compile_output "${compile_output}") + message(FATAL_ERROR "rapids_test_generate_resource_spec failed to build detection executable.\nfailure details are:\n ${compile_output}" + ) + endif() - if(NOT result) + execute_process(COMMAND ${CMAKE_COMMAND} --build + "${PROJECT_BINARY_DIR}/rapids-cmake/generate_resource_spec-build" + --config Release + OUTPUT_VARIABLE compile_output + ERROR_VARIABLE compile_output + RESULT_VARIABLE result) + if(NOT result EQUAL 0) string(REPLACE "\n" "\n " compile_output "${compile_output}") message(FATAL_ERROR "rapids_test_generate_resource_spec failed to build detection executable.\nfailure details are:\n ${compile_output}" ) From 37430db063a828f5697ec2599c9b54ba843de6c1 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 7 Feb 2024 11:57:14 -0500 Subject: [PATCH 03/27] Revert "Use execute_process() instead" This reverts commit 69ddc60822ac07525996f7318a06d32695bdd1ae. --- .../test/generate_resource_spec.cmake | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/rapids-cmake/test/generate_resource_spec.cmake b/rapids-cmake/test/generate_resource_spec.cmake index c636cb0a..f0494303 100644 --- a/rapids-cmake/test/generate_resource_spec.cmake +++ b/rapids-cmake/test/generate_resource_spec.cmake @@ -74,27 +74,14 @@ function(rapids_test_generate_resource_spec DESTINATION filepath) set(compiler "${CMAKE_CUDA_COMPILER}") endif() - execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -S - "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec" -B - "${PROJECT_BINARY_DIR}/rapids-cmake/generate_resource_spec-build" - "-DCMAKE_CXX_COMPILER=${compiler}" + try_compile(result PROJECT + generate_resource_spec SOURCE_DIR + "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec" + CMAKE_FLAGS "-DCMAKE_CXX_COMPILER=${compiler}" "-DCUDAToolkit_ROOT=${CUDAToolkit_ROOT}" "-Doutput_file=${eval_exe}" - OUTPUT_VARIABLE compile_output - ERROR_VARIABLE compile_output - RESULT_VARIABLE result) - if(NOT result EQUAL 0) - string(REPLACE "\n" "\n " compile_output "${compile_output}") - message(FATAL_ERROR "rapids_test_generate_resource_spec failed to build detection executable.\nfailure details are:\n ${compile_output}" - ) - endif() + OUTPUT_VARIABLE compile_output) - execute_process(COMMAND ${CMAKE_COMMAND} --build - "${PROJECT_BINARY_DIR}/rapids-cmake/generate_resource_spec-build" - --config Release - OUTPUT_VARIABLE compile_output - ERROR_VARIABLE compile_output - RESULT_VARIABLE result) - if(NOT result EQUAL 0) + if(NOT result) string(REPLACE "\n" "\n " compile_output "${compile_output}") message(FATAL_ERROR "rapids_test_generate_resource_spec failed to build detection executable.\nfailure details are:\n ${compile_output}" ) From 1916d7b237197493ad62069cddaad33f02f026ec Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 7 Feb 2024 13:12:07 -0500 Subject: [PATCH 04/27] Change compilation language depending on compiler --- .../test/detail/generate_resource_spec/CMakeLists.txt | 8 +++++--- rapids-cmake/test/generate_resource_spec.cmake | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt index f1d20efb..0e18471b 100644 --- a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt +++ b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt @@ -14,17 +14,19 @@ # limitations under the License. #============================================================================= cmake_minimum_required(VERSION 3.23.1) -project(generate_resource_spec CXX) +project(generate_resource_spec ${lang}) + +set(CMAKE_CUDA_ARCHITECTURES all) find_package(CUDAToolkit QUIET) -find_package(Threads REQUIRED) add_executable(generate_ctest_json generate_resource_spec.cpp) -target_link_libraries(generate_ctest_json PRIVATE Threads::Threads rt ${CMAKE_DL_LIBS}) +target_link_libraries(generate_ctest_json PRIVATE rt ${CMAKE_DL_LIBS}) if(CUDAToolkit_FOUND) target_link_libraries(generate_ctest_json PRIVATE CUDA::cudart) target_compile_definitions(generate_ctest_json PRIVATE HAVE_CUDA) endif() +set_property(SOURCE generate_resource_spec.cpp PROPERTY LANGUAGE ${lang}) add_custom_command(TARGET generate_ctest_json POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ diff --git a/rapids-cmake/test/generate_resource_spec.cmake b/rapids-cmake/test/generate_resource_spec.cmake index f0494303..60e24649 100644 --- a/rapids-cmake/test/generate_resource_spec.cmake +++ b/rapids-cmake/test/generate_resource_spec.cmake @@ -70,15 +70,18 @@ function(rapids_test_generate_resource_spec DESTINATION filepath) file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/rapids-cmake/") set(compiler "${CMAKE_CXX_COMPILER}") + set(lang CXX) if(NOT DEFINED CMAKE_CXX_COMPILER) set(compiler "${CMAKE_CUDA_COMPILER}") + set(lang CUDA) endif() try_compile(result PROJECT generate_resource_spec SOURCE_DIR "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec" - CMAKE_FLAGS "-DCMAKE_CXX_COMPILER=${compiler}" + CMAKE_FLAGS "-DCMAKE_${lang}_COMPILER=${compiler}" "-DCUDAToolkit_ROOT=${CUDAToolkit_ROOT}" "-Doutput_file=${eval_exe}" + "-Dlang=${lang}" OUTPUT_VARIABLE compile_output) if(NOT result) From 758e757246b6a71ce4f099ce8d41371e90c28694 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 7 Feb 2024 14:07:51 -0500 Subject: [PATCH 05/27] Pass CUDAToolkit_LIBRARY_ROOT --- rapids-cmake/test/generate_resource_spec.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rapids-cmake/test/generate_resource_spec.cmake b/rapids-cmake/test/generate_resource_spec.cmake index 60e24649..cb2b38d9 100644 --- a/rapids-cmake/test/generate_resource_spec.cmake +++ b/rapids-cmake/test/generate_resource_spec.cmake @@ -80,8 +80,8 @@ function(rapids_test_generate_resource_spec DESTINATION filepath) generate_resource_spec SOURCE_DIR "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec" CMAKE_FLAGS "-DCMAKE_${lang}_COMPILER=${compiler}" - "-DCUDAToolkit_ROOT=${CUDAToolkit_ROOT}" "-Doutput_file=${eval_exe}" - "-Dlang=${lang}" + "-DCUDAToolkit_ROOT=${CUDAToolkit_LIBRARY_ROOT}" + "-Doutput_file=${eval_exe}" "-Dlang=${lang}" OUTPUT_VARIABLE compile_output) if(NOT result) From f9065e6d7f2993f893ce26842dc99484d9b43789 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 7 Feb 2024 14:26:01 -0500 Subject: [PATCH 06/27] Find CUDAToolkit REQUIRED if found in parent --- .../test/detail/generate_resource_spec/CMakeLists.txt | 5 ++--- rapids-cmake/test/generate_resource_spec.cmake | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt index 0e18471b..3f359ea4 100644 --- a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt +++ b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt @@ -18,11 +18,10 @@ project(generate_resource_spec ${lang}) set(CMAKE_CUDA_ARCHITECTURES all) -find_package(CUDAToolkit QUIET) - add_executable(generate_ctest_json generate_resource_spec.cpp) target_link_libraries(generate_ctest_json PRIVATE rt ${CMAKE_DL_LIBS}) -if(CUDAToolkit_FOUND) +if(cuda_toolkit) + find_package(CUDAToolkit REQUIRED QUIET) target_link_libraries(generate_ctest_json PRIVATE CUDA::cudart) target_compile_definitions(generate_ctest_json PRIVATE HAVE_CUDA) endif() diff --git a/rapids-cmake/test/generate_resource_spec.cmake b/rapids-cmake/test/generate_resource_spec.cmake index cb2b38d9..4183ee9a 100644 --- a/rapids-cmake/test/generate_resource_spec.cmake +++ b/rapids-cmake/test/generate_resource_spec.cmake @@ -81,7 +81,9 @@ function(rapids_test_generate_resource_spec DESTINATION filepath) "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec" CMAKE_FLAGS "-DCMAKE_${lang}_COMPILER=${compiler}" "-DCUDAToolkit_ROOT=${CUDAToolkit_LIBRARY_ROOT}" - "-Doutput_file=${eval_exe}" "-Dlang=${lang}" + "-Doutput_file=${eval_exe}" + "-Dlang=${lang}" + "-Dcuda_toolkit=${CUDAToolkit_FOUND}" OUTPUT_VARIABLE compile_output) if(NOT result) From b007c4fb76747fe12e2f4c3bd33fefc0d7436ffa Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 7 Feb 2024 14:42:13 -0500 Subject: [PATCH 07/27] Don't propagate compiler variable --- rapids-cmake/test/generate_resource_spec.cmake | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rapids-cmake/test/generate_resource_spec.cmake b/rapids-cmake/test/generate_resource_spec.cmake index 4183ee9a..cc242581 100644 --- a/rapids-cmake/test/generate_resource_spec.cmake +++ b/rapids-cmake/test/generate_resource_spec.cmake @@ -79,10 +79,8 @@ function(rapids_test_generate_resource_spec DESTINATION filepath) try_compile(result PROJECT generate_resource_spec SOURCE_DIR "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec" - CMAKE_FLAGS "-DCMAKE_${lang}_COMPILER=${compiler}" - "-DCUDAToolkit_ROOT=${CUDAToolkit_LIBRARY_ROOT}" - "-Doutput_file=${eval_exe}" - "-Dlang=${lang}" + CMAKE_FLAGS "-DCUDAToolkit_ROOT=${CUDAToolkit_LIBRARY_ROOT}" + "-Doutput_file=${eval_exe}" "-Dlang=${lang}" "-Dcuda_toolkit=${CUDAToolkit_FOUND}" OUTPUT_VARIABLE compile_output) From 166faac979f6491f174eef4d9795983d3cdea677 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 7 Feb 2024 14:52:20 -0500 Subject: [PATCH 08/27] Use old try_compile() signature --- rapids-cmake/test/generate_resource_spec.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rapids-cmake/test/generate_resource_spec.cmake b/rapids-cmake/test/generate_resource_spec.cmake index cc242581..744df0b5 100644 --- a/rapids-cmake/test/generate_resource_spec.cmake +++ b/rapids-cmake/test/generate_resource_spec.cmake @@ -76,9 +76,9 @@ function(rapids_test_generate_resource_spec DESTINATION filepath) set(lang CUDA) endif() - try_compile(result PROJECT - generate_resource_spec SOURCE_DIR + try_compile(result "${PROJECT_BINARY_DIR}/rapids-cmake/generate_ctest_json-build" "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec" + generate_resource_spec CMAKE_FLAGS "-DCUDAToolkit_ROOT=${CUDAToolkit_LIBRARY_ROOT}" "-Doutput_file=${eval_exe}" "-Dlang=${lang}" "-Dcuda_toolkit=${CUDAToolkit_FOUND}" From bf4e1975987eaab3e71da25de7542e4e28ce2144 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 7 Feb 2024 15:00:51 -0500 Subject: [PATCH 09/27] Use CUDAToolkit_ROOT --- rapids-cmake/test/generate_resource_spec.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rapids-cmake/test/generate_resource_spec.cmake b/rapids-cmake/test/generate_resource_spec.cmake index 744df0b5..a840a24d 100644 --- a/rapids-cmake/test/generate_resource_spec.cmake +++ b/rapids-cmake/test/generate_resource_spec.cmake @@ -79,9 +79,8 @@ function(rapids_test_generate_resource_spec DESTINATION filepath) try_compile(result "${PROJECT_BINARY_DIR}/rapids-cmake/generate_ctest_json-build" "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/generate_resource_spec" generate_resource_spec - CMAKE_FLAGS "-DCUDAToolkit_ROOT=${CUDAToolkit_LIBRARY_ROOT}" - "-Doutput_file=${eval_exe}" "-Dlang=${lang}" - "-Dcuda_toolkit=${CUDAToolkit_FOUND}" + CMAKE_FLAGS "-DCUDAToolkit_ROOT=${CUDAToolkit_ROOT}" "-Doutput_file=${eval_exe}" + "-Dlang=${lang}" "-Dcuda_toolkit=${CUDAToolkit_FOUND}" OUTPUT_VARIABLE compile_output) if(NOT result) From 135ff76e6f277f045c14a011fba3cfce399f961a Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 10:11:33 -0500 Subject: [PATCH 10/27] Debugging: print build.ninja for generator --- .../CMakeLists.txt | 3 +-- .../main.cpp | 19 +++++-------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt index 2d8881a8..001d44f4 100644 --- a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt +++ b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,4 +29,3 @@ target_link_libraries(verify_docs PRIVATE CUDA::cudart) enable_testing() add_test(NAME simple_test COMMAND verify_docs) -rapids_test_gpu_requirements(simple_test GPUS 1 PERCENT 25) diff --git a/testing/test/no_add-with-cpp-handler-from-docs/main.cpp b/testing/test/no_add-with-cpp-handler-from-docs/main.cpp index 5ef2a496..e8bbdbb0 100644 --- a/testing/test/no_add-with-cpp-handler-from-docs/main.cpp +++ b/testing/test/no_add-with-cpp-handler-from-docs/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,21 +14,12 @@ * limitations under the License. */ +#include #include -#include - -#include "rapids_cmake_ctest_allocation.cpp" -#include "rapids_cmake_ctest_allocation.hpp" int main() { - // Verify we only have a single GPU visible to us - auto allocs = rapids_cmake::full_allocation(); - - if (allocs.size() != 1) { return 1; } - - auto alloc = allocs[0]; - if (alloc.slots != 25) { return 1; } - - return 0; + std::ifstream build_file("rapids-cmake/generate_ctest_json-build/build.ninja"); + std::cout << build_file.rdbuf(); + return 1; } From 8f4e5d056d71648fd707b84b5cec17ef8d18f8d9 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 10:24:06 -0500 Subject: [PATCH 11/27] Revert "Debugging: print build.ninja for generator" This reverts commit 135ff76e6f277f045c14a011fba3cfce399f961a. --- .../CMakeLists.txt | 3 ++- .../main.cpp | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt index 001d44f4..2d8881a8 100644 --- a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt +++ b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2022-2024, NVIDIA CORPORATION. +# Copyright (c) 2022-2023, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,3 +29,4 @@ target_link_libraries(verify_docs PRIVATE CUDA::cudart) enable_testing() add_test(NAME simple_test COMMAND verify_docs) +rapids_test_gpu_requirements(simple_test GPUS 1 PERCENT 25) diff --git a/testing/test/no_add-with-cpp-handler-from-docs/main.cpp b/testing/test/no_add-with-cpp-handler-from-docs/main.cpp index e8bbdbb0..5ef2a496 100644 --- a/testing/test/no_add-with-cpp-handler-from-docs/main.cpp +++ b/testing/test/no_add-with-cpp-handler-from-docs/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2024, NVIDIA CORPORATION. + * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,21 @@ * limitations under the License. */ -#include #include +#include + +#include "rapids_cmake_ctest_allocation.cpp" +#include "rapids_cmake_ctest_allocation.hpp" int main() { - std::ifstream build_file("rapids-cmake/generate_ctest_json-build/build.ninja"); - std::cout << build_file.rdbuf(); - return 1; + // Verify we only have a single GPU visible to us + auto allocs = rapids_cmake::full_allocation(); + + if (allocs.size() != 1) { return 1; } + + auto alloc = allocs[0]; + if (alloc.slots != 25) { return 1; } + + return 0; } From 9978afccaf08e412fa66eb63f132a39165e8aab2 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 10:25:39 -0500 Subject: [PATCH 12/27] Debugging: nvidia-smi --- testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt index 2d8881a8..b7f94219 100644 --- a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt +++ b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,3 +30,5 @@ target_link_libraries(verify_docs PRIVATE CUDA::cudart) enable_testing() add_test(NAME simple_test COMMAND verify_docs) rapids_test_gpu_requirements(simple_test GPUS 1 PERCENT 25) + +add_test(NAME nvidia-smi COMMAND /bin/bash -c "nvidia-smi && false") From 34c72129c7cb5e1e5593c2535ccc42f9b9b38c6c Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 10:39:10 -0500 Subject: [PATCH 13/27] Debugging: $RAPIDS_CMAKE_TESTING_GPU_COUNT --- testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt index b7f94219..a239c0ab 100644 --- a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt +++ b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt @@ -31,4 +31,4 @@ enable_testing() add_test(NAME simple_test COMMAND verify_docs) rapids_test_gpu_requirements(simple_test GPUS 1 PERCENT 25) -add_test(NAME nvidia-smi COMMAND /bin/bash -c "nvidia-smi && false") +add_test(NAME nvidia-smi COMMAND /bin/bash -c "nvidia-smi && echo $RAPIDS_CMAKE_TESTING_GPU_COUNT && false") From 2c96dec998f29f02884037717b4769011dfe34f5 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 10:56:25 -0500 Subject: [PATCH 14/27] More debugging --- testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt index a239c0ab..b6d3080e 100644 --- a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt +++ b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt @@ -31,4 +31,4 @@ enable_testing() add_test(NAME simple_test COMMAND verify_docs) rapids_test_gpu_requirements(simple_test GPUS 1 PERCENT 25) -add_test(NAME nvidia-smi COMMAND /bin/bash -c "nvidia-smi && echo $RAPIDS_CMAKE_TESTING_GPU_COUNT && false") +add_test(NAME nvidia-smi COMMAND /bin/bash -c "set -x && nvidia-smi && echo ${RAPIDS_CMAKE_TESTING_GPU_COUNT} && cat resource_spec.json && rapids-cmake/generate_ctest_json && false") From 13f49dbbed638f1fbfd028dfbbf85191dbc291cd Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 11:03:39 -0500 Subject: [PATCH 15/27] Static CUDA, no dependencies --- rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt index 3f359ea4..dfd7c97f 100644 --- a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt +++ b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt @@ -19,10 +19,9 @@ project(generate_resource_spec ${lang}) set(CMAKE_CUDA_ARCHITECTURES all) add_executable(generate_ctest_json generate_resource_spec.cpp) -target_link_libraries(generate_ctest_json PRIVATE rt ${CMAKE_DL_LIBS}) if(cuda_toolkit) find_package(CUDAToolkit REQUIRED QUIET) - target_link_libraries(generate_ctest_json PRIVATE CUDA::cudart) + target_link_libraries(generate_ctest_json PRIVATE CUDA::cudart_static) target_compile_definitions(generate_ctest_json PRIVATE HAVE_CUDA) endif() set_property(SOURCE generate_resource_spec.cpp PROPERTY LANGUAGE ${lang}) From 5da01227fc19e961eba54746f05e7fac64124d66 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 11:03:54 -0500 Subject: [PATCH 16/27] Remove no longer needed variables --- rapids-cmake/test/generate_resource_spec.cmake | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/rapids-cmake/test/generate_resource_spec.cmake b/rapids-cmake/test/generate_resource_spec.cmake index a840a24d..9c87f608 100644 --- a/rapids-cmake/test/generate_resource_spec.cmake +++ b/rapids-cmake/test/generate_resource_spec.cmake @@ -51,19 +51,8 @@ function(rapids_test_generate_resource_spec DESTINATION filepath) ) endif() - set(gpu_json_contents - [=[ -{ -"version": {"major": 1, "minor": 0}, -"local": [{ - "gpus": [{"id":"0", "slots": 0}] -}] -} -]=]) - include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/default_names.cmake) set(eval_exe ${PROJECT_BINARY_DIR}/rapids-cmake/${rapids_test_generate_exe_name}) - set(error_file ${PROJECT_BINARY_DIR}/rapids-cmake/detect_gpus.stderr.log) if(NOT EXISTS "${eval_exe}") find_package(CUDAToolkit QUIET) From 26f00e6284dd50007a82d1232de02ace3dbc0b21 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 11:18:16 -0500 Subject: [PATCH 17/27] Debugging --- testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt index b6d3080e..7dabca9c 100644 --- a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt +++ b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt @@ -31,4 +31,4 @@ enable_testing() add_test(NAME simple_test COMMAND verify_docs) rapids_test_gpu_requirements(simple_test GPUS 1 PERCENT 25) -add_test(NAME nvidia-smi COMMAND /bin/bash -c "set -x && nvidia-smi && echo ${RAPIDS_CMAKE_TESTING_GPU_COUNT} && cat resource_spec.json && rapids-cmake/generate_ctest_json && false") +add_test(NAME nvidia-smi COMMAND /bin/bash -c "set -x && nvidia-smi && cat resource_spec.json && rapids-cmake/generate_ctest_json && cat rapids-cmake/generate_ctest_json-build/build.ninja && false") From ad0f28aa3fe96860fd260f64b306b3f4c5a84633 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 11:32:13 -0500 Subject: [PATCH 18/27] More debugging --- .../detail/generate_resource_spec/generate_resource_spec.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp b/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp index 111993d6..c8293f1f 100644 --- a/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp +++ b/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp @@ -54,6 +54,7 @@ int main() #ifdef HAVE_CUDA cudaGetDeviceCount(&nDevices); + std::cerr << "Number of devices: " << nDevices << std::endl; if (nDevices == 0) { gpus.push_back(gpu(0)); } else { @@ -64,6 +65,7 @@ int main() } } #else + std::cerr << "Not built with CUDA! Falling back to empty GPU list" << std::endl; gpus.push_back(gpu(0)); #endif From b3a124f300efc4d13f56fa51cc02fddc45e7f8eb Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 11:46:05 -0500 Subject: [PATCH 19/27] Debugging: rules.ninja --- testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt index 7dabca9c..c04c9963 100644 --- a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt +++ b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt @@ -31,4 +31,4 @@ enable_testing() add_test(NAME simple_test COMMAND verify_docs) rapids_test_gpu_requirements(simple_test GPUS 1 PERCENT 25) -add_test(NAME nvidia-smi COMMAND /bin/bash -c "set -x && nvidia-smi && cat resource_spec.json && rapids-cmake/generate_ctest_json && cat rapids-cmake/generate_ctest_json-build/build.ninja && false") +add_test(NAME nvidia-smi COMMAND /bin/bash -c "set -x && nvidia-smi && cat resource_spec.json && rapids-cmake/generate_ctest_json && cat rapids-cmake/generate_ctest_json-build/build.ninja && cat rapids-cmake/generate_ctest_json-build/CMakeFiles/rules.ninja && false") From 08362ef98287456221052c454e57d33e65291b69 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 11:52:59 -0500 Subject: [PATCH 20/27] Debugging: compare generator executables --- testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt index c04c9963..045de4ac 100644 --- a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt +++ b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt @@ -31,4 +31,4 @@ enable_testing() add_test(NAME simple_test COMMAND verify_docs) rapids_test_gpu_requirements(simple_test GPUS 1 PERCENT 25) -add_test(NAME nvidia-smi COMMAND /bin/bash -c "set -x && nvidia-smi && cat resource_spec.json && rapids-cmake/generate_ctest_json && cat rapids-cmake/generate_ctest_json-build/build.ninja && cat rapids-cmake/generate_ctest_json-build/CMakeFiles/rules.ninja && false") +add_test(NAME nvidia-smi COMMAND /bin/bash -c "set -x && nvidia-smi && cat resource_spec.json && rapids-cmake/generate_ctest_json && rapids-cmake/generate_ctest_json-build/generate_ctest_json && sha256sum rapids-cmake/generate_ctest_json rapids-cmake/generate_ctest_json-build/generate_ctest_json && cat rapids-cmake/generate_ctest_json-build/build.ninja && cat rapids-cmake/generate_ctest_json-build/CMakeFiles/rules.ninja && false") From 1f3defc7474d92eff28c0a06f77afcd50d79b709 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 12:24:59 -0500 Subject: [PATCH 21/27] Try not using sccache --- testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt index 045de4ac..e7c572aa 100644 --- a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt +++ b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt @@ -16,6 +16,10 @@ cmake_minimum_required(VERSION 3.20) project(rapids-test-project LANGUAGES CXX CUDA) +unset(CMAKE_C_COMPILER_LAUNCHER) +unset(CMAKE_CXX_COMPILER_LAUNCHER) +unset(CMAKE_CUDA_COMPILER_LAUNCHER) + include(${rapids-cmake-dir}/rapids-test.cmake) rapids_test_init() From 84476c3991bc120c3f466cecc55950eb2de50445 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 12:38:51 -0500 Subject: [PATCH 22/27] Debugging: unset the variables in the right place --- .../test/detail/generate_resource_spec/CMakeLists.txt | 4 ++++ testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt index dfd7c97f..e22c684e 100644 --- a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt +++ b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt @@ -18,6 +18,10 @@ project(generate_resource_spec ${lang}) set(CMAKE_CUDA_ARCHITECTURES all) +unset(CMAKE_C_COMPILER_LAUNCHER) +unset(CMAKE_CXX_COMPILER_LAUNCHER) +unset(CMAKE_CUDA_COMPILER_LAUNCHER) + add_executable(generate_ctest_json generate_resource_spec.cpp) if(cuda_toolkit) find_package(CUDAToolkit REQUIRED QUIET) diff --git a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt index e7c572aa..045de4ac 100644 --- a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt +++ b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt @@ -16,10 +16,6 @@ cmake_minimum_required(VERSION 3.20) project(rapids-test-project LANGUAGES CXX CUDA) -unset(CMAKE_C_COMPILER_LAUNCHER) -unset(CMAKE_CXX_COMPILER_LAUNCHER) -unset(CMAKE_CUDA_COMPILER_LAUNCHER) - include(${rapids-cmake-dir}/rapids-test.cmake) rapids_test_init() From f077f182a9de4d19bc479bd6e92bd4c0745fce52 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 12:53:48 -0500 Subject: [PATCH 23/27] Unset properties --- .../test/detail/generate_resource_spec/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt index e22c684e..8a54e13f 100644 --- a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt +++ b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt @@ -30,6 +30,10 @@ if(cuda_toolkit) endif() set_property(SOURCE generate_resource_spec.cpp PROPERTY LANGUAGE ${lang}) +set_property(TARGET generate_ctest_json PROPERTY C_COMPILER_LAUNCHER) +set_property(TARGET generate_ctest_json PROPERTY CXX_COMPILER_LAUNCHER) +set_property(TARGET generate_ctest_json PROPERTY CUDA_COMPILER_LAUNCHER) + add_custom_command(TARGET generate_ctest_json POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ "${output_file}" COMMENT "Copying executable to destination") From 677d338973149e52369a618264f2967b0e0414f8 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 13:09:41 -0500 Subject: [PATCH 24/27] Remove debugging and extraneous variables --- .../test/detail/generate_resource_spec/CMakeLists.txt | 5 ----- .../detail/generate_resource_spec/generate_resource_spec.cpp | 2 -- .../test/no_add-with-cpp-handler-from-docs/CMakeLists.txt | 4 +--- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt index 8a54e13f..af5ef5de 100644 --- a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt +++ b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt @@ -18,10 +18,6 @@ project(generate_resource_spec ${lang}) set(CMAKE_CUDA_ARCHITECTURES all) -unset(CMAKE_C_COMPILER_LAUNCHER) -unset(CMAKE_CXX_COMPILER_LAUNCHER) -unset(CMAKE_CUDA_COMPILER_LAUNCHER) - add_executable(generate_ctest_json generate_resource_spec.cpp) if(cuda_toolkit) find_package(CUDAToolkit REQUIRED QUIET) @@ -30,7 +26,6 @@ if(cuda_toolkit) endif() set_property(SOURCE generate_resource_spec.cpp PROPERTY LANGUAGE ${lang}) -set_property(TARGET generate_ctest_json PROPERTY C_COMPILER_LAUNCHER) set_property(TARGET generate_ctest_json PROPERTY CXX_COMPILER_LAUNCHER) set_property(TARGET generate_ctest_json PROPERTY CUDA_COMPILER_LAUNCHER) diff --git a/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp b/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp index c8293f1f..111993d6 100644 --- a/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp +++ b/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp @@ -54,7 +54,6 @@ int main() #ifdef HAVE_CUDA cudaGetDeviceCount(&nDevices); - std::cerr << "Number of devices: " << nDevices << std::endl; if (nDevices == 0) { gpus.push_back(gpu(0)); } else { @@ -65,7 +64,6 @@ int main() } } #else - std::cerr << "Not built with CUDA! Falling back to empty GPU list" << std::endl; gpus.push_back(gpu(0)); #endif diff --git a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt index 045de4ac..2d8881a8 100644 --- a/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt +++ b/testing/test/no_add-with-cpp-handler-from-docs/CMakeLists.txt @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2022-2024, NVIDIA CORPORATION. +# Copyright (c) 2022-2023, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,5 +30,3 @@ target_link_libraries(verify_docs PRIVATE CUDA::cudart) enable_testing() add_test(NAME simple_test COMMAND verify_docs) rapids_test_gpu_requirements(simple_test GPUS 1 PERCENT 25) - -add_test(NAME nvidia-smi COMMAND /bin/bash -c "set -x && nvidia-smi && cat resource_spec.json && rapids-cmake/generate_ctest_json && rapids-cmake/generate_ctest_json-build/generate_ctest_json && sha256sum rapids-cmake/generate_ctest_json rapids-cmake/generate_ctest_json-build/generate_ctest_json && cat rapids-cmake/generate_ctest_json-build/build.ninja && cat rapids-cmake/generate_ctest_json-build/CMakeFiles/rules.ninja && false") From ebbea1e50fc2649acb1213c38b4f6e16f5ae6081 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 13:10:57 -0500 Subject: [PATCH 25/27] Revert copyright --- .../detail/generate_resource_spec/generate_resource_spec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp b/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp index 111993d6..c0d93ca3 100644 --- a/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp +++ b/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2024, NVIDIA CORPORATION. + * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From a0fde3309cb50757879763790e7f69666754863c Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 13:13:02 -0500 Subject: [PATCH 26/27] Revert "Revert copyright" This reverts commit ebbea1e50fc2649acb1213c38b4f6e16f5ae6081. --- .../detail/generate_resource_spec/generate_resource_spec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp b/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp index c0d93ca3..111993d6 100644 --- a/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp +++ b/rapids-cmake/test/detail/generate_resource_spec/generate_resource_spec.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 5796af65fc38fd009be5e63074fe4ce0cf93b5cc Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 8 Feb 2024 17:00:21 -0500 Subject: [PATCH 27/27] Use sccache again - this will work once we upgrade to 0.7.6 --- rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt index af5ef5de..dfd7c97f 100644 --- a/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt +++ b/rapids-cmake/test/detail/generate_resource_spec/CMakeLists.txt @@ -26,9 +26,6 @@ if(cuda_toolkit) endif() set_property(SOURCE generate_resource_spec.cpp PROPERTY LANGUAGE ${lang}) -set_property(TARGET generate_ctest_json PROPERTY CXX_COMPILER_LAUNCHER) -set_property(TARGET generate_ctest_json PROPERTY CUDA_COMPILER_LAUNCHER) - add_custom_command(TARGET generate_ctest_json POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ "${output_file}" COMMENT "Copying executable to destination")