Commit Graph

125 Commits

Author SHA1 Message Date
Kyle Edwards
b3f02006f0
FindCUDAToolkit: Add ability to find static version of nvml
Fixes: #26131
2024-07-15 10:35:36 -04:00
Robert Maynard
eed16fbc00
FindCUDAToolkit: Use CUDA compiler path even when CUDA lang not enabled
Fixes: #25567
2024-05-29 14:39:29 -04:00
Brad King
5ec306fb13 FindCUDAToolkit: Replace a documentation link with its permanent redirect 2024-04-23 08:02:54 -04:00
Brad King
480cf4a714 FindCUDAToolkit: Replace documentation links with their permanent redirects 2024-04-02 08:43:12 -04:00
Robert Maynard
d47c5e3358
FindCUDAToolkit: Remove unneeded dependencies on the cuda driver
The nvrtc-builtins and nvptxcompiler projects don't required linking
to the cuda driver. We previously did this due to reading the
upstream documentation incorrectly.
2024-03-11 15:51:11 -04:00
Robert Maynard
d420ee6b43
FindCUDAToolkit: Add support for nvfatbin added in 12.4 2024-03-05 16:43:09 -05:00
Robert Maynard
17d758b36d
FindCUDAToolkit: Fix cuda driver dependencies
Fixes: #25665
2024-02-12 13:29:41 -05:00
Brad King
070810b324 Merge topic 'FindCUDAToolkit-cudart-deps' into release-3.29
4a3cafec4f FindCUDAToolkit: Fix cudart dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9236
2024-02-09 09:00:03 -05:00
Robert Maynard
4a3cafec4f FindCUDAToolkit: Fix cudart dependencies
Fixes: #25665
2024-02-08 12:57:13 -05:00
Brad King
dd4a6dff92 Link explicitly to private transitive dependencies on stub libraries
We represent stub libraries, e.g., for CUDA, using imported `SHARED`
library targets with only `IMPORTED_IMPLIB`, and no `IMPORTED_LOCATION`,
to indicate that the stub file is meant only for linkers and not dynamic
loaders.  See commit 7351d590ee (cmTarget: Add a way to represent
imported shared library stubs, 2023-07-17, v3.28.0-rc1~344^2) and commit
fc6508921c (cmComputeLinkInformation: Restore soname lookup for
non-imported targets, 2023-12-05, v3.28.0~4^2).

If a shared library is linked to a stub, it has a `NEEDED` field
populated with the `SONAME` found in the stub.  When a dependent target
links to such a shared library, some linkers want to find a library file
on disk and load it to see what symbols it provides.  This is necessary
for linkers that enforce `--no-allow-shlib-undefined`.  On hosts with
only the stub library installed, e.g., with only the CUDA toolkit
development package, the real runtime library corresponding to the
stub's `SONAME` may not even exist, so no `-rpath-link` flag can help
linkers find it.  Pass the stub library to linkers explicitly so they
can find it without searching.
2024-01-04 11:59:26 -05:00
Robert Maynard
09a3c8b46b
CUDAToolkit: Correctly search all include paths from compiler
The CUDAToolkit usage of `find_path( PATHS )` was incorrectly
quoting a list of paths causing none of them to be used.
2023-12-14 14:04:53 -05:00
Brad King
7cbf1f7a58 Merge topic 'bug/fix_cupti_regression' into release-3.28
f69b9b7305 CUDAToolkit: Restore ability to find cupti headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Misha Chornyi <mchornyi@nvidia.com>
Merge-request: !9054
2023-12-12 08:36:26 -05:00
Robert Maynard
f69b9b7305
CUDAToolkit: Restore ability to find cupti headers
Fixes #25484

PR !8835 failed to update the CUPTI header searches to use the
new internal FindCUDAToolkit search variables. This caused the
CUDA::cupti target to always not exist.
2023-12-08 11:46:54 -05:00
Brad King
d85bf99bcb FindCUDAToolkit: Fix stub library representation on reconfigure
Since commit 0744c02e24 (FindCUDAToolkit: targets pointing to stubs now
use IMPORTED_IMPLIB, 2023-07-24, v3.28.0-rc1~309^2) we recognize CUDA
stub libraries and represent them in a special way.  However, the logic
only works on the first configuration of a build tree when the libraries
are first found.  Once the results are cached, we incorrectly revert to
the non-stub representation.

Fix this by recognizing stub libraries based on their path instead.
2023-12-06 16:10:24 -05:00
Robert Maynard
b38a8e77cb
FindCUDAToolkit: Search for cufile library name being lowercase
Fixes #25398
2023-11-08 10:43:30 -05:00
Robert Maynard
0b6ae9c467 FindCUDAToolkit: Restore CUDAToolkit_LIBRARY_SEARCH_DIRS variable
This was accidentally dropped by commit 4316d4dcfd (FindCUDAToolkit:
Search all of `nvcc` implicit includes and library dirs, 2023-09-26).
2023-10-04 12:10:02 -04:00
Robert Maynard
4316d4dcfd FindCUDAToolkit: Search all of nvcc implicit includes and library dirs
Improves the handling of CUDA layouts where we have multiple include
and library directories listed in the output of `nvcc -v`. This
updates both when the CUDA language is enabled or not.

Fixes: #24915
2023-09-27 13:28:52 -04:00
Robert Maynard
0744c02e24
FindCUDAToolkit: targets pointing to stubs now use IMPORTED_IMPLIB
This ensures that we don't add rpath entries to the stubs directory
which would cause runtime loading of the wrong libraries.
2023-07-24 14:56:28 -04:00
Brad King
6194193a8a Merge topic 'file-REAL_PATH-relative'
6b5f2dbbfe file(REAL_PATH): resolve symlinks before '..' components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8605
2023-07-24 08:43:19 -04:00
Brad King
32174571e9 Merge topic 'FindCUDAToolkit-libnvrtc-builtins'
c2601d01d1 FindCUDAToolkit: Fix nvrtc_builtins library name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !8642
2023-07-21 09:35:10 -04:00
Robert Maynard
6b5f2dbbfe
file(REAL_PATH): resolve symlinks before '..' components
Previously REAL_PATH would collapse paths before resolving any symlinks
so if `..` crossed a symlink the output from `REAL_PATH` would be wrong.

It looked like REAL_PATH did this by mistake since it was a side-effect
of ensuring we had an absolute path before resolving symlinks.
2023-07-20 17:02:58 -04:00
Tomoharu Kitawaki
c2601d01d1 FindCUDAToolkit: Fix nvrtc_builtins library name
The lib is named `libnvrtc-builtins.so`, not `libnvrtc_builtins.so`.

Update the change from commit 2a94c762ed (FindCUDAToolkit: Add support
for CUDA::nvrtc_static, 2023-01-20, v3.26.0-rc1~55^2).  Apply a fix
similar to commit 9688a8ebc2 (FindCUDAToolkit: Fix
`nvrtc_builtins_static` library name, 2023-02-03, v3.26.0-rc2~15^2).
2023-07-20 11:34:47 -04:00
Robert Maynard
f9579ffaa6 FindCUDAToolkit: Add cupti nvperf and pcsampling targets 2023-06-07 13:58:09 -04:00
Brad King
76940fecde Merge topic 'FindCUDAToolkit_more_library_root_detection'
587c0443cc FindCUDAToolkit: Support CUDA version extraction from version.json

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8451
2023-05-05 12:34:54 -04:00
Robert Maynard
587c0443cc FindCUDAToolkit: Support CUDA version extraction from version.json
Fixes: #24858
2023-05-04 12:26:04 -04:00
Brad King
3df699544b Merge topic 'update_FindCUDAToolkit_nvrtc_notes'
0e0eb12918 FindCUDAToolkit: Update nvrtc section to clarify a static version exists

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8436
2023-04-28 10:09:40 -04:00
Robert Maynard
0e0eb12918 FindCUDAToolkit: Update nvrtc section to clarify a static version exists
Fixes #24798
2023-04-27 08:53:32 -04:00
Brad King
b92e21cab8 Merge topic 'FindCUDAToolkit-static-deps'
1d6c343661 FindCUDAToolkit: Add missing static library dependencies on pthread and libdl

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8422
2023-04-26 10:22:27 -04:00
Brad King
b548c7efa6 Merge topic 'FindCUDAToolkit-static-deps' into release-3.26
1d6c343661 FindCUDAToolkit: Add missing static library dependencies on pthread and libdl

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8422
2023-04-26 10:22:26 -04:00
Brad King
768c36e256 Merge topic 'FindCUDAToolkit_nvrtc_windows_dependencies'
11a9f88bdf FindCUDAToolkit: Fix nvrtc_static dependencies on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8405
2023-04-26 10:21:13 -04:00
Robert Maynard
1d6c343661 FindCUDAToolkit: Add missing static library dependencies on pthread and libdl
Discourse-topic: https://discourse.cmake.org/t/7946
2023-04-26 10:19:59 -04:00
Robert Maynard
11a9f88bdf FindCUDAToolkit: Fix nvrtc_static dependencies on Windows
Required for CUDA toolkit 11.5:

* https://docs.nvidia.com/cuda/archive/11.5.0/nvrtc/index.html#build-instruction
2023-04-25 13:37:19 -04:00
Brad King
8b9c2b0009 Merge topic 'FindCUDAToolkit-nvptxcompiler_static-deps'
8711231739 FindCUDAToolkit: nvptxcompiler_static correctly specify dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8395
2023-04-06 09:05:50 -04:00
Brad King
038cd7f620 Merge topic 'FindCUDAToolkit-nvptxcompiler_static-deps' into release-3.26
8711231739 FindCUDAToolkit: nvptxcompiler_static correctly specify dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8395
2023-04-06 09:05:49 -04:00
Brad King
d797c3c8e9 Merge topic 'FindCUDAToolkit-cusparse-deps'
516d807423 FindCUDAToolkit: Add dependency between cusparse and nvJitLink

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8397
2023-04-06 09:04:43 -04:00
Robert Maynard
516d807423 FindCUDAToolkit: Add dependency between cusparse and nvJitLink
Starting in CUDA 12.0 cusparse uses nvJitLink. As part of verifying this PR I also corrected the nvJitLink dependencies
2023-04-05 11:37:06 -04:00
Robert Maynard
8711231739 FindCUDAToolkit: nvptxcompiler_static correctly specify dependencies
Avoids linking to `Threads::Threads` on non-unix systems where it isn't needed. In addition ensures that dlopen symbols are resolved.
2023-04-05 10:57:55 -04:00
Andrey Alekseenko
9be0063d98 FindCUDAToolkit: mark a few variables as advanced
- CUDAToolkit_BIN_DIR (was already "advanced" sometimes)
- CUDAToolkit_CUPTI_INCLUDE_DIR
2023-03-18 00:55:24 +01:00
Robert Maynard
21b102c77d FindCUDAToolkit: Add support for finding Tegra cudla library
Fixes #24575
2023-03-07 13:47:16 -05:00
Brad King
3c5b34af9d Help: Replace links with their permanent redirects 2023-02-17 08:45:01 -05:00
Brad King
1004be159f FindCUDAToolkit: Replace broken links to NVIDIA documentation
The cuFile API documentation has moved, so link to its new location.

The nvGRAPH library has been removed, so link to a web archive copy.

The NTVX library has a higher-level landing page.
2023-02-17 08:44:02 -05:00
Paul Taylor
9688a8ebc2 FindCUDAToolkit: Fix nvrtc_builtins_static library name
Update the change from commit 2a94c762ed (FindCUDAToolkit: Add support
for CUDA::nvrtc_static, 2023-01-20, v3.26.0-rc1~55^2).  The lib is named
`libnvrtc-builtins_static.a`, not `libnvrtc_builtins_static.a`.
2023-02-06 09:36:43 -05:00
Robert Maynard
2a94c762ed FindCUDAToolkit: Add support for CUDA::nvrtc_static 2023-01-20 12:05:43 -05:00
Robert Maynard
743d4181b4 FindCUDAToolkit: Support cross-compilation to sbsa-linux
Fixes #24192
2023-01-11 11:27:37 -05:00
Robert Maynard
e60fa80fbe FindCUDAToolkit: Handle CUDA::nvToolsExt not existing 2023-01-11 11:27:37 -05:00
Robert Maynard
d37d9c098c FindCUDAToolkit: Support the new nvJitLink library in CUDA 12 2022-12-12 13:28:50 -05:00
Robert Maynard
9d012b1f69 FindCUDAToolkit: Ensure that paths provided have no symlinks
Fixes: #24188
2022-11-30 16:39:00 -05:00
Brad King
9b9a421668 Merge topic 'find_cuda_toolkit_support_symlink_math_dirs'
989d50d7fc FindCUDAToolkit: Support nvhpc splayed layouts without symlinks
207518b6e8 FindCUDAToolkit: Handle CUDAToolkit_TARGET_DIR dir being a symlink

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7945
2022-11-23 07:11:59 -05:00
Robert Maynard
989d50d7fc FindCUDAToolkit: Support nvhpc splayed layouts without symlinks 2022-11-22 09:02:08 -05:00
Brad King
66b64b5984 Merge topic 'FindCUDAToolkit_handle_nvptxcompiler_static_not_existing'
c7ece269da FindCUDAToolkit: Handle toolkits that don't provide nvptxcompiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7932
2022-11-18 09:23:36 -05:00