mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-13 01:29:02 -05:00
CUDAToolkit: Add CUDA 12.9 nvtx3 updates
Starting in CUDA 12.9 the `nvToolsExt` library is no longer provided. C and C++ projects should switch over to `nvtx3`. Projects that previously used `nvToolsExt` with Fortran, can now use the new `CUDA::nvtx3_interop` target for the same functionality with the new NVTX v3 API.
This commit is contained in:
committed by
Brad King
parent
a2dc4b4e9b
commit
c88d5cdd06
@@ -458,6 +458,7 @@ nvToolsExt
|
|||||||
.. deprecated:: 3.25
|
.. deprecated:: 3.25
|
||||||
|
|
||||||
With CUDA 10.0+, use `nvtx3`_.
|
With CUDA 10.0+, use `nvtx3`_.
|
||||||
|
Starting in CUDA 12.9 the `nvToolsExt` library no longer exists
|
||||||
|
|
||||||
The `legacy NVIDIA Tools Extension`_.
|
The `legacy NVIDIA Tools Extension`_.
|
||||||
This is a shared library only.
|
This is a shared library only.
|
||||||
@@ -482,6 +483,14 @@ Targets created:
|
|||||||
|
|
||||||
- ``CUDA::nvtx3``
|
- ``CUDA::nvtx3``
|
||||||
|
|
||||||
|
|
||||||
|
- ``CUDA::nvtx3_interop``
|
||||||
|
|
||||||
|
.. versionadded:: 4.1
|
||||||
|
|
||||||
|
This is provided by CUDA 12.9 and above for use by languages that
|
||||||
|
cannot consume C++ header-only libraries, such as ``Fortran``.
|
||||||
|
|
||||||
.. _`NVIDIA Tools Extension`: https://nvidia.github.io/NVTX/doxygen
|
.. _`NVIDIA Tools Extension`: https://nvidia.github.io/NVTX/doxygen
|
||||||
|
|
||||||
OpenCL
|
OpenCL
|
||||||
@@ -1394,26 +1403,7 @@ if(CUDAToolkit_FOUND)
|
|||||||
_CUDAToolkit_find_and_add_import_lib(nvml ALT nvidia-ml nvml)
|
_CUDAToolkit_find_and_add_import_lib(nvml ALT nvidia-ml nvml)
|
||||||
_CUDAToolkit_find_and_add_import_lib(nvml_static ONLY_SEARCH_FOR libnvidia-ml.a libnvml.a)
|
_CUDAToolkit_find_and_add_import_lib(nvml_static ONLY_SEARCH_FOR libnvidia-ml.a libnvml.a)
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
# nvtools can be installed outside the CUDA toolkit directory
|
|
||||||
# so prefer the NVTOOLSEXT_PATH windows only environment variable
|
|
||||||
# In addition on windows the most common name is nvToolsExt64_1
|
|
||||||
find_library(CUDA_nvToolsExt_LIBRARY
|
|
||||||
NAMES nvToolsExt64_1 nvToolsExt64 nvToolsExt
|
|
||||||
PATHS ENV NVTOOLSEXT_PATH
|
|
||||||
ENV CUDA_PATH
|
|
||||||
PATH_SUFFIXES lib/x64 lib
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
_CUDAToolkit_find_and_add_import_lib(nvToolsExt ALT nvToolsExt64)
|
|
||||||
|
|
||||||
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.0)
|
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.0)
|
||||||
# nvToolsExt is deprecated since nvtx3 introduction.
|
|
||||||
# Warn only if the project requires a sufficiently new CMake to make migration possible.
|
|
||||||
if(TARGET CUDA::nvToolsExt AND CMAKE_MINIMUM_REQUIRED_VERSION VERSION_GREATER_EQUAL 3.25)
|
|
||||||
set_property(TARGET CUDA::nvToolsExt PROPERTY DEPRECATION "nvToolsExt has been superseded by nvtx3 since CUDA 10.0 and CMake 3.25. Use CUDA::nvtx3 and include <nvtx3/nvToolsExt.h> instead.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Header-only variant. Uses dlopen().
|
# Header-only variant. Uses dlopen().
|
||||||
if(NOT TARGET CUDA::nvtx3)
|
if(NOT TARGET CUDA::nvtx3)
|
||||||
add_library(CUDA::nvtx3 INTERFACE IMPORTED)
|
add_library(CUDA::nvtx3 INTERFACE IMPORTED)
|
||||||
@@ -1421,6 +1411,35 @@ if(CUDAToolkit_FOUND)
|
|||||||
target_link_libraries(CUDA::nvtx3 INTERFACE ${CMAKE_DL_LIBS})
|
target_link_libraries(CUDA::nvtx3 INTERFACE ${CMAKE_DL_LIBS})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 12.9)
|
||||||
|
if(NOT TARGET CUDA::nvtx3_interop)
|
||||||
|
_CUDAToolkit_find_and_add_import_lib(nvtx3_interop ALT nvtx3interop)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# nvToolsExt is removed starting in 12.9
|
||||||
|
if(CUDAToolkit_VERSION VERSION_LESS 12.9)
|
||||||
|
if(WIN32)
|
||||||
|
# nvtools can be installed outside the CUDA toolkit directory
|
||||||
|
# so prefer the NVTOOLSEXT_PATH windows only environment variable
|
||||||
|
# In addition on windows the most common name is nvToolsExt64_1
|
||||||
|
find_library(CUDA_nvToolsExt_LIBRARY
|
||||||
|
NAMES nvToolsExt64_1 nvToolsExt64 nvToolsExt
|
||||||
|
PATHS ENV NVTOOLSEXT_PATH
|
||||||
|
ENV CUDA_PATH
|
||||||
|
PATH_SUFFIXES lib/x64 lib
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
_CUDAToolkit_find_and_add_import_lib(nvToolsExt ALT nvToolsExt64)
|
||||||
|
|
||||||
|
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.0)
|
||||||
|
# nvToolsExt is deprecated since nvtx3 introduction.
|
||||||
|
# Warn only if the project requires a sufficiently new CMake to make migration possible.
|
||||||
|
if(TARGET CUDA::nvToolsExt AND CMAKE_MINIMUM_REQUIRED_VERSION VERSION_GREATER_EQUAL 3.25)
|
||||||
|
set_property(TARGET CUDA::nvToolsExt PROPERTY DEPRECATION "nvToolsExt has been superseded by nvtx3 since CUDA 10.0 and CMake 3.25. Use CUDA::nvtx3 and include <nvtx3/nvToolsExt.h> instead.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
_CUDAToolkit_find_and_add_import_lib(OpenCL)
|
_CUDAToolkit_find_and_add_import_lib(OpenCL)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user