diff --git a/rapids-cmake/cuda/set_architectures.cmake b/rapids-cmake/cuda/set_architectures.cmake index bc8ee253..0c52c808 100644 --- a/rapids-cmake/cuda/set_architectures.cmake +++ b/rapids-cmake/cuda/set_architectures.cmake @@ -85,6 +85,13 @@ function(rapids_cuda_set_architectures mode) list(TRANSFORM CMAKE_CUDA_ARCHITECTURES APPEND "-real") endif() + # CUDA 12.8.0 and later warns when compiling for arch 70. We ignore this warning when compiling + # for RAPIDS architectures. + if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL + 12.8.0) + string(APPEND CMAKE_CUDA_FLAGS " -Wno-deprecated-gpu-targets") + endif() + # cache the cuda archs. get_property(cached_value GLOBAL PROPERTY rapids_cuda_architectures) if(NOT cached_value) @@ -103,5 +110,6 @@ function(rapids_cuda_set_architectures mode) # Set as a local variable to maintain comp set(CMAKE_CUDA_ARCHITECTURES ${CMAKE_CUDA_ARCHITECTURES} PARENT_SCOPE) + set(CMAKE_CUDA_FLAGS ${CMAKE_CUDA_FLAGS} PARENT_SCOPE) endfunction() diff --git a/testing/cuda/validate-cuda-native.cmake b/testing/cuda/validate-cuda-native.cmake index 1d680f48..2eea5a98 100644 --- a/testing/cuda/validate-cuda-native.cmake +++ b/testing/cuda/validate-cuda-native.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021-2024, NVIDIA CORPORATION. +# Copyright (c) 2021-2025, 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,9 @@ endforeach() if(NOT DEFINED CACHE{CMAKE_CUDA_ARCHITECTURES} ) message(FATAL_ERROR "rapids_cuda_set_architectures didn't make CMAKE_CUDA_ARCHITECTURES a cache variable") endif() + +if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8.0 ) + if(NOT CMAKE_CUDA_FLAGS MATCHES "Wno-deprecated-gpu-targets") + message(FATAL_ERROR "CMAKE_CUDA_FLAGS should have -Wno-deprecated-gpu-targets") + endif() +endif() diff --git a/testing/cuda/validate-cuda-rapids.cmake b/testing/cuda/validate-cuda-rapids.cmake index 54455362..b1fcab9b 100644 --- a/testing/cuda/validate-cuda-rapids.cmake +++ b/testing/cuda/validate-cuda-rapids.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021-2024, NVIDIA CORPORATION. +# Copyright (c) 2021-2025, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,3 +48,9 @@ list(APPEND CMAKE_CUDA_ARCHITECTURES ${last_value}) if(NOT DEFINED CACHE{CMAKE_CUDA_ARCHITECTURES} ) message(FATAL_ERROR "rapids_cuda_set_architectures didn't make CMAKE_CUDA_ARCHITECTURES a cache variable") endif() + +if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8.0 ) + if(NOT CMAKE_CUDA_FLAGS MATCHES "Wno-deprecated-gpu-targets") + message(FATAL_ERROR "CMAKE_CUDA_FLAGS should have -Wno-deprecated-gpu-targets") + endif() +endif()