summaryrefslogtreecommitdiffstats
path: root/Modules/CUDA
Commit message (Collapse)AuthorAgeFilesLines
* CUDA: Add support for the two new architectures in 11.8Robert Maynard2022-10-071-0/+6
| | | | CUDA 11.8 introduces ada ( 89 ), and hopper ( 90 ).
* CUDA: native/all/all-major generates minimal set of ptx codeRobert Maynard2022-05-031-0/+11
| | | | Fixes #23459
* CUDA: Defer architecture testing to the compiler testing stepBrad King2022-04-251-60/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Verifying the architectures during compiler identification is redundant, and requires a lot more up-front information than we should need. It also causes unsupported architectures to break the compiler id and version detection, so the resulting output from CMake does not report the compiler version, which is useful information to know why the specified architectures are not supported. The "detecting compiler ABI info" and "check for working compiler" steps already pass `CMAKE_CUDA_ARCHITECTURES` into their test projects. Therefore we can just drop the earlier architecture testing. Bad architectures will be reported as a not-working compiler, and the output will include the compiler's error message. This reverts the approach from: * commit 19cc5bc296 (CUDA: Throw error if user-specified architectures don't work, 2020-05-26, v3.18.0-rc1~79^2) * commit 650c1029a0 (CUDA: Detect non-working user-specified architectures on NVCC, 2020-05-28, v3.18.0-rc1~51^2) * commit 01428c5560 (CUDA: Fail fast if CMAKE_CUDA_ARCHITECTURES doesn't work during detection, 2020-08-29, v3.19.0-rc1~241^2). Their goal was in part to avoid waiting until the test for working compiler to detect unsupported architectures. However, experience has shown that failing earlier is more trouble than it's worth. Fixes: #23161 Issue: #20756
* ci: Clamp CUDA 'native' architecture to values supported by its toolkitBrad King2022-03-161-1/+21
| | | | | | | | | | | | | | | | | | | The `native` architecture compiles for the host's GPUs, but our CI jobs may may run on hosts with GPUs newer than supported by their version of the CUDA toolkit. Add an undocumented environment variable to tell CMake to clamp the native architecture to that supported by the toolkit. Without this, we may try to compile for architectures not supported by the CUDA Toolkit, which fails. Since commit d1b48bfabd (CUDA: Add support for CUDA_ARCHITECTURES=native, 2022-03-04), our CUDA 9.2 CI job fails when it runs on a CI host with a GPU architecture newer than that CUDA 9.2 supports. Clamping the architecture level fixes that. Do not document this clamp behavior publicly, at least for now. Users can be responsible for building with a CUDA toolkit recent enough to support their host's GPUs. Issue: #22375
* CUDA: Add support for CUDA_ARCHITECTURES=nativeBrad King2022-03-101-0/+40
| | | | | | | | | | | CUDA 11.6 added the `nvcc -arch=native` flag to automatically compile for the host GPUs' architectures. Add support for specifying this special `native` value in `CMAKE_CUDA_ARCHITECTURES` and `CUDA_ARCHITECTURES`. During the compiler ABI detection step, detect the native architectures so we can pass them explicitly when using Clang or older versions of nvcc. Fixes: #22375
* CUDA: Generic all and all-major supportRaul Tambre2022-02-011-0/+46
Commit 14d8a276 (CUDA: Support nvcc 11.5 new -arch=all|all-major flags, 2021-08-17) added all and all-major options to CUDA_ARCHITECTURES. These are fairly generic and likely to see real-world use by distributors. Thus it's desirable to support these also for Clang and older NVCC versions. The supported architectures are dependent on the toolkit version. We determine the toolkit version prior to compiler detection. For NVCC we get the version from the vendor identification output, but for Clang we need to invoke NVCC separately. The architecture information is mostly based on the Wikipedia list with the earliest supported version being CUDA 7.0. This could be documented and expanded in the future to allow projects to query CUDA toolkit version and architecture information. For Clang we additionally constrain based on its support. Additionally the architecture mismatch detection logic is fixed, improved and updated for generic support: * Commit 01428c55 (CUDA: Fail fast if CMAKE_CUDA_ARCHITECTURES doesn't work during detection, 2020-08-29) enabled CMAKE_CUDA_COMPILER_ID_REQUIRE_SUCCESS if CMAKE_CUDA_ARCHITECTURES is specified. This results in CMakeDetermineCompilerID.cmake printing the compiler error and our code for presenting the mismatch in a user-friendly way being useless. The custom logic seems preferable so go back to not enabling it. * Commit 14d8a276 (CUDA: Support nvcc 11.5 new -arch=all|all-major flags, 2021-08-17) tried to support CMP0054 but forgot to add x to the interpolated result. Thus the conditions would always evaluate to false. This is fixed as a byproduct of removing NVIDIA specific checks, improving the error message and replacing architectures_mode with a simpler architectures_explicit. Visual Studio support omits testing the flags during detection due to complexities in determining the toolkit version when using it. A long-term proper implementation would be #23161. Implements #22860.