From ac2ccbd1acf0c55c007925b00587880240ae372d Mon Sep 17 00:00:00 2001 From: "k.koide" Date: Mon, 22 Jul 2024 15:03:11 +0900 Subject: [PATCH 1/2] lowering cuda architecture --- CMakeLists.txt | 6 +++--- src/gtsam_points/cuda/gl_buffer_map.cu | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d81880cc..f4ba84f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,11 +50,11 @@ if(BUILD_WITH_CUDA) endif() else() if(BUILD_WITH_CUDA_MULTIARCH) - set(CMAKE_CUDA_ARCHITECTURES 75 80 89 90 CACHE STRING "CUDA architectures" FORCE) + set(CMAKE_CUDA_ARCHITECTURES 75 80 87 89 90 CACHE STRING "CUDA architectures" FORCE) else() if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES OR CMAKE_CUDA_ARCHITECTURES STREQUAL "52") - message(WARNING "CMAKE_CUDA_ARCHITECTURES is not defined. Set to 89 by default") - set(CMAKE_CUDA_ARCHITECTURES 89 CACHE STRING "CUDA architectures" FORCE) + message(WARNING "CMAKE_CUDA_ARCHITECTURES is not defined. Set to 80 by default") + set(CMAKE_CUDA_ARCHITECTURES 80 CACHE STRING "CUDA architectures" FORCE) endif() endif() endif() diff --git a/src/gtsam_points/cuda/gl_buffer_map.cu b/src/gtsam_points/cuda/gl_buffer_map.cu index fbd34c39..0808c5b7 100644 --- a/src/gtsam_points/cuda/gl_buffer_map.cu +++ b/src/gtsam_points/cuda/gl_buffer_map.cu @@ -3,6 +3,7 @@ #include +#include #include #include From f63e1f8e5104ac515a316454eaebacc82be725e8 Mon Sep 17 00:00:00 2001 From: "k.koide" Date: Mon, 22 Jul 2024 15:13:38 +0900 Subject: [PATCH 2/2] avoid overriding specified cuda architecture --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4ba84f6..9b5bc600 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ if(BUILD_WITH_CUDA) if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0") if(BUILD_WITH_CUDA_MULTIARCH) set(CMAKE_CUDA_ARCHITECTURES "all-major" CACHE STRING "CUDA architectures" FORCE) - else() + elseif(NOT DEFINED CMAKE_CUDA_ARCHITECTURES OR CMAKE_CUDA_ARCHITECTURES STREQUAL "52") set(CMAKE_CUDA_ARCHITECTURES "native" CACHE STRING "CUDA architectures" FORCE) endif() else()