diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a50b70a614f..c5dab02900f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -50,7 +50,6 @@ jobs: CUDA_VERSION: 11.0.3 env: BUILD_WEBRTC: ${{ ( matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' ) && 'ON' || 'OFF' }} - CUDAARCHS: 75 # Turing, oldest supported CUDA arch for CUDA v12. Required if no CUDA GPU on build machine. steps: - name: Disk space used diff --git a/CMakeLists.txt b/CMakeLists.txt index 9611d2bf955..11bc0754dd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -404,7 +404,7 @@ cmake_language(EVAL CODE "cmake_language(DEFER CALL open3d_patch_findthreads_mod if(BUILD_CUDA_MODULE) if(BUILD_COMMON_CUDA_ARCHS) if (CMAKE_CUDA_ARCHITECTURES) - message(STATUS "Building with user-provided architectures.") + message(STATUS "Building with user-provided architectures: ${CMAKE_CUDA_ARCHITECTURES}") else() # Build with all supported architectures for previous 2 generations and # M0 (minor=0) architectures for previous generations (including @@ -424,11 +424,17 @@ if(BUILD_CUDA_MODULE) else() set(CMAKE_CUDA_ARCHITECTURES 30-real 50-real 60-real 70-real 75) # Kepler, Maxwell, Pascal, Turing endif() + message(STATUS "Using CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}") endif() else() - set(CMAKE_CUDA_ARCHITECTURES native) + execute_process(COMMAND nvidia-smi RESULT_VARIABLE HAVE_NVIDIA_GPU) + if (HAVE_NVIDIA_GPU) + message(STATUS "Building with native CUDA architecture.") + set(CMAKE_CUDA_ARCHITECTURES native) + else() + message(WARNING "No CUDA GPU detected. Building with default CUDA architecture.") + endif() endif() - message(STATUS "Using CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}") enable_language(CUDA) if (CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "10.1") message(FATAL_ERROR "CUDA 10.0 and older are not supported. Please upgrade to CUDA 10.1 or newer.")