Skip to content

Commit 8cbb120

Browse files
ptheywoodmondus
authored andcommitted
Remove support for CUDA 11.0 and 11.1 and switch from Thrust to CCCL >= 2.3.2
- Does not remove all code/workarounds/checks related to 11.0 and 11.1, i.e. in case the previsouly compiler issues re-emerge - Fixes some typos in nearby code - CCCL >= 2.3.2 is required due for CMake and MSVC fixes in previous CCCL releases - Removes known issues for CUDA <= 11.1 from the readme Closes #1021
1 parent ee20d1c commit 8cbb120

File tree

13 files changed

+103
-191
lines changed

13 files changed

+103
-191
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ body:
4848
attributes:
4949
label: CUDA Versions
5050
description:
51-
placeholder: e.g. CUDA 11.0, CUDA 12.2
51+
placeholder: e.g. CUDA 11.2, CUDA 12.2
5252
validations:
5353
required: false
5454
- type: input

.github/workflows/Draft-Release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ jobs:
194194
cuda_arch: "35-real;90-real;90-virtual"
195195
hostcxx: "Visual Studio 16 2019"
196196
os: windows-2019
197-
- cuda: "11.0.3"
197+
- cuda: "11.2.2"
198198
cuda_arch: "35-real;80-real;80-virtual"
199199
hostcxx: "Visual Studio 16 2019"
200200
os: windows-2019

.github/workflows/Ubuntu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
cuda: "12.0"
6565
VISUALISATION: "ON"
6666
- cudacxx:
67-
cuda: "11.0"
67+
cuda: "11.2"
6868
VISUALISATION: "ON"
6969
# Exclude beltsoff builds for all but the most recent cuda
7070
- cudacxx:
@@ -76,7 +76,7 @@ jobs:
7676
config:
7777
name: "Beltsoff"
7878
- cudacxx:
79-
cuda: "11.0"
79+
cuda: "11.2"
8080
config:
8181
name: "Beltsoff"
8282
# Exclude beltsoff vis builds to keep the matrix lighter.

.github/workflows/Windows-Tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
cuda_arch: "35"
3636
hostcxx: "Visual Studio 16 2019"
3737
os: windows-2019
38-
- cuda: "11.0.3"
38+
- cuda: "11.2.2"
3939
cuda_arch: "35"
4040
hostcxx: "Visual Studio 16 2019"
4141
os: windows-2019

.github/workflows/Windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
cuda_arch: "35"
4242
hostcxx: "Visual Studio 16 2019"
4343
os: windows-2019
44-
- cuda: "11.0.3"
44+
- cuda: "11.2.2"
4545
cuda_arch: "35"
4646
hostcxx: "Visual Studio 16 2019"
4747
os: windows-2019
@@ -63,7 +63,7 @@ jobs:
6363
cuda: "12.0.0"
6464
VISUALISATION: "ON"
6565
- cudacxx:
66-
cuda: "11.0.3"
66+
cuda: "11.2.2"
6767
VISUALISATION: "ON"
6868
# Exclude beltsoff builds for all but the most recent cuda
6969
- cudacxx:
@@ -75,7 +75,7 @@ jobs:
7575
config:
7676
name: "Beltsoff"
7777
- cudacxx:
78-
cuda: "11.0.3"
78+
cuda: "11.2.2"
7979
config:
8080
name: "Beltsoff"
8181
# Exclude beltsoff vis builds to keep the matrix lighter.

CMakeLists.txt

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,15 @@ if(CMAKE_CUDA_COMPILER)
4949
flamegpu_set_cuda_architectures()
5050
endif()
5151

52-
# Set the minimum supported version of CUDA for FLAME GPU, currently 11.0
53-
set(MINIMUM_SUPPORTED_CUDA_VERSION 11.0)
54-
# Set the minimum, usable, but deprecated CUDA version. Currently there are no deprecated versions
55-
set(MINIMUM_CUDA_VERSION 11.0)
52+
# Set the minimum supported CUDA VERSION.
53+
set(MINIMUM_SUPPORTED_CUDA_VERSION 11.2)
5654

5755
# If the CUDA compiler is too old, trigger a docs only build.
58-
if(NOT DOCUMENTATION_ONLY_BUILD AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS ${MINIMUM_CUDA_VERSION})
56+
if(NOT DOCUMENTATION_ONLY_BUILD AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS ${MINIMUM_SUPPORTED_CUDA_VERSION})
5957
set(DOCUMENTATION_ONLY_BUILD ON)
6058
message(STATUS "Documentation-only build: CUDA ${MINIMUM_SUPPORTED_CUDA_VERSION} or greater is required for compilation.")
6159
endif()
6260

63-
# If the CUDA compiler is atleast the minimum deprecated version, but less than the minimum actually supported version, issue a dev warning.
64-
if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL ${MINIMUM_CUDA_VERSION} AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS ${MINIMUM_SUPPORTED_CUDA_VERSION})
65-
message(DEPRECATION "Support for CUDA verisons <= ${MINIMUM_SUPPORTED_CUDA_VERSION} is deprecated and will be removed in a future release.")
66-
endif()
67-
6861
# If CUDA is not available, or the minimum version is too low only build the docs.
6962
if(DOCUMENTATION_ONLY_BUILD)
7063
# Not able to build code, so just make docs
@@ -78,7 +71,7 @@ endif()
7871
# include for dependent modules
7972
include(CMakeDependentOption)
8073

81-
# Option to enable building all examples, defaults to ON if FLAMEPGU is the top level cmake, else OFF
74+
# Option to enable building all examples, defaults to ON if FLAMEGPU is the top level cmake, else OFF
8275
cmake_dependent_option(FLAMEGPU_BUILD_ALL_EXAMPLES "Enable building all FLAMEGPU examples" ON "FLAMEGPU_PROJECT_IS_TOP_LEVEL" OFF)
8376

8477
# Options to enable building individual examples, if FLAMEGPU_BUILD_ALL_EXAMPLES is off.

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Building FLAME GPU has the following requirements. There are also optional depen
6363

6464
+ [CMake](https://cmake.org/download/) `>= 3.18`
6565
+ `>= 3.20` if building python bindings using a multi-config generator (Visual Studio, Eclipse or Ninja Multi-Config)
66-
+ [CUDA](https://developer.nvidia.com/cuda-downloads) `>= 11.0` and a [Compute Capability](https://developer.nvidia.com/cuda-gpus) `>= 3.5` NVIDIA GPU.
66+
+ [CUDA](https://developer.nvidia.com/cuda-downloads) `>= 11.2` and a [Compute Capability](https://developer.nvidia.com/cuda-gpus) `>= 3.5` NVIDIA GPU.
6767
+ C++17 capable C++ compiler (host), compatible with the installed CUDA version
6868
+ [Microsoft Visual Studio 2019 or 2022](https://visualstudio.microsoft.com/) (Windows)
6969
+ *Note:* Visual Studio must be installed before the CUDA toolkit is installed. See the [CUDA installation guide for Windows](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html) for more information.
@@ -144,7 +144,7 @@ REM Alternatively, build from the command line specifying the build configuratio
144144
cmake --build . --config Release --target flamegpu boids_bruteforce --verbose
145145
```
146146

147-
On Windows, by default CMake will select the newest version of CUDA available when configuring. If you have multiple versions of CUDA installed then you can select an earlier installed CUDA version (e.g. CUDA 11.0) by additionally passing `-T cuda=11.0` when calling CMake configure (`cmake ..`).
147+
On Windows, by default CMake will select the newest version of CUDA available when configuring. If you have multiple versions of CUDA installed then you can select an earlier installed CUDA version (e.g. CUDA 11.2) by additionally passing `-T cuda=11.2` when calling CMake configure (`cmake ..`).
148148

149149
#### Configuring and Building a single example
150150

@@ -252,7 +252,7 @@ Several environmental variables are used or required by FLAME GPU 2.
252252

253253
| Environment Variable | Description |
254254
|--------------------------------------|-------------|
255-
| `CUDA_PATH` | Required when using RunTime Compilation (RTC), pointing to the root of the CUDA Toolkit where NVRTC resides. <br /> i.e. `/usr/local/cuda-11.0/` or `C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0`. <br /> Alternatively `CUDA_HOME` may be used if `CUDA_PATH` was not set. |
255+
| `CUDA_PATH` | Required when using RunTime Compilation (RTC), pointing to the root of the CUDA Toolkit where NVRTC resides. <br /> i.e. `/usr/local/cuda-11.2/` or `C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2`. <br /> Alternatively `CUDA_HOME` may be used if `CUDA_PATH` was not set. |
256256
| `FLAMEGPU_INC_DIR` | When RTC compilation is required, if the location of the `include` directory cannot be found it must be specified using the `FLAMEGPU_INC_DIR` environment variable. |
257257
| `FLAMEGPU_TMP_DIR` | FLAME GPU may cache some files to a temporary directory on the system, using the temporary directory returned by [`std::filesystem::temp_directory_path`](https://en.cppreference.com/w/cpp/filesystem/temp_directory_path). The location can optionally be overridden using the `FLAMEGPU_TMP_DIR` environment variable. |
258258
| `FLAMEGPU_RTC_INCLUDE_DIRS` | A list of include directories that should be provided to the RTC compiler, these should be separated using `;` (Windows) or `:` (Linux). If this variable is not found, the working directory will be used as a default. |
@@ -372,8 +372,5 @@ For a full list of known issues pleases see the [Issue Tracker](https://github.c
372372
373373
+ Warnings and a loss of performance due to hash collisions in device code ([#356](https://github.com/FLAMEGPU/FLAMEGPU2/issues/356))
374374
+ Multiple known areas where performance can be improved (e.g. [#449](https://github.com/FLAMEGPU/FLAMEGPU2/issues/449), [#402](https://github.com/FLAMEGPU/FLAMEGPU2/issues/402))
375-
+ Windows/MSVC builds using CUDA 11.0 may encounter errors when performing incremental builds if the static library has been recompiled. If this presents itself, re-save any `.cu` file in your executable producing project and re-trigger the build.
376-
+ Debug builds under linux with CUDA 11.0 may encounter cuda errors during `validateIDCollisions`. Consider using an alternate CUDA version if this is required ([#569](https://github.com/FLAMEGPU/FLAMEGPU2/issues/569)).
377-
+ CUDA 11.0 with GCC 9 may encounter a segmentation fault during compilation of the test suite. Consider using GCC 8 with CUDA 11.0.
378375
+ CUDA 12.2+ suffers from poor RTC compilation times, to be fixed in a future release ([#1118](https://github.com/FLAMEGPU/FLAMEGPU2/issues/1118)).
379376
+ Wrapped spatial message iteration with may incorrectly report that the radius is not a factor of the environment with `FLAMEGPU_SEATBELTS=ON` for certain floating point values, to be fixed in a future release ([#1177](https://github.com/FLAMEGPU/FLAMEGPU2/issues/1177)).

cmake/CUDAArchitectures.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ function(flamegpu_set_cuda_architectures)
215215
endif()
216216
message(AUTHOR_WARNING
217217
" ${CMAKE_CURRENT_FUNCTION} failed to parse NVCC --help output for default architecture generation\n"
218-
" Using ${default_archs} based on CUDA 11.0 to 11.8."
218+
" Using ${default_archs} based on CUDA 11.2 to 11.8."
219219
)
220220
endif()
221221
# We actually want real for each arch, then virtual for the final, but only for library-provided values, to only embed one arch worth of ptx.

cmake/common.cmake

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ endif()
2828

2929
# Ensure that other dependencies are downloaded and available.
3030
# As flamegpu is a static library, linking only only occurs at consumption not generation, so dependent targets must also know of PRIVATE shared library dependencies such as tinyxml2 and rapidjson, as well any intentionally public dependencies (for include dirs)
31-
include(${CMAKE_CURRENT_LIST_DIR}/dependencies/Thrust.cmake)
31+
include(${CMAKE_CURRENT_LIST_DIR}/dependencies/CCCL.cmake)
3232
include(${CMAKE_CURRENT_LIST_DIR}/dependencies/Jitify.cmake)
3333
include(${CMAKE_CURRENT_LIST_DIR}/dependencies/Tinyxml2.cmake)
3434
include(${CMAKE_CURRENT_LIST_DIR}/dependencies/rapidjson.cmake)
@@ -134,22 +134,14 @@ if(FLAMEGPU_ENABLE_NVTX)
134134
endif()
135135
endif(FLAMEGPU_ENABLE_NVTX)
136136

137-
# Set the minimum supported cuda version, if not already set. Currently duplicated due to docs only build logic.
138-
# CUDA 11.0 is current minimum cuda version, and the minimum supported
139-
if(NOT DEFINED MINIMUM_CUDA_VERSION)
140-
set(MINIMUM_CUDA_VERSION 11.0)
141-
# Require a minimum cuda version
142-
if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS ${MINIMUM_CUDA_VERSION})
143-
message(FATAL_ERROR "CUDA version must be at least ${MINIMUM_CUDA_VERSION}")
144-
endif()
145-
endif()
146-
# CUDA 11.0 is the current minimum supported version.
137+
# Set the minimum supported cuda version, if not already set.
138+
# Currently duplicated due to docs only build logic.
139+
# CUDA 11.2 is the current minimum supported version.
147140
if(NOT DEFINED MINIMUM_SUPPORTED_CUDA_VERSION)
148-
set(MINIMUM_SUPPORTED_CUDA_VERSION 11.0)
149-
# Warn on deprecated cuda version.
150-
# If the CUDA compiler is atleast the minimum deprecated version, but less than the minimum actually supported version, issue a dev warning.
151-
if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL ${MINIMUM_CUDA_VERSION} AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS ${MINIMUM_SUPPORTED_CUDA_VERSION})
152-
message(DEPRECATION "Support for CUDA verisons <= ${MINIMUM_SUPPORTED_CUDA_VERSION} is deprecated and will be removed in a future release.")
141+
set(MINIMUM_SUPPORTED_CUDA_VERSION 11.2)
142+
# Require a minimum cuda version
143+
if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS ${MINIMUM_SUPPORTED_CUDA_VERSION})
144+
message(FATAL_ERROR "CUDA version must be at least ${MINIMUM_SUPPORTED_CUDA_VERSION}")
153145
endif()
154146
endif()
155147

cmake/dependencies/CCCL.cmake

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
###################################
2+
# CCCL (Thrust, CUB and libcucxx) #
3+
###################################
4+
5+
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH})
6+
7+
include(FetchContent)
8+
cmake_policy(SET CMP0079 NEW)
9+
# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223
10+
if(POLICY CMP0169)
11+
cmake_policy(SET CMP0169 OLD)
12+
endif()
13+
14+
# Set the minimum supported CCCL version, and the version to fetch
15+
# using find_package(version) means it's up to CCCL's cmake to determine if newer versions are compatible, but this will likely need changing for CUDA 13, when CCCL is planned to have a major version bump (and drop CUDA 11 support).
16+
set(MIN_REQUIRED_CCCL_VERSION 2.3.2)
17+
set(CCCL_DOWNLOAD_TAG v2.3.2)
18+
19+
# Use the FindCUDATooklit package (CMake > 3.17) to get the CUDA version and CUDA include directories for cub/thrust location hints
20+
find_package(CUDAToolkit REQUIRED)
21+
22+
# Quietly find CCCL, to check if the version included with CUDA (if CCCL) is sufficiently new.
23+
# Using CCCL avoids complex cub/thrust version workarounds previously required.
24+
# However we cannot find thrust due to a missing guard in CCCL's cmake config file, and cannot find cub without finding libcudacxx, so just find libcudacxx quietly.
25+
# The fix for this was first included in the 2.3.2 release
26+
find_package(CCCL ${MIN_REQUIRED_CCCL_VERSION} QUIET COMPONENTS libcudacxx CONFIG HINTS ${CUDAToolkit_INCLUDE_DIRS} ${CUDAToolkit_LIBRARY_DIR}/cmake)
27+
28+
# If CCCL was found, find it again but loudly (with all components)
29+
if(CCCL_FOUND)
30+
# Find the packages again but less quietly (and include all components)
31+
find_package(CCCL ${MIN_REQUIRED_CCCL_VERSION} REQUIRED CONFIG COMPONENTS HINTS ${CUDAToolkit_INCLUDE_DIRS} ${CUDAToolkit_LIBRARY_DIR}/cmake)
32+
# If CCCL does need downloading, fetch it and find it (no need to add_subdirectory)
33+
else()
34+
# Declare information about where and what we want from thrust.
35+
FetchContent_Declare(
36+
cccl
37+
GIT_REPOSITORY https://github.com/NVIDIA/CCCL.git
38+
GIT_TAG ${CCCL_DOWNLOAD_TAG}
39+
GIT_SHALLOW 0 # @todo - set this back to 1.
40+
GIT_PROGRESS ON
41+
# UPDATE_DISCONNECTED ON
42+
)
43+
# Fetch and populate the content if required.
44+
FetchContent_GetProperties(cccl)
45+
if(NOT cccl_POPULATED)
46+
message(STATUS "Fetching CCCL ${CCCL_DOWNLOAD_TAG}")
47+
FetchContent_Populate(cccl)
48+
# Use find_package for CCLL, only looking for the fetched version.
49+
# This creates a non-system target due to nvcc magic to avoid the cuda toolkit version being used instead, so warnings are not suppressible without push/pop macros.
50+
find_package(CCCL REQUIRED CONFIG
51+
PATHS "${cccl_SOURCE_DIR}"
52+
NO_CMAKE_PATH
53+
NO_CMAKE_ENVIRONMENT_PATH
54+
NO_SYSTEM_ENVIRONMENT_PATH
55+
NO_CMAKE_PACKAGE_REGISTRY
56+
NO_CMAKE_SYSTEM_PATH)
57+
endif()
58+
# Mark some CACHE vars as advanced for a cleaner CMake GUI
59+
mark_as_advanced(FETCHCONTENT_QUIET)
60+
mark_as_advanced(FETCHCONTENT_BASE_DIR)
61+
mark_as_advanced(FETCHCONTENT_FULLY_DISCONNECTED)
62+
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED)
63+
mark_as_advanced(FETCHCONTENT_SOURCE_DIR_CCCL)
64+
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED_CCCL)
65+
endif()
66+
67+
# Unset temporary variables
68+
unset(MIN_REQUIRED_CCCL_VERSION)
69+
unset(CCCL_DOWNLOAD_TAG)
70+
71+
# Mark some CACHE vars as advanced for a cleaner CMake GUI
72+
mark_as_advanced(CCCL_DIR)
73+
mark_as_advanced(CUB_DIR)
74+
mark_as_advanced(Thrust_DIR)
75+
mark_as_advanced(libcudacxx_DIR)

0 commit comments

Comments
 (0)