Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapted find_dependencies.cmake to build with CUDA >= 12.0 with dynamic libraries as well #6815

Merged
merged 5 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 51 additions & 19 deletions 3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1772,16 +1772,30 @@ if(BUILD_CUDA_MODULE)
CUDA::culibos
)
else()
# In CUDA12.0 the liblapack_static.a is deprecated and removed.
# In CUDA 12.0 the liblapack_static.a is deprecated and removed.
# Use the libcusolver_lapack_static.a instead.
target_link_libraries(3rdparty_cublas INTERFACE
CUDA::cusolver_static
${CUDAToolkit_LIBRARY_DIR}/libcusolver_lapack_static.a
CUDA::cusparse_static
CUDA::cublas_static
CUDA::cublasLt_static
CUDA::culibos
)
# Use of static libraries is preferred.
if(BUILD_WITH_CUDA_STATIC)
# Use static CUDA libraries.
target_link_libraries(3rdparty_cublas INTERFACE
CUDA::cusolver_static
${CUDAToolkit_LIBRARY_DIR}/libcusolver_lapack_static.a
CUDA::cusparse_static
CUDA::cublas_static
CUDA::cublasLt_static
CUDA::culibos
)
else()
# Use shared CUDA libraries.
target_link_libraries(3rdparty_cublas INTERFACE
CUDA::cusolver
${CUDAToolkit_LIBRARY_DIR}/libcusolver.so
CUDA::cusparse
CUDA::cublas
CUDA::cublasLt
CUDA::culibos
)
endif()
endif()
if(NOT BUILD_SHARED_LIBS)
# Listed in ${CMAKE_INSTALL_PREFIX}/lib/cmake/Open3D/Open3DTargets.cmake.
Expand All @@ -1808,16 +1822,34 @@ if (BUILD_CUDA_MODULE)
CUDA::nppial
)
else()
open3d_find_package_3rdparty_library(3rdparty_cuda_npp
REQUIRED
PACKAGE CUDAToolkit
TARGETS CUDA::nppc_static
CUDA::nppicc_static
CUDA::nppif_static
CUDA::nppig_static
CUDA::nppim_static
CUDA::nppial_static
)
if(BUILD_WITH_CUDA_STATIC)
# Use static CUDA libraries.
open3d_find_package_3rdparty_library(3rdparty_cuda_npp
REQUIRED
PACKAGE CUDAToolkit
TARGETS CUDA::nppc_static
CUDA::nppicc_static
CUDA::nppif_static
CUDA::nppig_static
CUDA::nppim_static
CUDA::nppial_static
)
else()
# Use shared CUDA libraries.
open3d_find_package_3rdparty_library(3rdparty_cuda_npp
REQUIRED
PACKAGE CUDAToolkit
TARGETS CUDA::nppc
CUDA::nppicc
CUDA::nppif
CUDA::nppig
CUDA::nppim
CUDA::nppial
)
endif()
endif()
if(NOT 3rdparty_cuda_npp_FOUND)
message(FATAL_ERROR "CUDA NPP libraries not found.")
endif()
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_cuda_npp)
endif ()
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ option(BUILD_UNIT_TESTS "Build Open3D unit tests" OFF
option(BUILD_BENCHMARKS "Build the micro benchmarks" OFF)
option(BUILD_PYTHON_MODULE "Build the python module" ON )
option(BUILD_CUDA_MODULE "Build the CUDA module" OFF)
option(BUILD_WITH_CUDA_STATIC "Build with static CUDA libraries" ON )
option(BUILD_COMMON_CUDA_ARCHS "Build for common CUDA GPUs (for release)" OFF)
if (WIN32) # Causes CUDA runtime error on Windows (See issue #6555)
option(ENABLE_CACHED_CUDA_MANAGER "Enable cached CUDA memory manager" OFF)
Expand Down
Loading