From 9bead12354647c3cecdba1119d0dc8dd6bec2a0b Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Wed, 22 Sep 2021 13:22:59 +0100 Subject: [PATCH 01/59] Patch RapidJson if using nvhpc --- .../patches/rapidjson-nvhpc.patch | 26 ++++++++++++++++ cmake/dependencies/rapidjson.cmake | 31 +++++++++++++------ 2 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 cmake/dependencies/patches/rapidjson-nvhpc.patch diff --git a/cmake/dependencies/patches/rapidjson-nvhpc.patch b/cmake/dependencies/patches/rapidjson-nvhpc.patch new file mode 100644 index 000000000..8cc36004c --- /dev/null +++ b/cmake/dependencies/patches/rapidjson-nvhpc.patch @@ -0,0 +1,26 @@ +diff --git a/include/rapidjson/internal/biginteger.h b/include/rapidjson/internal/biginteger.h +index 8eb87c7c..5db5a2eb 100644 +--- a/include/rapidjson/internal/biginteger.h ++++ b/include/rapidjson/internal/biginteger.h +@@ -252,7 +252,7 @@ private: + if (low < k) + (*outHigh)++; + return low; +-#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) ++#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) && !defined(__NVCOMPILER) + __extension__ typedef unsigned __int128 uint128; + uint128 p = static_cast(a) * static_cast(b); + p += k; +diff --git a/include/rapidjson/internal/diyfp.h b/include/rapidjson/internal/diyfp.h +index 8f7d853a..68039c23 100644 +--- a/include/rapidjson/internal/diyfp.h ++++ b/include/rapidjson/internal/diyfp.h +@@ -75,7 +75,7 @@ struct DiyFp { + if (l & (uint64_t(1) << 63)) // rounding + h++; + return DiyFp(h, e + rhs.e + 64); +-#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) ++#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) && !defined(__NVCOMPILER) + __extension__ typedef unsigned __int128 uint128; + uint128 p = static_cast(f) * static_cast(rhs.f); + uint64_t h = static_cast(p >> 64); diff --git a/cmake/dependencies/rapidjson.cmake b/cmake/dependencies/rapidjson.cmake index ac6057e2e..50dc65291 100644 --- a/cmake/dependencies/rapidjson.cmake +++ b/cmake/dependencies/rapidjson.cmake @@ -7,16 +7,30 @@ include(FetchContent) include(ExternalProject) cmake_policy(SET CMP0079 NEW) +# Define some variables to allow co fetch content declarations +set(RapidJSON_GIT_REMOTE "https://github.com/Tencent/rapidjson.git") # a95e013b97ca6523f32da23f5095fcc9dd6067e5 is the last commit before a change which breaks our method of finding rapid json without running a cmake install first. # but we also need to patch this to avoid a cmake >= 3.26.4 deprecation -FetchContent_Declare( - rapidjson - GIT_REPOSITORY https://github.com/Tencent/rapidjson.git - GIT_TAG a95e013b97ca6523f32da23f5095fcc9dd6067e5 - GIT_PROGRESS ON - PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/patches/rapidjson-cmake-3.5-deprecation.patch || true - # UPDATE_DISCONNECTED ON -) +set(RapidJSON_GIT_TAG "a95e013b97ca6523f32da23f5095fcc9dd6067e5") + +# Head of master as of 2020-07-14, as last release is ~500 commits behind head +if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") + FetchContent_Declare( + rapidjson + GIT_REPOSITORY ${RapidJSON_GIT_REMOTE} + GIT_TAG ${RapidJSON_GIT_TAG} + GIT_PROGRESS OFF + PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/patches/rapidjson-cmake-3.5-deprecation.patch || true + ) +else() + FetchContent_Declare( + rapidjson + GIT_REPOSITORY ${RapidJSON_GIT_REMOTE} + GIT_TAG ${RapidJSON_GIT_TAG} + GIT_PROGRESS OFF + PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/patches/rapidjson-cmake-3.5-deprecation.patch ${CMAKE_CURRENT_LIST_DIR}/patches/rapidjson-nvhpc.patch || true + ) +endif() FetchContent_GetProperties(rapidjson) if(NOT rapidjson_POPULATED) FetchContent_Populate(rapidjson) @@ -40,7 +54,6 @@ if(NOT rapidjson_POPULATED) if(TARGET rapidjson) add_library(RapidJSON::rapidjson ALIAS rapidjson) endif() - endif() # Mark some CACHE vars advanced for a cleaner GUI From 865ac9905bccfcabd4cf419835432dbddffbf2d5 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Wed, 22 Sep 2021 14:01:04 +0100 Subject: [PATCH 02/59] Adjust warning levels / suppressions when NVHPC is the host C++ compiler --- cmake/warnings.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake index cddae999f..8e379b6c7 100644 --- a/cmake/warnings.cmake +++ b/cmake/warnings.cmake @@ -61,8 +61,8 @@ if(NOT COMMAND flamegpu_set_high_warning_level) target_compile_options(${SHWL_TARGET} PRIVATE "$<$:SHELL:-Xcompiler -Wall$-Wsign-compare>") target_compile_options(${SHWL_TARGET} PRIVATE "$<$:-Wall>") target_compile_options(${SHWL_TARGET} PRIVATE "$<$:-Wsign-compare>") - # Reorder errors for device code are caused by some cub/thrust versions (< 2.1.0?), but can be suppressed by pragmas successfully in 11.3+ under linux - if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3.0) + # Reorder errors for device code are caused by some cub/thrust versions (< 2.1.0?), but can be suppressed by pragmas successfully in 11.3+ under linux, but not for nvhpc + if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3.0 AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") target_compile_options(${SHWL_TARGET} PRIVATE "$<$:SHELL:--Wreorder>") endif() # Add warnings which suggest the use of override @@ -115,6 +115,10 @@ if(NOT COMMAND flamegpu_suppress_some_compiler_warnings) if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.6.0) target_compile_definitions(${SSCW_TARGET} PRIVATE "__CDPRT_SUPPRESS_SYNC_DEPRECATION_WARNING") endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") + # nvc++ etc do not appear to have an equivalent to -isystem. Rather than more pragma warning soup, just tone down warnings when using nvc++ as appropriate. + target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Xcudafe --diag_suppress=code_is_unreachable>") + target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:--diag_suppress=code_is_unreachable>") else() # Linux specific warning suppressions endif() @@ -179,7 +183,7 @@ if(NOT COMMAND flamegpu_enable_warnings_as_errors) # Add cross-execution-space-call. This is blocked under msvc by a jitify related bug (untested > CUDA 10.1): https://github.com/NVIDIA/jitify/issues/62 target_compile_options(${EWAS_TARGET} PRIVATE "$<$:SHELL:-Werror cross-execution-space-call>") # Add reorder to Werror, this is usable with workign nv/diag_suppress pragmas for cub/thrust from CUDA 11.3+ under linux - if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3.0) + if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3.0 AND NOT NOT CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") target_compile_options(${EWAS_TARGET} PRIVATE "$<$:SHELL:-Werror reorder>") endif() endif() From 9f55beea136b018de8f67cc82c32a904843f192a Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Wed, 22 Sep 2021 16:51:41 +0100 Subject: [PATCH 03/59] Enable linking against stdc++fs when using nvhpc It uses GCC's stdlib, so requires the same linker arguments to access std::experimental::filesystem --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d7a791166..95097fb58 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -674,8 +674,8 @@ target_link_libraries(${PROJECT_NAME} PUBLIC Jitify::jitify) # jitify is included in public headers, so this definiition must be public too. target_compile_definitions(${PROJECT_NAME} PUBLIC "JITIFY_PRINT_LOG") -# If gcc < 9, needs to link against stdc++fs -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) +# If gcc < 9, needs to link against stdc++fs. If using NVHPC,this is required if the underlying toolchain is also < 9. @todo - need to detect gcc version when nvhpc is the host compiler somehow... +if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) OR OR (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")) target_link_libraries(${PROJECT_NAME} PUBLIC stdc++fs) endif() From 182cdb5fa9a6bc462f017fa1410fb9cc70e881f7 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Fri, 1 Oct 2021 15:27:11 +0100 Subject: [PATCH 04/59] Possible bugfix: Use insert not emplace fixes nvhpc + gcc9 --- include/flamegpu/model/AgentFunctionDescription.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/flamegpu/model/AgentFunctionDescription.h b/include/flamegpu/model/AgentFunctionDescription.h index 10b0228da..ca39e9f5b 100644 --- a/include/flamegpu/model/AgentFunctionDescription.h +++ b/include/flamegpu/model/AgentFunctionDescription.h @@ -347,7 +347,7 @@ AgentFunctionDescription AgentDescription::newFunction(const std::string &functi } } auto rtn = std::shared_ptr(new AgentFunctionData(this->agent->shared_from_this(), function_name, f, in_t, out_t)); - agent->functions.emplace(function_name, rtn); + agent->functions.insert({function_name, rtn}); // emplace causes nvhpc with gcc 9 to segfault return AgentFunctionDescription(rtn); } THROW exception::InvalidAgentFunc("Agent ('%s') already contains function '%s', " From 16ffca302c192cd0c81546df93f87fde3d5e1dd5 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 4 Apr 2022 17:00:11 +0100 Subject: [PATCH 05/59] Only build Swig from source on linux if GNU compiler Swig 4.0.2 does not appear to build from source with NVHPC/Clang by default --- swig/CMakeLists.txt | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt index 902071824..c261c6097 100644 --- a/swig/CMakeLists.txt +++ b/swig/CMakeLists.txt @@ -74,8 +74,8 @@ if(NOT SWIG_FOUND) set(SWIG_EXECUTABLE "${swig_SOURCE_DIR}/swig.exe") set(SWIG_EXECUTABLE "${swig_SOURCE_DIR}/swig.exe" CACHE FILEPATH "Path to SWIG executable") endif() - else() - # Under linux, download the .tar.gz, extract, build and install. + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # Under linux, with gcc as the host compiler download the .tar.gz, extract, build and install. # This must be done at configure time, as FindSwig requires the swig executable. # FetchContent allows download at configure time, but must use execute_process to run commands at configure time. @@ -96,6 +96,21 @@ if(NOT SWIG_FOUND) set(swig_make_ERROR_FILE "${swig_BINARY_DIR}/swig-error-make.log") set(swig_makeinstall_ERROR_FILE "${swig_BINARY_DIR}/swig-error-make-install.log") + message(STATUS "[swig] ./autogen.sh") + execute_process( + COMMAND "./autogen.sh" + WORKING_DIRECTORY ${swig_SOURCE_DIR} + RESULT_VARIABLE swig_configure_RESULT + OUTPUT_VARIABLE swig_configure_OUTPUT + ERROR_FILE ${swig_configure_ERROR_FILE} + ) + if(NOT swig_configure_RESULT EQUAL "0") + message(FATAL_ERROR + " [swig] Error during SWIG ${SWIG_DOWNLOAD_VERSION} ./autogen.sh\n" + " Error log: ${swig_configure_ERROR_FILE}\n" + " Consider installing SWIG ${SWIG_MINIMUM_SUPPORTED_VERSION} yourself and passing -DSWIG_EXECUTABLE=/path/to/swig.") + endif() + # run ./configure with an appropraite prefix to install into the _deps/swig-bin directory message(STATUS "[swig] ./configure --prefix ${swig_BINARY_DIR}") execute_process( @@ -147,6 +162,14 @@ if(NOT SWIG_FOUND) set(SWIG_EXECUTABLE "${swig_BINARY_DIR}/bin/swig") set(SWIG_EXECUTABLE "${swig_BINARY_DIR}/bin/swig" CACHE FILEPATH "Path to SWIG executable") endif() + else() + # Swig's autogen.sh / ./configure do not result in a successful makefile when using nvhpc/clang as the c/c++ compiler + # E.g. -ansi is not a valid flag for nvhpc. + # So suggest the user builds installs it manually instead. + message(FATAL_ERROR + " Unsupported C/C++ compiler ${CMAKE_CXX_COMPILER_ID} for swig compilation.\n" + " Please use gcc/g++ as your host compiler, or manually install Swig >= ${SWIG_MINIMUM_SUPPORTED_VERSION} using gcc/g++ or install swig via your package manager\n" + ) endif() # Attempt to find swig again, but as REQUIRED. find_package(SWIG ${SWIG_MINIMUM_SUPPORTED_VERSION} REQUIRED) From 6ba94d0f7eb93801b154b5d618fb842939846642 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 12:49:08 +0000 Subject: [PATCH 06/59] fixup stdfilesystem nhvpc --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 95097fb58..e841f4204 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -675,7 +675,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC Jitify::jitify) target_compile_definitions(${PROJECT_NAME} PUBLIC "JITIFY_PRINT_LOG") # If gcc < 9, needs to link against stdc++fs. If using NVHPC,this is required if the underlying toolchain is also < 9. @todo - need to detect gcc version when nvhpc is the host compiler somehow... -if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) OR OR (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")) +if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) OR (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")) target_link_libraries(${PROJECT_NAME} PUBLIC stdc++fs) endif() From 7acb0204e2d00a4cfbf43e5ed7e0a3e50a109d25 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 13:06:38 +0000 Subject: [PATCH 07/59] Rough first pass at nvhpc ci --- .github/workflows/NVHPC.yml | 170 ++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 .github/workflows/NVHPC.yml diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml new file mode 100644 index 000000000..1e334977e --- /dev/null +++ b/.github/workflows/NVHPC.yml @@ -0,0 +1,170 @@ +# Build using nvhpc installs of CUDA, using containers so doesn't fit in the ubuntu workflow. +name: NVHPC + +# Run on branch push events (i.e. not tag pushes) and on pull requests +on: + # Branch pushes that do not only modify other workflow files + push: + branches: + - '**' + paths: + - "**" + - "!.github/**" + - ".github/workflows/NVHPC.yml" + # Disabled for now. See https://github.com/FLAMEGPU/FLAMEGPU2/pull/644 + # pull_request: + # Allow manual invocation. + workflow_dispatch: + +defaults: + run: + shell: bash + +# A single job, which builds manylinux2014 wheels, which ships with GCC 10.2.1 at the time of writing. If this bumps to unpatched 10.3 we might have issues w/ cuda. +jobs: + build: + runs-on: ubuntu-latest + # Run steps inside a nvhpc container + container: ${{ matrix.cudacxx.container}} + strategy: + fail-fast: false + # Multiplicative build matrix + # optional exclude: can be partial, include: must be specific + matrix: + cudacxx: + - cuda: "12.3" + cuda_arch: "50" + hostcxx: nvhpc-23.11 + os: ubuntu-22.04 + container: nvcr.io/nvidia/nvhpc:23.11-devel-cuda12.3-ubuntu22.04 + python: + - "" + # - "3.12" + config: + - name: "Release" + config: "Release" + SEATBELTS: "ON" + VISUALISATION: + # - "ON" + - "OFF" + + # Name the job based on matrix/env options + name: "build (${{ matrix.cudacxx.hostcxx }}, ${{matrix.python}}, ${{ matrix.VISUALISATION }}, ${{ matrix.config.name }}, ${{ matrix.cudacxx.os }})" + + env: + # Define constants + BUILD_DIR: "build" + FLAMEGPU_BUILD_TESTS: "OFF" + # Conditional based on matrix via awkward almost ternary + FLAMEGPU_BUILD_PYTHON: ${{ fromJSON('{true:"ON",false:"OFF"}')[matrix.python != ''] }} + # Port matrix options to environment, for more portability. + CUDA: ${{ matrix.cudacxx.cuda }} + CUDA_ARCH: ${{ matrix.cudacxx.cuda_arch }} + HOSTCXX: ${{ matrix.cudacxx.hostcxx }} + OS: ${{ matrix.cudacxx.os }} + CONFIG: ${{ matrix.config.config }} + FLAMEGPU_SEATBELTS: ${{ matrix.config.SEATBELTS }} + PYTHON: ${{ matrix.python}} + VISUALISATION: ${{ matrix.VISUALISATION }} + + steps: + - uses: actions/checkout@v3 + + - name: Add custom problem matchers for annotations + run: echo "::add-matcher::.github/problem-matchers.json" + + - name: Select Python + if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} + uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON }} + + # @todo - is some/all of this still required when using select Python? + - name: Install python dependencies + if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} + run: | + sudo apt-get install python3-venv + python3 -m pip install --upgrade wheel build setuptools + + - name: Install Visualisation Dependencies + if: ${{ startswith(env.OS, 'ubuntu') && env.VISUALISATION == 'ON' }} + run: | + # Install ubuntu-20.04 packages + if [ "$OS" == 'ubuntu-22.04' ]; then + sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev + fi + if [ "$OS" == 'ubuntu-20.04' ]; then + sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev + fi + # Install Ubuntu 18.04 packages + if [ "$OS" == 'ubuntu-18.04' ]; then + sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype6-dev libgl1-mesa-dev + fi + + - name: Install Swig >= 4.0.2 + run: | + # Remove existing swig install, so CMake finds the correct swig + if [ "$OS" == 'ubuntu-20.04' ]; then + sudo apt-get remove -y swig swig4.0 + fi + # Install Ubuntu 18.04 packages + if [ "$OS" == 'ubuntu-18.04' ]; then + sudo apt-get remove -y swig + fi + # Install additional apt-based dependencies required to build swig 4.0.2 + sudo apt-get install -y bison + # Create a local directory to build swig in. + mkdir -p swig-from-source && cd swig-from-source + # Install SWIG building from source dependencies + wget https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz + tar -zxf v4.0.2.tar.gz + cd swig-4.0.2/ + ./autogen.sh + ./configure + make + sudo make install + + + - name: Configure cmake + run: > + cmake . -B "${{ env.BUILD_DIR }}" + -DCMAKE_BUILD_TYPE="${{ env.CONFIG }}" + -Werror=dev + -DCMAKE_WARN_DEPRECATED="OFF" + -DFLAMEGPU_WARNINGS_AS_ERRORS="ON" + -DCMAKE_CUDA_ARCHITECTURES="${{ env.CUDA_ARCH }}" + -DFLAMEGPU_BUILD_TESTS="${{ env.FLAMEGPU_BUILD_TESTS }}" + -DFLAMEGPU_BUILD_PYTHON="${{ env.FLAMEGPU_BUILD_PYTHON }}" + -DPYTHON3_EXACT_VERSION="${{ env.PYTHON }}" + -DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}" + -DFLAMEGPU_ENABLE_NVTX="ON" + + - name: Build static library + working-directory: ${{ env.BUILD_DIR }} + run: cmake --build . --target flamegpu --verbose -j `nproc` + + + - name: Build python wheel + if: ${{ env.FLAMEGPU_BUILD_PYTHON == 'ON' }} + working-directory: ${{ env.BUILD_DIR }} + run: cmake --build . --target pyflamegpu --verbose -j `nproc` + + - name: Build tests + if: ${{ env.FLAMEGPU_BUILD_TESTS == 'ON' }} + working-directory: ${{ env.BUILD_DIR }} + run: cmake --build . --target tests --verbose -j `nproc` + + - name: Build all remaining targets + working-directory: ${{ env.BUILD_DIR }} + run: cmake --build . --target all --verbose -j `nproc` + + # Upload wheel artifacts to the job on GHA, with a short retention + # Use a unique name per job matrix run, to avoid a risk of corruption according to the docs (although it should work with unique filenames) + # - name: Upload Wheel Artifacts + # if: ${{env.FLAMEGPU_BUILD_PYTHON == 'ON' }} + # uses: actions/upload-artifact@v3 + # with: + # name: ${{ env.ARTIFACT_NAME }} + # path: ${{ env.BUILD_DIR }}/lib/${{ env.CONFIG }}/python/dist/*.whl + # if-no-files-found: error + # retention-days: 5 From 0dc74c18271c5547d94557a0dbf0566279cac4a0 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 13:09:11 +0000 Subject: [PATCH 08/59] warning nvhpc cmake fix --- cmake/warnings.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake index 8e379b6c7..c6e90fd82 100644 --- a/cmake/warnings.cmake +++ b/cmake/warnings.cmake @@ -183,7 +183,7 @@ if(NOT COMMAND flamegpu_enable_warnings_as_errors) # Add cross-execution-space-call. This is blocked under msvc by a jitify related bug (untested > CUDA 10.1): https://github.com/NVIDIA/jitify/issues/62 target_compile_options(${EWAS_TARGET} PRIVATE "$<$:SHELL:-Werror cross-execution-space-call>") # Add reorder to Werror, this is usable with workign nv/diag_suppress pragmas for cub/thrust from CUDA 11.3+ under linux - if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3.0 AND NOT NOT CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") + if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3.0 AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") target_compile_options(${EWAS_TARGET} PRIVATE "$<$:SHELL:-Werror reorder>") endif() endif() From b412e7e2e22570b7b9b3034c1412ccfc16746ea5 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 13:13:37 +0000 Subject: [PATCH 09/59] temp disable python stuff in nvhpc ci --- .github/workflows/NVHPC.yml | 64 ++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 1e334977e..0d6ad0c4c 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -73,18 +73,18 @@ jobs: - name: Add custom problem matchers for annotations run: echo "::add-matcher::.github/problem-matchers.json" - - name: Select Python - if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON }} + # - name: Select Python + # if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ env.PYTHON }} # @todo - is some/all of this still required when using select Python? - - name: Install python dependencies - if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} - run: | - sudo apt-get install python3-venv - python3 -m pip install --upgrade wheel build setuptools + # - name: Install python dependencies + # if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} + # run: | + # sudo apt-get install python3-venv + # python3 -m pip install --upgrade wheel build setuptools - name: Install Visualisation Dependencies if: ${{ startswith(env.OS, 'ubuntu') && env.VISUALISATION == 'ON' }} @@ -101,28 +101,28 @@ jobs: sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype6-dev libgl1-mesa-dev fi - - name: Install Swig >= 4.0.2 - run: | - # Remove existing swig install, so CMake finds the correct swig - if [ "$OS" == 'ubuntu-20.04' ]; then - sudo apt-get remove -y swig swig4.0 - fi - # Install Ubuntu 18.04 packages - if [ "$OS" == 'ubuntu-18.04' ]; then - sudo apt-get remove -y swig - fi - # Install additional apt-based dependencies required to build swig 4.0.2 - sudo apt-get install -y bison - # Create a local directory to build swig in. - mkdir -p swig-from-source && cd swig-from-source - # Install SWIG building from source dependencies - wget https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz - tar -zxf v4.0.2.tar.gz - cd swig-4.0.2/ - ./autogen.sh - ./configure - make - sudo make install + # - name: Install Swig >= 4.0.2 + # run: | + # # Remove existing swig install, so CMake finds the correct swig + # if [ "$OS" == 'ubuntu-20.04' ]; then + # sudo apt-get remove -y swig swig4.0 + # fi + # # Install Ubuntu 18.04 packages + # if [ "$OS" == 'ubuntu-18.04' ]; then + # sudo apt-get remove -y swig + # fi + # # Install additional apt-based dependencies required to build swig 4.0.2 + # sudo apt-get install -y bison + # # Create a local directory to build swig in. + # mkdir -p swig-from-source && cd swig-from-source + # # Install SWIG building from source dependencies + # wget https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz + # tar -zxf v4.0.2.tar.gz + # cd swig-4.0.2/ + # ./autogen.sh + # ./configure + # make + # sudo make install - name: Configure cmake From 7c8ad99969c6af9e84a50dee9d1d4cd01b1b5c36 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 13:33:32 +0000 Subject: [PATCH 10/59] nvhpc ci expansionn --- .github/workflows/NVHPC.yml | 78 +++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 0d6ad0c4c..f370e9282 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -38,14 +38,13 @@ jobs: os: ubuntu-22.04 container: nvcr.io/nvidia/nvhpc:23.11-devel-cuda12.3-ubuntu22.04 python: - - "" - # - "3.12" + - "3.12" config: - name: "Release" config: "Release" SEATBELTS: "ON" VISUALISATION: - # - "ON" + - "ON" - "OFF" # Name the job based on matrix/env options @@ -73,56 +72,59 @@ jobs: - name: Add custom problem matchers for annotations run: echo "::add-matcher::.github/problem-matchers.json" - # - name: Select Python - # if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ env.PYTHON }} + - name: Select Python + if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} + uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON }} # @todo - is some/all of this still required when using select Python? - # - name: Install python dependencies - # if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} - # run: | - # sudo apt-get install python3-venv - # python3 -m pip install --upgrade wheel build setuptools + - name: Install python dependencies + if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} + run: | + apt-get install python3-venv + python3 -m pip install --upgrade wheel build setuptools + # these conditions need to be based on the version in the container, not the host. Might want tweaking, or just relies on the yml being correct. - name: Install Visualisation Dependencies if: ${{ startswith(env.OS, 'ubuntu') && env.VISUALISATION == 'ON' }} run: | # Install ubuntu-20.04 packages if [ "$OS" == 'ubuntu-22.04' ]; then - sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev + apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev fi if [ "$OS" == 'ubuntu-20.04' ]; then - sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev + apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev fi # Install Ubuntu 18.04 packages if [ "$OS" == 'ubuntu-18.04' ]; then - sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype6-dev libgl1-mesa-dev + apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype6-dev libgl1-mesa-dev fi - # - name: Install Swig >= 4.0.2 - # run: | - # # Remove existing swig install, so CMake finds the correct swig - # if [ "$OS" == 'ubuntu-20.04' ]; then - # sudo apt-get remove -y swig swig4.0 - # fi - # # Install Ubuntu 18.04 packages - # if [ "$OS" == 'ubuntu-18.04' ]; then - # sudo apt-get remove -y swig - # fi - # # Install additional apt-based dependencies required to build swig 4.0.2 - # sudo apt-get install -y bison - # # Create a local directory to build swig in. - # mkdir -p swig-from-source && cd swig-from-source - # # Install SWIG building from source dependencies - # wget https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz - # tar -zxf v4.0.2.tar.gz - # cd swig-4.0.2/ - # ./autogen.sh - # ./configure - # make - # sudo make install + # @todo - enforce that $OS is correct. maybe parse lsb_release instead? + # @tood - doubel check this builds with gcc and not nvhpc within the container + - name: Install Swig >= 4.0.2 + run: | + # Remove existing swig install, so CMake finds the correct swig + if [ "$OS" == 'ubuntu-20.04' ]; then + apt-get remove -y swig swig4.0 + fi + # Install Ubuntu 18.04 packages + if [ "$OS" == 'ubuntu-18.04' ]; then + apt-get remove -y swig + fi + # Install additional apt-based dependencies required to build swig 4.0.2 + sudo apt-get install -y bison + # Create a local directory to build swig in. + mkdir -p swig-from-source && cd swig-from-source + # Install SWIG building from source dependencies + wget https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz + tar -zxf v4.0.2.tar.gz + cd swig-4.0.2/ + ./autogen.sh + ./configure + make + make install - name: Configure cmake From c80a411ada3ffec959e2c74636306bcb3236e4b6 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 14:02:20 +0000 Subject: [PATCH 11/59] nvhpc swig instrall tweaks --- .github/workflows/NVHPC.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index f370e9282..c5a3eae43 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -82,7 +82,7 @@ jobs: - name: Install python dependencies if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} run: | - apt-get install python3-venv + apt-get update && apt-get install python3-venv python3 -m pip install --upgrade wheel build setuptools # these conditions need to be based on the version in the container, not the host. Might want tweaking, or just relies on the yml being correct. @@ -90,6 +90,7 @@ jobs: if: ${{ startswith(env.OS, 'ubuntu') && env.VISUALISATION == 'ON' }} run: | # Install ubuntu-20.04 packages + apt-get update if [ "$OS" == 'ubuntu-22.04' ]; then apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev fi @@ -105,6 +106,7 @@ jobs: # @tood - doubel check this builds with gcc and not nvhpc within the container - name: Install Swig >= 4.0.2 run: | + apt-get update # Remove existing swig install, so CMake finds the correct swig if [ "$OS" == 'ubuntu-20.04' ]; then apt-get remove -y swig swig4.0 @@ -114,7 +116,7 @@ jobs: apt-get remove -y swig fi # Install additional apt-based dependencies required to build swig 4.0.2 - sudo apt-get install -y bison + apt-get install -y bison # Create a local directory to build swig in. mkdir -p swig-from-source && cd swig-from-source # Install SWIG building from source dependencies From 9090a75da826db2d7612416b35b214dc2c1af27a Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 14:08:01 +0000 Subject: [PATCH 12/59] fixup --- .github/workflows/NVHPC.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index c5a3eae43..f77f3428b 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -82,7 +82,7 @@ jobs: - name: Install python dependencies if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} run: | - apt-get update && apt-get install python3-venv + apt-get update && apt-get install -y python3-venv python3 -m pip install --upgrade wheel build setuptools # these conditions need to be based on the version in the container, not the host. Might want tweaking, or just relies on the yml being correct. From 86952363cdc86aac28628eb297e91a03e159332c Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 14:15:17 +0000 Subject: [PATCH 13/59] Install pcre2-dev for swig build from source in nvhpc container --- .github/workflows/NVHPC.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index f77f3428b..917fe35d6 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -116,7 +116,7 @@ jobs: apt-get remove -y swig fi # Install additional apt-based dependencies required to build swig 4.0.2 - apt-get install -y bison + apt-get install -y bison libpcre2-dev # Create a local directory to build swig in. mkdir -p swig-from-source && cd swig-from-source # Install SWIG building from source dependencies From d99b184b18c40256c5ed5201afcbf428887d5db1 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 14:42:27 +0000 Subject: [PATCH 14/59] bigger nvhpc matrix --- .github/workflows/NVHPC.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 917fe35d6..15ef60b5c 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -37,8 +37,14 @@ jobs: hostcxx: nvhpc-23.11 os: ubuntu-22.04 container: nvcr.io/nvidia/nvhpc:23.11-devel-cuda12.3-ubuntu22.04 + - cuda: "11.8" + cuda_arch: "35" + hostcxx: nvhpc-22.11 + os: ubuntu-20.04 + container: nvcr.io/nvidia/nvhpc:22.11-devel-cuda11.8-ubuntu20.04 python: - "3.12" + - "3.11" config: - name: "Release" config: "Release" From 3e495472f84f765001f6f72e9a6b9c04554931aa Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 15:01:11 +0000 Subject: [PATCH 15/59] nvhpc ci fixup - don't use 2004 for now --- .github/workflows/NVHPC.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 15ef60b5c..973628d35 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -40,8 +40,8 @@ jobs: - cuda: "11.8" cuda_arch: "35" hostcxx: nvhpc-22.11 - os: ubuntu-20.04 - container: nvcr.io/nvidia/nvhpc:22.11-devel-cuda11.8-ubuntu20.04 + os: ubuntu-22.04 + container: nvcr.io/nvidia/nvhpc:22.11-devel-cuda11.8-ubuntu22.04 python: - "3.12" - "3.11" @@ -111,6 +111,7 @@ jobs: # @todo - enforce that $OS is correct. maybe parse lsb_release instead? # @tood - doubel check this builds with gcc and not nvhpc within the container - name: Install Swig >= 4.0.2 + if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} run: | apt-get update # Remove existing swig install, so CMake finds the correct swig @@ -122,7 +123,7 @@ jobs: apt-get remove -y swig fi # Install additional apt-based dependencies required to build swig 4.0.2 - apt-get install -y bison libpcre2-dev + apt-get install -y bison libpcre3-dev libpcre2-dev # Create a local directory to build swig in. mkdir -p swig-from-source && cd swig-from-source # Install SWIG building from source dependencies From 0131c021d0fb9f40ed4a5fde4c1bc6a0630a5a1b Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 15:11:55 +0000 Subject: [PATCH 16/59] use deadsnakes to select python --- .github/workflows/NVHPC.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 973628d35..05ac1b10a 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -40,8 +40,8 @@ jobs: - cuda: "11.8" cuda_arch: "35" hostcxx: nvhpc-22.11 - os: ubuntu-22.04 - container: nvcr.io/nvidia/nvhpc:22.11-devel-cuda11.8-ubuntu22.04 + os: ubuntu-20.04 + container: nvcr.io/nvidia/nvhpc:20.11-devel-cuda11.8-ubuntu22.04 python: - "3.12" - "3.11" @@ -78,11 +78,13 @@ jobs: - name: Add custom problem matchers for annotations run: echo "::add-matcher::.github/problem-matchers.json" - - name: Select Python + # Don't use select python when running in the container. deadsnakes ppa might be easiest way to add custom python? + - name: Install python from deadsnakes if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON }} + run: | + add-apt-repository -y ppa:deadsnakes/ppa + apt-get update + apt-get install python${{ env.PYTHON }} # @todo - is some/all of this still required when using select Python? - name: Install python dependencies From ad8ca1a59b93e58b3a143b0b3076cd1fc0450185 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 15:41:12 +0000 Subject: [PATCH 17/59] deadsnakes fixup --- .github/workflows/NVHPC.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 05ac1b10a..786d6779d 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -82,6 +82,8 @@ jobs: - name: Install python from deadsnakes if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} run: | + apt-get update + apt-get install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt-get update apt-get install python${{ env.PYTHON }} From c5f24987cf796ac272915dcffdb0babb82fa77b4 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 15:41:42 +0000 Subject: [PATCH 18/59] nvhpc disable vis builds for now --- .github/workflows/NVHPC.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 786d6779d..bb472ca56 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -50,7 +50,7 @@ jobs: config: "Release" SEATBELTS: "ON" VISUALISATION: - - "ON" + # - "ON" - "OFF" # Name the job based on matrix/env options From acbb48c4794278aab50a1d2d9c19741eb85fd1a7 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 15:49:11 +0000 Subject: [PATCH 19/59] 22.11 cu 11.8 container path fix --- .github/workflows/NVHPC.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index bb472ca56..98fb9f8bf 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -41,7 +41,7 @@ jobs: cuda_arch: "35" hostcxx: nvhpc-22.11 os: ubuntu-20.04 - container: nvcr.io/nvidia/nvhpc:20.11-devel-cuda11.8-ubuntu22.04 + container: nvcr.io/nvidia/nvhpc:22.11-devel-cuda11.8-ubuntu20.04 python: - "3.12" - "3.11" From a5086f291ac67811cc8469b9f9e7e4282641dc18 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 15:56:07 +0000 Subject: [PATCH 20/59] nhvpc add known ubuntu dev container urls for relevant cudas --- .github/workflows/NVHPC.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 98fb9f8bf..1cb86a843 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -42,6 +42,27 @@ jobs: hostcxx: nvhpc-22.11 os: ubuntu-20.04 container: nvcr.io/nvidia/nvhpc:22.11-devel-cuda11.8-ubuntu20.04 + # nvcr.io/nvidia/nvhpc:23.11-devel-cuda12.3-ubuntu22.04 + # nvcr.io/nvidia/nvhpc:23.9-devel-cuda12.2-ubuntu22.04 + # nvcr.io/nvidia/nvhpc:23.7-devel-cuda12.2-ubuntu22.04 + # nvcr.io/nvidia/nvhpc:23.5-devel-cuda12.1-ubuntu22.04 + # nvcr.io/nvidia/nvhpc:23.3-devel-cuda12.0-ubuntu22.04 + # nvcr.io/nvidia/nvhpc:23.1-devel-cuda12.0-ubuntu22.04 + # nvcr.io/nvidia/nvhpc:22.11-devel-cuda11.8-ubuntu22.04 + # nvcr.io/nvidia/nvhpc:22.9-devel-cuda11.7-ubuntu22.04 + # nvcr.io/nvidia/nvhpc:22.7-devel-cuda11.7-ubuntu22.04 + # nvcr.io/nvidia/nvhpc:22.5-devel-cuda11.7-ubuntu20.04 + # nvcr.io/nvidia/nvhpc:22.3-devel-cuda11.6-ubuntu20.04 + # nvcr.io/nvidia/nvhpc:22.2-devel-cuda11.6-ubuntu20.04 + # nvcr.io/nvidia/nvhpc:22.1-devel-cuda11.5-ubuntu20.04 + # nvcr.io/nvidia/nvhpc:21.11-devel-cuda11.5-ubuntu20.04 + # nvcr.io/nvidia/nvhpc:21.9-devel-cuda11.4-ubuntu20.04 + # nvcr.io/nvidia/nvhpc:21.7-devel-cuda11.4-ubuntu20.04 + # nvcr.io/nvidia/nvhpc:21.5-devel-cuda11.3-ubuntu20.04 + # nvcr.io/nvidia/nvhpc:21.3-devel-cuda11.2-ubuntu20.04 + # nvcr.io/nvidia/nvhpc:21.2-devel-cuda11.2-ubuntu20.04 + # nvcr.io/nvidia/nvhpc:21.1-devel-cuda11.2-ubuntu20.04 + # nvcr.io/nvidia/nvhpc:20.11-devel-cuda11.1-ubuntu20.04 python: - "3.12" - "3.11" From 14020f7d5e0fc31901f07822c6fb3ae8667992f1 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 15:56:33 +0000 Subject: [PATCH 21/59] deadsnakes fixup --- .github/workflows/NVHPC.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 1cb86a843..8a8b66af0 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -107,7 +107,7 @@ jobs: apt-get install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt-get update - apt-get install python${{ env.PYTHON }} + apt-get install -y python${{ env.PYTHON }} # @todo - is some/all of this still required when using select Python? - name: Install python dependencies From b44158db96c9f730bb530240370b7d4b5c8aa76e Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 15:58:39 +0000 Subject: [PATCH 22/59] deadsnakes fixup --- .github/workflows/NVHPC.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 8a8b66af0..b1e041d48 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -100,21 +100,16 @@ jobs: run: echo "::add-matcher::.github/problem-matchers.json" # Don't use select python when running in the container. deadsnakes ppa might be easiest way to add custom python? - - name: Install python from deadsnakes + - name: Install python from deadsnakes + dependencies if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} run: | apt-get update apt-get install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt-get update - apt-get install -y python${{ env.PYTHON }} - - # @todo - is some/all of this still required when using select Python? - - name: Install python dependencies - if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} - run: | - apt-get update && apt-get install -y python3-venv - python3 -m pip install --upgrade wheel build setuptools + apt-get install -y python${{ env.PYTHON }} + apt-get update && apt-get install -y python${{ env.PYTHON }}-venv + python${{ env.PYTHON }} -m pip install --upgrade wheel build setuptools # these conditions need to be based on the version in the container, not the host. Might want tweaking, or just relies on the yml being correct. - name: Install Visualisation Dependencies From 81d3b287ff70466168a50989b574211888578c0f Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 16:39:19 +0000 Subject: [PATCH 23/59] deadsnakes fixup2 --- .github/workflows/NVHPC.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index b1e041d48..42e30601b 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -107,8 +107,7 @@ jobs: apt-get install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt-get update - apt-get install -y python${{ env.PYTHON }} - apt-get update && apt-get install -y python${{ env.PYTHON }}-venv + apt-get install -y python${{ env.PYTHON }} python${{ env.PYTHON }}-pip python${{ env.PYTHON }}-venv python${{ env.PYTHON }} -m pip install --upgrade wheel build setuptools # these conditions need to be based on the version in the container, not the host. Might want tweaking, or just relies on the yml being correct. From 9526a8f248b99086cbe8472c36ced91d8ae2b5a6 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 16:58:33 +0000 Subject: [PATCH 24/59] another deadsnakes pip fix attempt --- .github/workflows/NVHPC.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 42e30601b..c6c05b817 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -107,7 +107,7 @@ jobs: apt-get install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt-get update - apt-get install -y python${{ env.PYTHON }} python${{ env.PYTHON }}-pip python${{ env.PYTHON }}-venv + apt-get install -y python${{ env.PYTHON }} python${{ env.PYTHON }}-pip python${{ env.PYTHON }}-distutils python3-pip python${{ env.PYTHON }} -m pip install --upgrade wheel build setuptools # these conditions need to be based on the version in the container, not the host. Might want tweaking, or just relies on the yml being correct. From 4935ea557e616200e051c671067b24f6a5608b09 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 17:02:34 +0000 Subject: [PATCH 25/59] another deadsnakes pip fix attempt 2 --- .github/workflows/NVHPC.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index c6c05b817..a2868d69f 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -107,7 +107,7 @@ jobs: apt-get install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt-get update - apt-get install -y python${{ env.PYTHON }} python${{ env.PYTHON }}-pip python${{ env.PYTHON }}-distutils python3-pip + apt-get install -y python${{ env.PYTHON }} python${{ env.PYTHON }}-venv python${{ env.PYTHON }}-distutils python3-pip python${{ env.PYTHON }} -m pip install --upgrade wheel build setuptools # these conditions need to be based on the version in the container, not the host. Might want tweaking, or just relies on the yml being correct. From 1c3a41c78ec11953e9706ec1c3b6a61bf6696bb6 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 17:28:20 +0000 Subject: [PATCH 26/59] deadsnakes install python3.x-dev --- .github/workflows/NVHPC.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index a2868d69f..a0ffd9339 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -107,7 +107,7 @@ jobs: apt-get install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt-get update - apt-get install -y python${{ env.PYTHON }} python${{ env.PYTHON }}-venv python${{ env.PYTHON }}-distutils python3-pip + apt-get install -y python${{ env.PYTHON }} python${{ env.PYTHON }}-venv python${{ env.PYTHON }}-distutils python${{ env.PYTHON }}-dev python3-pip python${{ env.PYTHON }} -m pip install --upgrade wheel build setuptools # these conditions need to be based on the version in the container, not the host. Might want tweaking, or just relies on the yml being correct. From 44d5448c4dcc3e13ef6d23266db0a3593d454f2f Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 18:24:49 +0000 Subject: [PATCH 27/59] mayube fix deadnsakes pip by creating and activating a venv? --- .github/workflows/NVHPC.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index a0ffd9339..94af7999f 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -108,6 +108,10 @@ jobs: add-apt-repository -y ppa:deadsnakes/ppa apt-get update apt-get install -y python${{ env.PYTHON }} python${{ env.PYTHON }}-venv python${{ env.PYTHON }}-distutils python${{ env.PYTHON }}-dev python3-pip + # create and activate a venv + install python deps into it, to workaround a deadsnakes + pip quirk + python${{ env.PYTHON }} -m venv .venv + source .venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV python${{ env.PYTHON }} -m pip install --upgrade wheel build setuptools # these conditions need to be based on the version in the container, not the host. Might want tweaking, or just relies on the yml being correct. From b3c52c2ff03e759d9889bdfe8d83607664f6c213 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 8 Jan 2024 18:32:04 +0000 Subject: [PATCH 28/59] nvhpc ci - isntall a particular cmake version --- .github/workflows/NVHPC.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 94af7999f..3525cec5f 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -73,6 +73,8 @@ jobs: VISUALISATION: # - "ON" - "OFF" + cmake: + - "3.20.0" # Name the job based on matrix/env options name: "build (${{ matrix.cudacxx.hostcxx }}, ${{matrix.python}}, ${{ matrix.VISUALISATION }}, ${{ matrix.config.name }}, ${{ matrix.cudacxx.os }})" @@ -92,6 +94,7 @@ jobs: FLAMEGPU_SEATBELTS: ${{ matrix.config.SEATBELTS }} PYTHON: ${{ matrix.python}} VISUALISATION: ${{ matrix.VISUALISATION }} + CMAKE: ${{ matrix.cmake }} steps: - uses: actions/checkout@v3 @@ -158,6 +161,15 @@ jobs: make make install + - name: Install cmake from GitHub Releases + if: ${{ env.CMAKE != '' && env.CMAKE != 'default' }} + working-directory: ${{ runner.temp }} + run: | + wget -q https://github.com/Kitware/CMake/releases/download/v${{ env.CMAKE }}/cmake-${{ env.CMAKE }}-linux-x86_64.tar.gz + tar -zxvf cmake-${{ env.CMAKE }}-linux-x86_64.tar.gz + # Inner directory case changes in some releases, use find to get the right path + echo "$(dirname $(find $(pwd) -wholename "*/bin/cmake" -exec echo {} \; -quit))" >> $GITHUB_PATH + - name: Configure cmake run: > From e7ca274da5a1a871227912230a88e3f7391e1f09 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 09:43:21 +0000 Subject: [PATCH 29/59] nvhpc ci fixes --- .github/workflows/NVHPC.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 3525cec5f..cb99f46ed 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -102,6 +102,10 @@ jobs: - name: Add custom problem matchers for annotations run: echo "::add-matcher::.github/problem-matchers.json" + # This patches a bug where ManyLinux doesn't generate buildnumber as git dir is owned by diff user + - name: Enable git safe-directory + run: git config --global --add safe.directory $GITHUB_WORKSPACE + # Don't use select python when running in the container. deadsnakes ppa might be easiest way to add custom python? - name: Install python from deadsnakes + dependencies if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} @@ -114,7 +118,9 @@ jobs: # create and activate a venv + install python deps into it, to workaround a deadsnakes + pip quirk python${{ env.PYTHON }} -m venv .venv source .venv/bin/activate - echo PATH=$PATH >> $GITHUB_ENV + # manually add venv dirs to the path and env for later steps + echo "$(readlink -f ./venv/bin/)" >> $GITHUB_PATH + echo "VIRTUAL_ENV=$(readlink -f ./venv/)" >> $GITHUB_ENV python${{ env.PYTHON }} -m pip install --upgrade wheel build setuptools # these conditions need to be based on the version in the container, not the host. Might want tweaking, or just relies on the yml being correct. From ada567d708d432ae784c741b5cbff01e3171fa3b Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 10:11:41 +0000 Subject: [PATCH 30/59] Try fixing deadsnakes python again --- .github/workflows/NVHPC.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index cb99f46ed..d4c0efbee 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -120,6 +120,8 @@ jobs: source .venv/bin/activate # manually add venv dirs to the path and env for later steps echo "$(readlink -f ./venv/bin/)" >> $GITHUB_PATH + echo "$(readlink -f ./venv/bin/) GITHUB_PATH" + echo "VIRTUAL_ENV=$(readlink -f ./venv/) $GITHUB_ENV" echo "VIRTUAL_ENV=$(readlink -f ./venv/)" >> $GITHUB_ENV python${{ env.PYTHON }} -m pip install --upgrade wheel build setuptools @@ -188,6 +190,8 @@ jobs: -DFLAMEGPU_BUILD_TESTS="${{ env.FLAMEGPU_BUILD_TESTS }}" -DFLAMEGPU_BUILD_PYTHON="${{ env.FLAMEGPU_BUILD_PYTHON }}" -DPYTHON3_EXACT_VERSION="${{ env.PYTHON }}" + -DPython3_ROOT_DIR="venv/bin" + -DPython3_EXECUTABLE="venv/bin/python${{ env.python }}" -DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}" -DFLAMEGPU_ENABLE_NVTX="ON" From fb45eab55ef677dbff78bc46c94ff539b688689c Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 10:20:27 +0000 Subject: [PATCH 31/59] more nvhpc deadsnakes ci fix attempts --- .github/workflows/NVHPC.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index d4c0efbee..4294411b9 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -119,6 +119,8 @@ jobs: python${{ env.PYTHON }} -m venv .venv source .venv/bin/activate # manually add venv dirs to the path and env for later steps + ls .venv + echo "$(pwd)/venv/bin" echo "$(readlink -f ./venv/bin/)" >> $GITHUB_PATH echo "$(readlink -f ./venv/bin/) GITHUB_PATH" echo "VIRTUAL_ENV=$(readlink -f ./venv/) $GITHUB_ENV" @@ -190,8 +192,8 @@ jobs: -DFLAMEGPU_BUILD_TESTS="${{ env.FLAMEGPU_BUILD_TESTS }}" -DFLAMEGPU_BUILD_PYTHON="${{ env.FLAMEGPU_BUILD_PYTHON }}" -DPYTHON3_EXACT_VERSION="${{ env.PYTHON }}" - -DPython3_ROOT_DIR="venv/bin" - -DPython3_EXECUTABLE="venv/bin/python${{ env.python }}" + -DPython3_ROOT_DIR="$(readlink -f venv/bin)" + -DPython3_EXECUTABLE="$(readlink -f venv/bin/python${{ env.PYTHON }})" -DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}" -DFLAMEGPU_ENABLE_NVTX="ON" From a249956b31b39ee0363feec70840742a86c7f9df Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 10:28:45 +0000 Subject: [PATCH 32/59] More deadsnakes venv fix attempts --- .github/workflows/NVHPC.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 4294411b9..fe18b36f7 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -121,10 +121,10 @@ jobs: # manually add venv dirs to the path and env for later steps ls .venv echo "$(pwd)/venv/bin" - echo "$(readlink -f ./venv/bin/)" >> $GITHUB_PATH - echo "$(readlink -f ./venv/bin/) GITHUB_PATH" - echo "VIRTUAL_ENV=$(readlink -f ./venv/) $GITHUB_ENV" - echo "VIRTUAL_ENV=$(readlink -f ./venv/)" >> $GITHUB_ENV + echo "$(pwd)/venv/bin" >> $GITHUB_PATH + echo "$(pwd)/venv/bin GITHUB_PATH" + echo "VIRTUAL_ENV=$(pwd)/venv/ $GITHUB_ENV" + echo "VIRTUAL_ENV=$(pwd)/venv/" >> $GITHUB_ENV python${{ env.PYTHON }} -m pip install --upgrade wheel build setuptools # these conditions need to be based on the version in the container, not the host. Might want tweaking, or just relies on the yml being correct. @@ -192,8 +192,9 @@ jobs: -DFLAMEGPU_BUILD_TESTS="${{ env.FLAMEGPU_BUILD_TESTS }}" -DFLAMEGPU_BUILD_PYTHON="${{ env.FLAMEGPU_BUILD_PYTHON }}" -DPYTHON3_EXACT_VERSION="${{ env.PYTHON }}" - -DPython3_ROOT_DIR="$(readlink -f venv/bin)" - -DPython3_EXECUTABLE="$(readlink -f venv/bin/python${{ env.PYTHON }})" + -DPython3_ROOT_DIR="$(pwd)/venv/bin" + -DPython3_EXECUTABLE="$(pwd)/venv/bin/python${{ env.PYTHON }})" + -DPython_FIND_STRATEGY=LOCATION -DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}" -DFLAMEGPU_ENABLE_NVTX="ON" From 325f00f41c6a98dc2cc9e75d6b49d951e0d5b44b Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 10:42:20 +0000 Subject: [PATCH 33/59] another deadsnakes venv fix attempt --- .github/workflows/NVHPC.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index fe18b36f7..8f2c29428 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -120,7 +120,7 @@ jobs: source .venv/bin/activate # manually add venv dirs to the path and env for later steps ls .venv - echo "$(pwd)/venv/bin" + ls "$(pwd)/venv/bin" echo "$(pwd)/venv/bin" >> $GITHUB_PATH echo "$(pwd)/venv/bin GITHUB_PATH" echo "VIRTUAL_ENV=$(pwd)/venv/ $GITHUB_ENV" @@ -193,7 +193,6 @@ jobs: -DFLAMEGPU_BUILD_PYTHON="${{ env.FLAMEGPU_BUILD_PYTHON }}" -DPYTHON3_EXACT_VERSION="${{ env.PYTHON }}" -DPython3_ROOT_DIR="$(pwd)/venv/bin" - -DPython3_EXECUTABLE="$(pwd)/venv/bin/python${{ env.PYTHON }})" -DPython_FIND_STRATEGY=LOCATION -DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}" -DFLAMEGPU_ENABLE_NVTX="ON" From 925dab836764b490ff38b1bcbfc765e9131adcfd Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 10:49:14 +0000 Subject: [PATCH 34/59] nvhpc fix --- .github/workflows/NVHPC.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 8f2c29428..8225dc655 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -119,11 +119,7 @@ jobs: python${{ env.PYTHON }} -m venv .venv source .venv/bin/activate # manually add venv dirs to the path and env for later steps - ls .venv - ls "$(pwd)/venv/bin" - echo "$(pwd)/venv/bin" >> $GITHUB_PATH - echo "$(pwd)/venv/bin GITHUB_PATH" - echo "VIRTUAL_ENV=$(pwd)/venv/ $GITHUB_ENV" + echo "$(pwd)/.venv/bin" >> $GITHUB_PATH echo "VIRTUAL_ENV=$(pwd)/venv/" >> $GITHUB_ENV python${{ env.PYTHON }} -m pip install --upgrade wheel build setuptools @@ -192,7 +188,8 @@ jobs: -DFLAMEGPU_BUILD_TESTS="${{ env.FLAMEGPU_BUILD_TESTS }}" -DFLAMEGPU_BUILD_PYTHON="${{ env.FLAMEGPU_BUILD_PYTHON }}" -DPYTHON3_EXACT_VERSION="${{ env.PYTHON }}" - -DPython3_ROOT_DIR="$(pwd)/venv/bin" + -DPython3_ROOT_DIR="$(pwd)/.venv/bin" + -DPython3_EXECUTABLE="$(pwd)/.venv/bin/python3)" -DPython_FIND_STRATEGY=LOCATION -DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}" -DFLAMEGPU_ENABLE_NVTX="ON" From 2b555851e2b44d85df43888bf59902d6ab538736 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 10:56:24 +0000 Subject: [PATCH 35/59] ci debugging --- .github/workflows/NVHPC.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 8225dc655..79484aa87 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -118,6 +118,13 @@ jobs: # create and activate a venv + install python deps into it, to workaround a deadsnakes + pip quirk python${{ env.PYTHON }} -m venv .venv source .venv/bin/activate + echo "$(pwd)/.venv/bin" + echo "ls venv" + ls $(pwd)/.venv + echo "ls bin" + ls $(pwd)/.venv/bin + ls does-not-exist + # manually add venv dirs to the path and env for later steps echo "$(pwd)/.venv/bin" >> $GITHUB_PATH echo "VIRTUAL_ENV=$(pwd)/venv/" >> $GITHUB_ENV From 26adf7c0609b3cad5964e4ef190bedf2e19a8159 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 11:01:39 +0000 Subject: [PATCH 36/59] Try another thing --- .github/workflows/NVHPC.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 79484aa87..4d8d719da 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -117,18 +117,14 @@ jobs: apt-get install -y python${{ env.PYTHON }} python${{ env.PYTHON }}-venv python${{ env.PYTHON }}-distutils python${{ env.PYTHON }}-dev python3-pip # create and activate a venv + install python deps into it, to workaround a deadsnakes + pip quirk python${{ env.PYTHON }} -m venv .venv - source .venv/bin/activate - echo "$(pwd)/.venv/bin" - echo "ls venv" - ls $(pwd)/.venv - echo "ls bin" - ls $(pwd)/.venv/bin - ls does-not-exist - + source .venv/bin/activate # manually add venv dirs to the path and env for later steps echo "$(pwd)/.venv/bin" >> $GITHUB_PATH echo "VIRTUAL_ENV=$(pwd)/venv/" >> $GITHUB_ENV python${{ env.PYTHON }} -m pip install --upgrade wheel build setuptools + which python3 + python3 --version + # these conditions need to be based on the version in the container, not the host. Might want tweaking, or just relies on the yml being correct. - name: Install Visualisation Dependencies @@ -183,6 +179,10 @@ jobs: # Inner directory case changes in some releases, use find to get the right path echo "$(dirname $(find $(pwd) -wholename "*/bin/cmake" -exec echo {} \; -quit))" >> $GITHUB_PATH + - name: py test + run: | + which python3 + python3 --version - name: Configure cmake run: > @@ -196,7 +196,6 @@ jobs: -DFLAMEGPU_BUILD_PYTHON="${{ env.FLAMEGPU_BUILD_PYTHON }}" -DPYTHON3_EXACT_VERSION="${{ env.PYTHON }}" -DPython3_ROOT_DIR="$(pwd)/.venv/bin" - -DPython3_EXECUTABLE="$(pwd)/.venv/bin/python3)" -DPython_FIND_STRATEGY=LOCATION -DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}" -DFLAMEGPU_ENABLE_NVTX="ON" From a8217118e966ed1d2a8d8f5abeea630fe03a29e0 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 11:11:00 +0000 Subject: [PATCH 37/59] Remove ci debugging code --- .github/workflows/NVHPC.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 4d8d719da..8bb2dfcd3 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -122,9 +122,6 @@ jobs: echo "$(pwd)/.venv/bin" >> $GITHUB_PATH echo "VIRTUAL_ENV=$(pwd)/venv/" >> $GITHUB_ENV python${{ env.PYTHON }} -m pip install --upgrade wheel build setuptools - which python3 - python3 --version - # these conditions need to be based on the version in the container, not the host. Might want tweaking, or just relies on the yml being correct. - name: Install Visualisation Dependencies @@ -179,11 +176,6 @@ jobs: # Inner directory case changes in some releases, use find to get the right path echo "$(dirname $(find $(pwd) -wholename "*/bin/cmake" -exec echo {} \; -quit))" >> $GITHUB_PATH - - name: py test - run: | - which python3 - python3 --version - - name: Configure cmake run: > cmake . -B "${{ env.BUILD_DIR }}" From 6d2e8236a161810e98e4aff1c0bd8792f7f15a54 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 11:11:19 +0000 Subject: [PATCH 38/59] Adjust nvhpc ci matrix. more nvhpc, single python --- .github/workflows/NVHPC.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 8bb2dfcd3..179b076ae 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -40,8 +40,28 @@ jobs: - cuda: "11.8" cuda_arch: "35" hostcxx: nvhpc-22.11 + os: ubuntu-22.04 + container: nvcr.io/nvidia/nvhpc:22.11-devel-cuda11.8-ubuntu22.04 + - cuda: "11.5" + cuda_arch: "35" + hostcxx: nvhpc-21.11 + os: ubuntu-20.04 + container: nvcr.io/nvidia/nvhpc:21.11-devel-cuda11.5-ubuntu20.04 + - cuda: "11.3" + cuda_arch: "35" + hostcxx: nvhpc-21.5 + os: ubuntu-20.04 + container: nvcr.io/nvidia/nvhpc:21.5-devel-cuda11.3-ubuntu20.04 + - cuda: "11.2" + cuda_arch: "35" + hostcxx: nvhpc-21.1 + os: ubuntu-20.04 + container: nvcr.io/nvidia/nvhpc:21.1-devel-cuda11.2-ubuntu20.04 + - cuda: "11.1" + cuda_arch: "35" + hostcxx: nvhpc-20.11 os: ubuntu-20.04 - container: nvcr.io/nvidia/nvhpc:22.11-devel-cuda11.8-ubuntu20.04 + container: nvcr.io/nvidia/nvhpc:20.11-devel-cuda11.1-ubuntu20.04 # nvcr.io/nvidia/nvhpc:23.11-devel-cuda12.3-ubuntu22.04 # nvcr.io/nvidia/nvhpc:23.9-devel-cuda12.2-ubuntu22.04 # nvcr.io/nvidia/nvhpc:23.7-devel-cuda12.2-ubuntu22.04 @@ -65,7 +85,6 @@ jobs: # nvcr.io/nvidia/nvhpc:20.11-devel-cuda11.1-ubuntu20.04 python: - "3.12" - - "3.11" config: - name: "Release" config: "Release" From a117bfa99f1fc0349e03d6b7a48fabc9f0c4fecd Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 11:31:33 +0000 Subject: [PATCH 39/59] widen nvhpc ci matrix to detect when curand started working --- .github/workflows/NVHPC.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 179b076ae..d4941416e 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -42,6 +42,21 @@ jobs: hostcxx: nvhpc-22.11 os: ubuntu-22.04 container: nvcr.io/nvidia/nvhpc:22.11-devel-cuda11.8-ubuntu22.04 + - cuda: "11.7" + cuda_arch: "35" + hostcxx: nvhpc-22.9 + os: ubuntu-22.04 + container: nvcr.io/nvidia/nvhpc:22.9-devel-cuda11.7-ubuntu22.04 + - cuda: "11.7" + cuda_arch: "35" + hostcxx: nvhpc-22.5 + os: ubuntu-20.04 + container: nvcr.io/nvidia/nvhpc:22.5-devel-cuda11.7-ubuntu20.04 + - cuda: "11.6" + cuda_arch: "35" + hostcxx: nvhpc-22.3 + os: ubuntu-20.04 + container: nvcr.io/nvidia/nvhpc:22.3-devel-cuda11.6-ubuntu20.04 - cuda: "11.5" cuda_arch: "35" hostcxx: nvhpc-21.11 From acb31bbb257a1fe9e7c8de8f7eabdbc1ef841692 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 11:42:30 +0000 Subject: [PATCH 40/59] try nvhpc 22.1 and 22.2 to find when curand starts working --- .github/workflows/NVHPC.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index d4941416e..d428e20a3 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -57,6 +57,16 @@ jobs: hostcxx: nvhpc-22.3 os: ubuntu-20.04 container: nvcr.io/nvidia/nvhpc:22.3-devel-cuda11.6-ubuntu20.04 + - cuda: "11.6" + cuda_arch: "35" + hostcxx: nvhpc-22.2 + os: ubuntu-20.04 + container: nvcr.io/nvidia/nvhpc:22.2-devel-cuda11.6-ubuntu20.04 + - cuda: "11.5" + cuda_arch: "35" + hostcxx: nvhpc-22.1 + os: ubuntu-20.04 + container: nvcr.io/nvidia/nvhpc:22.1-devel-cuda11.5-ubuntu20.04 - cuda: "11.5" cuda_arch: "35" hostcxx: nvhpc-21.11 From 850e09ee4541fe28b86cc2f4d6d515508091574a Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 12:04:09 +0000 Subject: [PATCH 41/59] try to ensure cmake uses nvc++ --- .github/workflows/NVHPC.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index d428e20a3..7802259f9 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -150,6 +150,10 @@ jobs: - name: Enable git safe-directory run: git config --global --add safe.directory $GITHUB_WORKSPACE + # Select the host compiler + - name: Set host compiler + run: + # Don't use select python when running in the container. deadsnakes ppa might be easiest way to add custom python? - name: Install python from deadsnakes + dependencies if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} @@ -220,6 +224,13 @@ jobs: # Inner directory case changes in some releases, use find to get the right path echo "$(dirname $(find $(pwd) -wholename "*/bin/cmake" -exec echo {} \; -quit))" >> $GITHUB_PATH + - name: Ensure the correct host compiler is selected (gcc must be used for swig) + if: ${{ startsWith(env.HOSTCXX, 'nvhpc-') }} + run: | + echo "CC=$(which nvc)" >> $GITHUB_ENV + echo "CXX=$(which nvc++)" >> $GITHUB_ENV + echo "CUDAHOSTCXX=$(which nvc++)" >> $GITHUB_ENV + - name: Configure cmake run: > cmake . -B "${{ env.BUILD_DIR }}" From 834a25a644c596f7cfabd76d2e62bb881c32380b Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 12:05:12 +0000 Subject: [PATCH 42/59] fixup --- .github/workflows/NVHPC.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 7802259f9..b045ab2af 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -150,10 +150,6 @@ jobs: - name: Enable git safe-directory run: git config --global --add safe.directory $GITHUB_WORKSPACE - # Select the host compiler - - name: Set host compiler - run: - # Don't use select python when running in the container. deadsnakes ppa might be easiest way to add custom python? - name: Install python from deadsnakes + dependencies if: ${{ env.PYTHON != '' && env.FLAMEGPU_BUILD_PYTHON == 'ON' }} From fa5ba595a5c2c257ab6c7fdb98bbfe6100aad04d Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 13:09:28 +0000 Subject: [PATCH 43/59] WIP: Add curand's repackaged location when using nvhpc, but this then exposes an issue with thrust. --- src/CMakeLists.txt | 70 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e841f4204..792b3c3be 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -656,6 +656,76 @@ target_link_libraries(${PROJECT_NAME} PUBLIC CUDA::nvrtc) target_link_libraries(${PROJECT_NAME} PUBLIC CUDA::cuda_driver) +# If using cuda installed with older nvhpc, the location of curand won't implicitly be on the include directory path, so we must explicitly specify it. + +# do a find path for curand.h at the expected nvcc location. If it does not exist there, then try again where nvhpc places it, and if found add that to the include directories. Potentially this is not required for new enough nvhpc with gcc as the host compiler. +# Could also detect if this is neccesary via try compile, set a cache var, and if the cache var exists use that? +message("CUDAToolkit_INCLUDE_DIRS ${CUDAToolkit_INCLUDE_DIRS}") +find_path(curand_INCLUDE_DIRS + NAMES + curand.h + PATHS + ${CUDAToolkit_INCLUDE_DIRS} + NO_CACHE +) +# if not found, probably an nvhpc install (or curand is not installed) +if(NOT curand_INCLUDE_DIRS) + # search for the (expected) split math library location + message(WARNING "curand not found at expected location, must be an nvhpc install.") + # if using nvhpc as the host compiler + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.19") + file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../../../math_libs/${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}" curand_split_search_dir) + else() + message(FATAL_ERROR "@todo - use get filename component isntead.") + get_filename_component(curand_split_search_dir "@todo" REALPATH) + endif() + message("curand_split_search_dir ${curand_split_search_dir}") + find_file(curand_header_abspath + NAMES + curand.h + include/curand.h + PATHS + ${curand_split_search_dir} + NO_CACHE + ) + # if we still don't have curand, we probably can't continue so error. + if(NOT curand_header_abspath) + message(FATAL_ERROR "${curand_header_abspath} not found @todo") + else() + # if we found curand at the exepcted nvhpc installation location, we might have to resolve symlinks again, and return the parent directory + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.19") + message("curand_header_abspath ${curand_header_abspath}") + file(REAL_PATH "${curand_header_abspath}" curand_header_abspath) + cmake_path(GET curand_header_abspath PARENT_PATH curand_INCLUDE_DIRS) + else() + message(FATAL_ERROR "@todo - use get filename component isntead.") + get_filename_component(curand_split_search_dir "@todo" REALPATH) + endif() + + # message(FATAL_ERROR "curand_INCLUDE_DIRS ${curand_INCLUDE_DIRS}") + + target_include_directories(${PROJECT_NAME} PUBLIC ${curand_INCLUDE_DIRS}) + unset(curand_header_abspath) + endif() +endif() +unset(curand_INCLUDE_DIRS) + +# @todo - correctly detect where nvcc came from, but when nvhpc is not the host compiler. +# @todo - if using nvhpc and version is older, or using an nvcc install from within nvhpc? +# if(CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "22.3") +# target_link_libraries(${PROJECT_NAME} PUBLIC CUDA::curand) +# message(FATAL_ERROR "older nvhpc, doi curand manually") +# # else() +# # message(FATAL_ERROR "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") +# endif() + +# If using cuda installed with older nvhpc, and nvhpc as the host compiler, need to ensure that curands repackaged include directory is on the include path. the CUDA::curand target does not do this. +# if(CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") +# target_link_libraries(${PROJECT_NAME} PUBLIC CUDA::curand) +# message(FATAL_ERROR "CUDAToolkit_INCLUDE_DIRS ${CUDAToolkit_INCLUDE_DIRS}") +# target_include_directories(${PROJECT_NAME} PUBLIC ${}) +# endif() + if(FLAMEGPU_ENABLE_NVTX AND TARGET NVTX::nvtx) target_link_libraries(${PROJECT_NAME} PUBLIC NVTX::nvtx) # Get the version to set a definition value From cc92e9c2a106230825a93cda19ebc602383bf86a Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Tue, 9 Jan 2024 15:37:44 +0000 Subject: [PATCH 44/59] Adjust cmake_minimim_required upper limit to set all new policies to NEW Includes CMP0152 which in CMake >= 3.28 changes symlink resolution behaviour, relevant to nvhpc workarounds. --- CMakeLists.txt | 2 +- examples/cpp/boids_bruteforce/CMakeLists.txt | 2 +- examples/cpp/boids_spatial3D/CMakeLists.txt | 2 +- .../cpp/circles_bruteforce/CMakeLists.txt | 2 +- examples/cpp/circles_spatial3D/CMakeLists.txt | 2 +- examples/cpp/diffusion/CMakeLists.txt | 2 +- examples/cpp/ensemble/CMakeLists.txt | 2 +- examples/cpp/game_of_life/CMakeLists.txt | 2 +- examples/cpp/host_functions/CMakeLists.txt | 2 +- examples/cpp/sugarscape/CMakeLists.txt | 2 +- .../cpp_rtc/boids_bruteforce/CMakeLists.txt | 2 +- .../cpp_rtc/boids_spatial3D/CMakeLists.txt | 2 +- src/CMakeLists.txt | 34 ++++--------------- swig/CMakeLists.txt | 2 +- swig/python/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 2 +- 16 files changed, 22 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f634809aa..4adb72248 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Include and call some CMake to record initial state of CMAKE_CUDA_ARCHITECTURES for later use include(${CMAKE_CURRENT_LIST_DIR}/cmake/CUDAArchitectures.cmake) diff --git a/examples/cpp/boids_bruteforce/CMakeLists.txt b/examples/cpp/boids_bruteforce/CMakeLists.txt index dc3e7707c..ae6282813 100644 --- a/examples/cpp/boids_bruteforce/CMakeLists.txt +++ b/examples/cpp/boids_bruteforce/CMakeLists.txt @@ -1,5 +1,5 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Set the location of the ROOT flame gpu project relative to this CMakeList.txt get_filename_component(FLAMEGPU_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) diff --git a/examples/cpp/boids_spatial3D/CMakeLists.txt b/examples/cpp/boids_spatial3D/CMakeLists.txt index 7ed05cd29..962330fc8 100644 --- a/examples/cpp/boids_spatial3D/CMakeLists.txt +++ b/examples/cpp/boids_spatial3D/CMakeLists.txt @@ -1,5 +1,5 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Set the location of the ROOT flame gpu project relative to this CMakeList.txt get_filename_component(FLAMEGPU_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) diff --git a/examples/cpp/circles_bruteforce/CMakeLists.txt b/examples/cpp/circles_bruteforce/CMakeLists.txt index c5593370b..41d52723d 100644 --- a/examples/cpp/circles_bruteforce/CMakeLists.txt +++ b/examples/cpp/circles_bruteforce/CMakeLists.txt @@ -1,5 +1,5 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Set the location of the ROOT flame gpu project relative to this CMakeList.txt get_filename_component(FLAMEGPU_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) diff --git a/examples/cpp/circles_spatial3D/CMakeLists.txt b/examples/cpp/circles_spatial3D/CMakeLists.txt index eb1090966..2ffd2f16f 100644 --- a/examples/cpp/circles_spatial3D/CMakeLists.txt +++ b/examples/cpp/circles_spatial3D/CMakeLists.txt @@ -1,5 +1,5 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Set the location of the ROOT flame gpu project relative to this CMakeList.txt get_filename_component(FLAMEGPU_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) diff --git a/examples/cpp/diffusion/CMakeLists.txt b/examples/cpp/diffusion/CMakeLists.txt index 29351386e..c8200ed65 100644 --- a/examples/cpp/diffusion/CMakeLists.txt +++ b/examples/cpp/diffusion/CMakeLists.txt @@ -1,5 +1,5 @@ # Set the minimum cmake version to that which supports cuda natively. -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Set the location of the ROOT flame gpu project relative to this CMakeList.txt get_filename_component(FLAMEGPU_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) diff --git a/examples/cpp/ensemble/CMakeLists.txt b/examples/cpp/ensemble/CMakeLists.txt index 4cfc9dacd..8d1d7a6ef 100644 --- a/examples/cpp/ensemble/CMakeLists.txt +++ b/examples/cpp/ensemble/CMakeLists.txt @@ -1,5 +1,5 @@ # Set the minimum cmake version to that which supports cuda natively. -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Set the location of the ROOT flame gpu project relative to this CMakeList.txt get_filename_component(FLAMEGPU_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) diff --git a/examples/cpp/game_of_life/CMakeLists.txt b/examples/cpp/game_of_life/CMakeLists.txt index 1903dfd50..ace58244b 100644 --- a/examples/cpp/game_of_life/CMakeLists.txt +++ b/examples/cpp/game_of_life/CMakeLists.txt @@ -1,5 +1,5 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Set the location of the ROOT flame gpu project relative to this CMakeList.txt get_filename_component(FLAMEGPU_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) diff --git a/examples/cpp/host_functions/CMakeLists.txt b/examples/cpp/host_functions/CMakeLists.txt index 356a372e1..4b0f0c109 100644 --- a/examples/cpp/host_functions/CMakeLists.txt +++ b/examples/cpp/host_functions/CMakeLists.txt @@ -1,5 +1,5 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Set the location of the ROOT flame gpu project relative to this CMakeList.txt get_filename_component(FLAMEGPU_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) diff --git a/examples/cpp/sugarscape/CMakeLists.txt b/examples/cpp/sugarscape/CMakeLists.txt index b12a28fbe..3790e7eb1 100644 --- a/examples/cpp/sugarscape/CMakeLists.txt +++ b/examples/cpp/sugarscape/CMakeLists.txt @@ -1,5 +1,5 @@ # Set the minimum cmake version to that which supports cuda natively. -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Set the location of the ROOT flame gpu project relative to this CMakeList.txt get_filename_component(FLAMEGPU_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) diff --git a/examples/cpp_rtc/boids_bruteforce/CMakeLists.txt b/examples/cpp_rtc/boids_bruteforce/CMakeLists.txt index 8d2d425a1..79559a997 100644 --- a/examples/cpp_rtc/boids_bruteforce/CMakeLists.txt +++ b/examples/cpp_rtc/boids_bruteforce/CMakeLists.txt @@ -1,5 +1,5 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Set the location of the ROOT flame gpu project relative to this CMakeList.txt get_filename_component(FLAMEGPU_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) diff --git a/examples/cpp_rtc/boids_spatial3D/CMakeLists.txt b/examples/cpp_rtc/boids_spatial3D/CMakeLists.txt index 9c2047a6e..c3090a7d3 100644 --- a/examples/cpp_rtc/boids_spatial3D/CMakeLists.txt +++ b/examples/cpp_rtc/boids_spatial3D/CMakeLists.txt @@ -1,5 +1,5 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Set the location of the ROOT flame gpu project relative to this CMakeList.txt get_filename_component(FLAMEGPU_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 792b3c3be..af44025fa 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Set the location of the ROOT flame gpu project relative to this CMakeList.txt get_filename_component(FLAMEGPU_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/.. REALPATH) @@ -659,8 +659,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC CUDA::cuda_driver) # If using cuda installed with older nvhpc, the location of curand won't implicitly be on the include directory path, so we must explicitly specify it. # do a find path for curand.h at the expected nvcc location. If it does not exist there, then try again where nvhpc places it, and if found add that to the include directories. Potentially this is not required for new enough nvhpc with gcc as the host compiler. -# Could also detect if this is neccesary via try compile, set a cache var, and if the cache var exists use that? -message("CUDAToolkit_INCLUDE_DIRS ${CUDAToolkit_INCLUDE_DIRS}") +# Could also detect if this is necessary via try compile, set a cache var, and if the cache var exists use that? find_path(curand_INCLUDE_DIRS NAMES curand.h @@ -671,7 +670,7 @@ find_path(curand_INCLUDE_DIRS # if not found, probably an nvhpc install (or curand is not installed) if(NOT curand_INCLUDE_DIRS) # search for the (expected) split math library location - message(WARNING "curand not found at expected location, must be an nvhpc install.") + # message(WARNING "curand not found at expected location, must be an nvhpc install.") # if using nvhpc as the host compiler if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.19") file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../../../math_libs/${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}" curand_split_search_dir) @@ -679,7 +678,6 @@ if(NOT curand_INCLUDE_DIRS) message(FATAL_ERROR "@todo - use get filename component isntead.") get_filename_component(curand_split_search_dir "@todo" REALPATH) endif() - message("curand_split_search_dir ${curand_split_search_dir}") find_file(curand_header_abspath NAMES curand.h @@ -692,40 +690,22 @@ if(NOT curand_INCLUDE_DIRS) if(NOT curand_header_abspath) message(FATAL_ERROR "${curand_header_abspath} not found @todo") else() - # if we found curand at the exepcted nvhpc installation location, we might have to resolve symlinks again, and return the parent directory + # if we found curand at the expected nvhpc installation location, we might have to resolve symlinks again, and return the parent directory. This could be simplified for 3.28+ + # @todo - do we need to support the 3.18/3.19 path here? nvhpc is only supported for 3.20+, and we might add a lower minimum if it fixes things. if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.19") - message("curand_header_abspath ${curand_header_abspath}") + message("curand_header_abspath ${curand_header_abspath}") file(REAL_PATH "${curand_header_abspath}" curand_header_abspath) cmake_path(GET curand_header_abspath PARENT_PATH curand_INCLUDE_DIRS) else() message(FATAL_ERROR "@todo - use get filename component isntead.") get_filename_component(curand_split_search_dir "@todo" REALPATH) - endif() - - # message(FATAL_ERROR "curand_INCLUDE_DIRS ${curand_INCLUDE_DIRS}") - + endif() target_include_directories(${PROJECT_NAME} PUBLIC ${curand_INCLUDE_DIRS}) unset(curand_header_abspath) endif() endif() unset(curand_INCLUDE_DIRS) -# @todo - correctly detect where nvcc came from, but when nvhpc is not the host compiler. -# @todo - if using nvhpc and version is older, or using an nvcc install from within nvhpc? -# if(CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "22.3") -# target_link_libraries(${PROJECT_NAME} PUBLIC CUDA::curand) -# message(FATAL_ERROR "older nvhpc, doi curand manually") -# # else() -# # message(FATAL_ERROR "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") -# endif() - -# If using cuda installed with older nvhpc, and nvhpc as the host compiler, need to ensure that curands repackaged include directory is on the include path. the CUDA::curand target does not do this. -# if(CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") -# target_link_libraries(${PROJECT_NAME} PUBLIC CUDA::curand) -# message(FATAL_ERROR "CUDAToolkit_INCLUDE_DIRS ${CUDAToolkit_INCLUDE_DIRS}") -# target_include_directories(${PROJECT_NAME} PUBLIC ${}) -# endif() - if(FLAMEGPU_ENABLE_NVTX AND TARGET NVTX::nvtx) target_link_libraries(${PROJECT_NAME} PUBLIC NVTX::nvtx) # Get the version to set a definition value diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt index c261c6097..a52c2c973 100644 --- a/swig/CMakeLists.txt +++ b/swig/CMakeLists.txt @@ -1,5 +1,5 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) include(FetchContent) diff --git a/swig/python/CMakeLists.txt b/swig/python/CMakeLists.txt index 2db87b5d7..ac36c889a 100644 --- a/swig/python/CMakeLists.txt +++ b/swig/python/CMakeLists.txt @@ -1,6 +1,6 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 # for multi-config generators, CMake must be >= 3.20 for python bindings due to use of generator expressions in outputs/byproducts -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Defines multiple CMake targets and custom commands to build swig bindings, create a python wheel and (optionally) install it into a venv. # defines `pyflamegpu` - the user-facing target which creates the wheel. diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 269db9ffa..97f11c310 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,5 @@ # Minimum CMake version 3.18 for CUDA --std=c++17 -cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.18...3.28 FATAL_ERROR) # Option to enable GTEST_DISCOVER if tests or tests_dev are enabled. Defaults to off due to runtime increase cmake_dependent_option(FLAMEGPU_ENABLE_GTEST_DISCOVER "Enable GTEST_DISCOVER for more detailed ctest output without -VV. This dramatically increases test suite runtime to CUDA context initialisation." OFF "FLAMEGPU_BUILD_TESTS OR FLAMEGPU_BUILD_TESTS_DEV" OFF) From 6cc9bcd1ddb5a93b3ba1c8ade303a105355fa095 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 13:56:42 +0000 Subject: [PATCH 45/59] nvhpc suppress unused parameter warnings in JSONAdjacencyGraphSizeReader --- cmake/warnings.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake index c6e90fd82..14a7ea7ac 100644 --- a/cmake/warnings.cmake +++ b/cmake/warnings.cmake @@ -119,6 +119,9 @@ if(NOT COMMAND flamegpu_suppress_some_compiler_warnings) # nvc++ etc do not appear to have an equivalent to -isystem. Rather than more pragma warning soup, just tone down warnings when using nvc++ as appropriate. target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Xcudafe --diag_suppress=code_is_unreachable>") target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:--diag_suppress=code_is_unreachable>") + # older nvhpc as host compiler warns for intentional declared but never referenced parameters + target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Wno-unused-but-set-parameter>") + target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Xcompiler -Wno-unused-but-set-parameter>") else() # Linux specific warning suppressions endif() From 5c5d3734a8277ef63b87669e66cbe73b6a17897f Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 14:01:19 +0000 Subject: [PATCH 46/59] NVHPC fix implicit conversion int sign change warnings cudaMemset takes an int not a uint64, so 0xfffffff was triggering an implicit cast sign change. --- .../detail/CUDAEnvironmentDirectedGraphBuffers.cu | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/flamegpu/simulation/detail/CUDAEnvironmentDirectedGraphBuffers.cu b/src/flamegpu/simulation/detail/CUDAEnvironmentDirectedGraphBuffers.cu index 1d9f64b9f..6d7773506 100644 --- a/src/flamegpu/simulation/detail/CUDAEnvironmentDirectedGraphBuffers.cu +++ b/src/flamegpu/simulation/detail/CUDAEnvironmentDirectedGraphBuffers.cu @@ -429,7 +429,7 @@ void CUDAEnvironmentDirectedGraphBuffers::syncDevice_async(detail::CUDAScatter& } { // Build the map const auto& v_id_b = vertex_buffers.at(ID_VARIABLE_NAME); - gpuErrchk(cudaMemsetAsync(d_vertex_index_map, 0xffffffff, ID_RANGE * sizeof(unsigned int), stream)); + gpuErrchk(cudaMemsetAsync(d_vertex_index_map, 0xffff, ID_RANGE * sizeof(unsigned int), stream)); gpuErrchk(cudaMemsetAsync(d_pbm_swap, 0, 3 * sizeof(unsigned int), stream)); // We will use spare pbm_swap to count errors, save allocating more memory const unsigned int BLOCK_SZ = 512; const unsigned int BLOCK_CT = static_cast(ceil(vertex_count / static_cast(BLOCK_SZ))); @@ -478,7 +478,7 @@ void CUDAEnvironmentDirectedGraphBuffers::syncDevice_async(detail::CUDAScatter& cub_temp.resize(temp_req); gpuErrchk(cub::DeviceRadixSort::SortPairs(cub_temp.getPtr(), cub_temp.getSize(), d_keys, d_keys_swap, d_vals, d_vals_swap, edge_count, 0, sizeof(uint64_t) * 8, stream)); // Build PBM (For vertices with edges) - gpuErrchk(cudaMemset(d_pbm, 0xffffffff, (vertex_count + 1) * sizeof(unsigned int))); + gpuErrchk(cudaMemset(d_pbm, 0xffff, (vertex_count + 1) * sizeof(unsigned int))); gpuErrchk(cudaOccupancyMaxActiveBlocksPerMultiprocessor(&blockSize, findBinStart, 32, 0)); // Randomly 32 gridSize = (edge_count + blockSize - 1) / blockSize; // Round up according to array size findBinStart << > > (d_pbm, d_keys_swap, edge_count, vertex_count); @@ -532,7 +532,7 @@ void CUDAEnvironmentDirectedGraphBuffers::syncDevice_async(detail::CUDAScatter& auto& cub_temp = scatter.CubTemp(streamID); gpuErrchk(cub::DeviceRadixSort::SortPairs(cub_temp.getPtr(), cub_temp.getSize(), d_keys, d_keys_swap, d_vals, d_vals_swap, edge_count, 0, sizeof(uint64_t) * 8, stream)); // Build inverted PBM (For vertices with edges) - gpuErrchk(cudaMemset(d_ipbm, 0xffffffff, (vertex_count + 1) * sizeof(unsigned int))); + gpuErrchk(cudaMemset(d_ipbm, 0xffff, (vertex_count + 1) * sizeof(unsigned int))); gpuErrchk(cudaOccupancyMaxActiveBlocksPerMultiprocessor(&blockSize, findBinStart, 32, 0)); // Randomly 32 gridSize = (edge_count + blockSize - 1) / blockSize; // Round up according to array size findBinStart << > > (d_ipbm, d_keys_swap, edge_count, vertex_count); From 8097d47b215b70ed103a300361919d0a605eb9e0 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 14:12:07 +0000 Subject: [PATCH 47/59] try only building all remaingin targets with 1 process, potential ci mem issue with 23.11 --- .github/workflows/NVHPC.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index b045ab2af..6992f59f1 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -260,7 +260,8 @@ jobs: - name: Build all remaining targets working-directory: ${{ env.BUILD_DIR }} - run: cmake --build . --target all --verbose -j `nproc` + run: cmake --build . --target all --verbose -j 1 + #`nproc` # Upload wheel artifacts to the job on GHA, with a short retention # Use a unique name per job matrix run, to avoid a risk of corruption according to the docs (although it should work with unique filenames) From 3fe66d3e3669ea0d3b2b1b3bfadaa4eaa3edac07 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 14:29:04 +0000 Subject: [PATCH 48/59] Only set -Wno-unused-but-set-parameter where nvhpc supports it (maybe >= 22.9 --- .github/workflows/NVHPC.yml | 5 +++++ cmake/warnings.cmake | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 6992f59f1..d8cb2341b 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -47,6 +47,11 @@ jobs: hostcxx: nvhpc-22.9 os: ubuntu-22.04 container: nvcr.io/nvidia/nvhpc:22.9-devel-cuda11.7-ubuntu22.04 + - cuda: "11.7" + cuda_arch: "35" + hostcxx: nvhpc-22.7 + os: ubuntu-22.04 + container: nvcr.io/nvidia/nvhpc:22.7-devel-cuda11.7-ubuntu22.04 - cuda: "11.7" cuda_arch: "35" hostcxx: nvhpc-22.5 diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake index 14a7ea7ac..19ada8807 100644 --- a/cmake/warnings.cmake +++ b/cmake/warnings.cmake @@ -119,9 +119,12 @@ if(NOT COMMAND flamegpu_suppress_some_compiler_warnings) # nvc++ etc do not appear to have an equivalent to -isystem. Rather than more pragma warning soup, just tone down warnings when using nvc++ as appropriate. target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Xcudafe --diag_suppress=code_is_unreachable>") target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:--diag_suppress=code_is_unreachable>") - # older nvhpc as host compiler warns for intentional declared but never referenced parameters - target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Wno-unused-but-set-parameter>") - target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Xcompiler -Wno-unused-but-set-parameter>") + # older nvhpc as host compiler warns for intentional declared but never referenced parameters. only supported from 22.7/9 + message(FATAL_ERROR "${CMAKE_CXX_COMPILER_VERSION}") + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "22.7") + target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Wno-unused-but-set-parameter>") + target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Xcompiler -Wno-unused-but-set-parameter>") + endif() else() # Linux specific warning suppressions endif() From d3061e8faadf2499890964783094f7757db4bb44 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 14:39:58 +0000 Subject: [PATCH 49/59] fixup --- cmake/warnings.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake index 19ada8807..e72345f84 100644 --- a/cmake/warnings.cmake +++ b/cmake/warnings.cmake @@ -120,7 +120,6 @@ if(NOT COMMAND flamegpu_suppress_some_compiler_warnings) target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Xcudafe --diag_suppress=code_is_unreachable>") target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:--diag_suppress=code_is_unreachable>") # older nvhpc as host compiler warns for intentional declared but never referenced parameters. only supported from 22.7/9 - message(FATAL_ERROR "${CMAKE_CXX_COMPILER_VERSION}") if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "22.7") target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Wno-unused-but-set-parameter>") target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Xcompiler -Wno-unused-but-set-parameter>") From 604928c89d10efe7ef5fc7b70d1fd2560b1287e9 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 16:53:53 +0000 Subject: [PATCH 50/59] add nvcc from nvhpc but use gcc to ci. This might not work at all yet --- .github/workflows/NVHPC.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index d8cb2341b..0cbc163fd 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -37,6 +37,11 @@ jobs: hostcxx: nvhpc-23.11 os: ubuntu-22.04 container: nvcr.io/nvidia/nvhpc:23.11-devel-cuda12.3-ubuntu22.04 + - cuda: "11.8" + cuda_arch: "35" + hostcxx: gcc + os: ubuntu-22.04 + container: nvcr.io/nvidia/nvhpc:22.11-devel-cuda11.8-ubuntu22.04 - cuda: "11.8" cuda_arch: "35" hostcxx: nvhpc-22.11 From 02a0a46da4a7c3051fdeb44ad2ebac945fe9facf Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 17:19:51 +0000 Subject: [PATCH 51/59] remove superfluous cmake message --- src/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index af44025fa..6dfc06bb5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -693,7 +693,6 @@ if(NOT curand_INCLUDE_DIRS) # if we found curand at the expected nvhpc installation location, we might have to resolve symlinks again, and return the parent directory. This could be simplified for 3.28+ # @todo - do we need to support the 3.18/3.19 path here? nvhpc is only supported for 3.20+, and we might add a lower minimum if it fixes things. if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.19") - message("curand_header_abspath ${curand_header_abspath}") file(REAL_PATH "${curand_header_abspath}" curand_header_abspath) cmake_path(GET curand_header_abspath PARENT_PATH curand_INCLUDE_DIRS) else() From 334afe21013c59870a3030021105ff5ff5d18725 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 17:30:54 +0000 Subject: [PATCH 52/59] attemtpt to add diagnostic error numbers to nvc++ warnings so they can be added to suppressions --- cmake/warnings.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake index e72345f84..924f39a9f 100644 --- a/cmake/warnings.cmake +++ b/cmake/warnings.cmake @@ -69,6 +69,11 @@ if(NOT COMMAND flamegpu_set_high_warning_level) # Disabled, as cpplint occasionally disagrees with gcc concerning override # target_compile_options(${SHWL_TARGET} PRIVATE "$<$:SHELL:-Xcompiler -Wsuggest-override>") # target_compile_options(${SHWL_TARGET} PRIVATE "$<$:-Wsuggest-override>") + + # if nvhpc, add display error numbers to the host com + if(CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") + target_compile_options(${SHWL_TARGET} PRIVATE "$<$:SHELL:--display_error_number>") + endif() endif() # Generic options regardless of platform/host compiler: # Ensure NVCC outputs warning numbers From cb0b9d333a363562f21a7f656c46e4bd946f4757 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 17:42:25 +0000 Subject: [PATCH 53/59] Don't enable -Wsigncompare with older nvhpc --- cmake/warnings.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake index 924f39a9f..02ec46861 100644 --- a/cmake/warnings.cmake +++ b/cmake/warnings.cmake @@ -57,10 +57,14 @@ if(NOT COMMAND flamegpu_set_high_warning_level) target_compile_options(${SHWL_TARGET} PRIVATE "$<$:SHELL:--Wreorder>") endif() else() - # Assume using GCC/Clang which Wall is relatively sane for. - target_compile_options(${SHWL_TARGET} PRIVATE "$<$:SHELL:-Xcompiler -Wall$-Wsign-compare>") + # Assume using GCC/Clang which Wall is relatively sane for. + target_compile_options(${SHWL_TARGET} PRIVATE "$<$:SHELL:-Xcompiler -Wall>") target_compile_options(${SHWL_TARGET} PRIVATE "$<$:-Wall>") - target_compile_options(${SHWL_TARGET} PRIVATE "$<$:-Wsign-compare>") + # Sign compare is not valid with older nvhpc's + if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "21.11") + target_compile_options(${SHWL_TARGET} PRIVATE "$<$:SHELL:-Xcompiler -Wsign-compare>") + target_compile_options(${SHWL_TARGET} PRIVATE "$<$:-Wsign-compare>") + endif() # Reorder errors for device code are caused by some cub/thrust versions (< 2.1.0?), but can be suppressed by pragmas successfully in 11.3+ under linux, but not for nvhpc if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3.0 AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") target_compile_options(${SHWL_TARGET} PRIVATE "$<$:SHELL:--Wreorder>") From d6f17f8fccf1d7042e02e0e051c5d4f4c995aca2 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 17:43:30 +0000 Subject: [PATCH 54/59] Supress parameter declared but never referenced when using older nvhpc --- cmake/warnings.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake index 02ec46861..fdfd565a2 100644 --- a/cmake/warnings.cmake +++ b/cmake/warnings.cmake @@ -132,6 +132,10 @@ if(NOT COMMAND flamegpu_suppress_some_compiler_warnings) if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "22.7") target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Wno-unused-but-set-parameter>") target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Xcompiler -Wno-unused-but-set-parameter>") + else() + # parameter "x" was declared but never referenced + target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:-Xcudafe --diag_suppress=177>") + target_compile_options(${SSCW_TARGET} PRIVATE "$<$:SHELL:--diag_suppress=177>") endif() else() # Linux specific warning suppressions From 8c2929710a94fa1fd30cabcb985c3cf547fa805c Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 17:47:49 +0000 Subject: [PATCH 55/59] nvhpc CI: if configure fails, cat the logs. --- .github/workflows/NVHPC.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 0cbc163fd..b43f4c445 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -238,6 +238,7 @@ jobs: echo "CUDAHOSTCXX=$(which nvc++)" >> $GITHUB_ENV - name: Configure cmake + id: configure run: > cmake . -B "${{ env.BUILD_DIR }}" -DCMAKE_BUILD_TYPE="${{ env.CONFIG }}" @@ -252,6 +253,14 @@ jobs: -DPython_FIND_STRATEGY=LOCATION -DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}" -DFLAMEGPU_ENABLE_NVTX="ON" + + - name: Log Configure Erorrs + if: ${{ failure() && steps.configure.conclusion == 'failure' }} + run: | + echo "CMakeOutput.log:" + cat ${{ env.BUILD_DIR }}/CMakeFiles/CMakeOutput.log + echo "CMakeError.log:" + cat ${{ env.BUILD_DIR }}/CMakeFiles/CMakeError.log - name: Build static library working-directory: ${{ env.BUILD_DIR }} From 05150cf7451d1be32ae93998d397c2140acff08c Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 17:54:37 +0000 Subject: [PATCH 56/59] cmake warnings fixup --- cmake/warnings.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake index fdfd565a2..ae859cf38 100644 --- a/cmake/warnings.cmake +++ b/cmake/warnings.cmake @@ -61,7 +61,7 @@ if(NOT COMMAND flamegpu_set_high_warning_level) target_compile_options(${SHWL_TARGET} PRIVATE "$<$:SHELL:-Xcompiler -Wall>") target_compile_options(${SHWL_TARGET} PRIVATE "$<$:-Wall>") # Sign compare is not valid with older nvhpc's - if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "21.11") + if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "21.11")) target_compile_options(${SHWL_TARGET} PRIVATE "$<$:SHELL:-Xcompiler -Wsign-compare>") target_compile_options(${SHWL_TARGET} PRIVATE "$<$:-Wsign-compare>") endif() From a27d9ec24c8679f82406e3143ee505a1c6c6db63 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 17:55:37 +0000 Subject: [PATCH 57/59] tweaks --- .github/workflows/NVHPC.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index b43f4c445..684750a46 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -257,10 +257,10 @@ jobs: - name: Log Configure Erorrs if: ${{ failure() && steps.configure.conclusion == 'failure' }} run: | - echo "CMakeOutput.log:" - cat ${{ env.BUILD_DIR }}/CMakeFiles/CMakeOutput.log - echo "CMakeError.log:" - cat ${{ env.BUILD_DIR }}/CMakeFiles/CMakeError.log + echo "${{ env.BUILD_DIR }}/CMakeFiles/CMakeOutput.log:" + cat ${{ env.BUILD_DIR }}/CMakeFiles/CMakeOutput.log || true + echo "${{ env.BUILD_DIR }}/CMakeFiles/CMakeError.log:" + cat ${{ env.BUILD_DIR }}/CMakeFiles/CMakeError.log || true - name: Build static library working-directory: ${{ env.BUILD_DIR }} From 24226fd6d33a395651094979df75ec12e618362a Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 11 Jan 2024 18:19:53 +0000 Subject: [PATCH 58/59] Attempt to fix some nvhpc ci via allow-unsupported-compilers nvcc believes it is incompatible with the versions of nvhpc it was distributed with... --- .github/workflows/NVHPC.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 684750a46..56d0b3f2b 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -253,6 +253,7 @@ jobs: -DPython_FIND_STRATEGY=LOCATION -DFLAMEGPU_VISUALISATION="${{ env.VISUALISATION }}" -DFLAMEGPU_ENABLE_NVTX="ON" + -DCMAKE_CUDA_FLAGS="-allow-unsupported-compiler" - name: Log Configure Erorrs if: ${{ failure() && steps.configure.conclusion == 'failure' }} From e0b0f69b010b5922657aa1298abd9d8682a0465b Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Fri, 12 Jan 2024 10:31:05 +0000 Subject: [PATCH 59/59] try much newer CMake, to see if that resolves anything --- .github/workflows/NVHPC.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/NVHPC.yml b/.github/workflows/NVHPC.yml index 56d0b3f2b..5607b8db8 100644 --- a/.github/workflows/NVHPC.yml +++ b/.github/workflows/NVHPC.yml @@ -128,7 +128,7 @@ jobs: # - "ON" - "OFF" cmake: - - "3.20.0" + - "3.27.0" # Name the job based on matrix/env options name: "build (${{ matrix.cudacxx.hostcxx }}, ${{matrix.python}}, ${{ matrix.VISUALISATION }}, ${{ matrix.config.name }}, ${{ matrix.cudacxx.os }})"