From 5dacc5c79c3cbb4a74fa238d0afce489537349d3 Mon Sep 17 00:00:00 2001 From: alaamroue Date: Sun, 3 Nov 2024 15:49:10 +0100 Subject: [PATCH 1/7] Update cmake --- .gitignore | 1 + CMakeLists.txt | 22 +++++++++++-------- apps/cudaFloodSolver/CMakeLists.txt | 4 ++-- .../CMakeLists.txt | 4 ++-- apps/cudaMultiGPUsFloodSolver/CMakeLists.txt | 4 ++-- lib/CMakeLists.txt | 4 ++-- 6 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f3d6549 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/build/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index fd3ba79..7567787 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,19 +1,24 @@ -cmake_minimum_required(VERSION 2.6) -#project name -project(HiPIMs) +cmake_minimum_required(VERSION 3.5) -find_package(CUDA) +project(HiPIMs LANGUAGES CXX CUDA) +set(CMAKE_CUDA_STANDARD 14) +set(CMAKE_CUDA_STANDARD_REQUIRED ON) +set(CMAKE_CUDA_ARCHITECTURES 80) +set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --extended-lambda") +set(CMAKE_CUDA_SEPARABLE_COMPILATION ON) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Debug) +endif() + +# Enable debug symbols across all platforms IF(WIN32) set(PLATFORM_CXX_FLAGS /Zi) - set(CUDA_SEPARABLE_COMPILATION ON) - set(CUDA_NVCC_FLAGS -arch=sm_35;--expt-extended-lambda) ENDIF(WIN32) IF(UNIX) set(PLATFORM_CXX_FLAGS "-pthread -std=c++11 -O3") - #set(CUDA_SEPARABLE_COMPILATION ON) - set(CUDA_NVCC_FLAGS -arch=sm_35;--expt-extended-lambda) ENDIF(UNIX) list(APPEND CMAKE_CXX_FLAGS ${PLATFORM_CXX_FLAGS}) @@ -21,7 +26,6 @@ list(APPEND CMAKE_CXX_FLAGS ${PLATFORM_CXX_FLAGS}) message("CXX Flags: " ${CMAKE_CXX_FLAGS}) message("NVCC Flags: " ${CUDA_NVCC_FLAGS}) - add_subdirectory(lib) add_subdirectory(apps/cudaFloodSolver) add_subdirectory(apps/cudaMultiGPUsFloodSolver) diff --git a/apps/cudaFloodSolver/CMakeLists.txt b/apps/cudaFloodSolver/CMakeLists.txt index d455884..8fbaa21 100644 --- a/apps/cudaFloodSolver/CMakeLists.txt +++ b/apps/cudaFloodSolver/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.5) set(EXE hipims-flood) set(SRCS cuda_flood_solver.cu) @@ -17,7 +17,7 @@ list(REMOVE_DUPLICATES GC_INCLUDE_DIRS) include_directories(${GC_INCLUDE_DIRS}) -cuda_add_executable(${EXE} ${SRCS}) +add_executable(${EXE} ${SRCS}) add_dependencies(${EXE} lib cuda_lib) #set (CUDA_NVCC_FLAGS "-arch=sm_20") diff --git a/apps/cudaIntegratedShallowFlowSolver/CMakeLists.txt b/apps/cudaIntegratedShallowFlowSolver/CMakeLists.txt index b014d8f..a264da0 100755 --- a/apps/cudaIntegratedShallowFlowSolver/CMakeLists.txt +++ b/apps/cudaIntegratedShallowFlowSolver/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.5) set(EXE hipims-landslide) set(SRCS cuda_integrated_shallow_flow_solver.cu) @@ -17,7 +17,7 @@ list(REMOVE_DUPLICATES GC_INCLUDE_DIRS) include_directories(${GC_INCLUDE_DIRS}) -cuda_add_executable(${EXE} ${SRCS}) +add_executable(${EXE} ${SRCS}) add_dependencies(${EXE} lib cuda_lib) #set (CUDA_NVCC_FLAGS "-arch=sm_20") diff --git a/apps/cudaMultiGPUsFloodSolver/CMakeLists.txt b/apps/cudaMultiGPUsFloodSolver/CMakeLists.txt index ed901b1..30df868 100644 --- a/apps/cudaMultiGPUsFloodSolver/CMakeLists.txt +++ b/apps/cudaMultiGPUsFloodSolver/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.5) set(EXE hipims-flood-mgpus) set(SRCS cuda_mgpus_flood_solver.cu) @@ -17,7 +17,7 @@ list(REMOVE_DUPLICATES GC_INCLUDE_DIRS) include_directories(${GC_INCLUDE_DIRS}) -cuda_add_executable(${EXE} ${SRCS}) +add_executable(${EXE} ${SRCS}) add_dependencies(${EXE} lib cuda_lib) #set (CUDA_NVCC_FLAGS "-arch=sm_20") diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 451f63b..c343c89 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.5) # nvcc flags @@ -28,6 +28,6 @@ else() include_directories(${GC_INCLUDE_DIRS}) add_library(lib STATIC ${gc_srcs}) #cuda_add_library(cuda_lib STATIC ${gc_cuda_srcs}) -cuda_add_library(cuda_lib STATIC ${gc_cuda_srcs}) +add_library(cuda_lib STATIC ${gc_cuda_srcs}) endif() From 307e993a333cba7e7501252f1eed45c506a95bd0 Mon Sep 17 00:00:00 2001 From: alaamroue Date: Sun, 3 Nov 2024 18:37:43 +0100 Subject: [PATCH 2/7] Add windows CI Pipeline --- .github/workflows/CMakeBuildUbuntu.yml | 66 ++++++++++++++ .github/workflows/CMakeBuildWindows.yml | 112 ++++++++++++++++++++++++ .github/workflows/actionCacheClear.yml | 30 +++++++ 3 files changed, 208 insertions(+) create mode 100644 .github/workflows/CMakeBuildUbuntu.yml create mode 100644 .github/workflows/CMakeBuildWindows.yml create mode 100644 .github/workflows/actionCacheClear.yml diff --git a/.github/workflows/CMakeBuildUbuntu.yml b/.github/workflows/CMakeBuildUbuntu.yml new file mode 100644 index 0000000..9eefd32 --- /dev/null +++ b/.github/workflows/CMakeBuildUbuntu.yml @@ -0,0 +1,66 @@ +ο»Ώname: Building For Linux + +on: + #push: + # branches: + # - master + pull_request: + branches: + - master + +env: + BUILD_TYPE: Release + +jobs: + BuildForUbuntu: + name: '🐧 Build for Ubuntu' + runs-on: ubuntu-latest + env: + NVIDA_DRIVER_URL: "https://developer.download.nvidia.com/compute/cuda/12.6.2/local_installers/cuda-repo-ubuntu2404-12-6-local_12.6.2-560.35.03-1_amd64.deb" + NVIDA_DRIVER_FILE_NAME: "cuda-repo-ubuntu2404-12-6-local_12.6.2-560.35.03-1_amd64.deb" + NVIDA_PIN_URL: "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-ubuntu2404.pin" + NVIDA_PIN_NAME: "cuda-ubuntu2404.pin" + NVIDA_APT_NAME: "cuda-toolkit-12-6" + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: 'Cache Nvdia Driver' + id: cache-nvdia + uses: actions/cache@v4 + with: + path: ${{ env.NVIDA_DRIVER_FILE_NAME }} + key: ${{ runner.os }}-${{ env.NVIDA_DRIVER_FILE_NAME }} + + - name: Download Nvdia driver + if: steps.cache-nvdia.outputs.cache-hit != 'true' + run: wget ${{ env.NVIDA_DRIVER_URL }} + + - name: 'πŸ”§ Install Nvidia Driver' + run: | + wget ${{ env.NVIDA_PIN_URL }} + sudo mv ${{ env.NVIDA_PIN_NAME }} /etc/apt/preferences.d/cuda-repository-pin-600 + sudo dpkg -i ${{ env.NVIDA_DRIVER_FILE_NAME }} + sudo cp /var/cuda-repo-*-local/cuda-*-keyring.gpg /usr/share/keyrings/ + sudo apt-get update + sudo apt-get -y install ${{ env.NVIDA_APT_NAME }} + + - name: 'πŸ—οΈ Configure CMake' + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: 'πŸ› οΈ Build' + run: | + cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 + + - name: 'πŸ“ƒ Output Current Files' + run: ls -R + + - name: '🧩 Install dependencies' + run: | + sudo apt-get update + + - name: 'πŸ“ƒ Output Current Files' + run: ls -R + diff --git a/.github/workflows/CMakeBuildWindows.yml b/.github/workflows/CMakeBuildWindows.yml new file mode 100644 index 0000000..8a4ad01 --- /dev/null +++ b/.github/workflows/CMakeBuildWindows.yml @@ -0,0 +1,112 @@ +name: Building For Windows + +on: + push: + branches: + - master + pull_request: + branches: + - master + +env: + BUILD_TYPE: Release + +jobs: + BuildForWindows: + name: 'πŸͺŸ Build for Windows' + runs-on: windows-latest + env: + CUDA_PATH: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6" + CUDA_PATH_BIN: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6\\bin" + CUDA_PATH_V12_6: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6" + CUDA_PATH_VX_Y: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6" + + NVIDA_DRIVER_URL: "https://developer.download.nvidia.com/compute/cuda/12.6.2/local_installers/cuda_12.6.2_560.94_windows.exe" + NVIDA_DRIVER_FILE_NAME: "cuda_12.6.2_560.94_windows.exe" + NVIDA_INSTALL_ARGS: "-s nvcc_12.6 visual_studio_integration_12.6 cudart_12.6" + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: 'Get Nvdia Driver Cache' + id: cache-nvdia + uses: actions/cache@v4 + with: + path: nvidia_toolkit_cache + key: nvidia-toolkit-${{ env.NVIDA_DRIVER_FILE_NAME }} + + - name: Download Nvidia Driver + if: steps.cache-nvdia.outputs.cache-hit != 'true' + run: Invoke-WebRequest -Uri $env:NVIDA_DRIVER_URL -OutFile $env:NVIDA_DRIVER_FILE_NAME + + - name: '🧰 Install Nvidia Driver' + if: steps.cache-nvdia.outputs.cache-hit != 'true' + run: | + Start-Process -FilePath $env:NVIDA_DRIVER_FILE_NAME -ArgumentList $env:NVIDA_INSTALL_ARGS -Wait -NoNewWindow + + - name: 'Setup for Cache Nvidia Driver' + if: steps.cache-nvdia.outputs.cache-hit != 'true' + run: | + mkdir -p "nvidia_toolkit_cache" + xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\" "nvidia_toolkit_cache\" /s /e /y + + - name: Cache Nvidia Driver + id: cache-primes-save + if: steps.cache-nvdia.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: nvidia_toolkit_cache + key: nvidia-toolkit-${{ env.NVIDA_DRIVER_FILE_NAME }} + + - name: 'Restore NVIDIA Toolkit from cache' + if: steps.cache-nvdia.outputs.cache-hit == 'true' + run: | + xcopy "nvidia_toolkit_cache\" "C:\Program Files\NVIDIA GPU Computing Toolkit\" /s /e /y + xcopy "nvidia_toolkit_cache\CUDA\v12.6\extras\visual_studio_integration\MSBuildExtensions\" "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\BuildCustomizations\" /s /e /y + + - shell: bash + name: Add Nvidia to path + run: | + echo "CUDA_PATH=$CUDA_PATH" >> $GITHUB_ENV + echo "CUDA_PATH_V12_6=$CUDA_PATH_V12_6" >> $GITHUB_ENV + echo "CUDA_PATH_VX_Y=$CUDA_PATH_VX_Y" >> $GITHUB_ENV + echo "$CUDA_PATH_BIN" >> $GITHUB_PATH + + - name: 'πŸ—οΈ Configure CMake' + run: | + cmake -B ${{github.workspace}}\build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: 'πŸ› οΈ Build' + run: cmake --build ${{github.workspace}}\build --config ${{env.BUILD_TYPE}} -j 4 + + - name: '⬆️ Upload Exe File' + uses: actions/upload-artifact@v4 + with: + name: binariesArtifact + path: "${{github.workspace}}\\release\\bin\\Release" + + ReleaseArtifact: + name: 'πŸš€ Release Project' + runs-on: ubuntu-latest + needs: BuildForWindows + steps: + - name: '⬇️ Download exe' + uses: actions/download-artifact@v4 + with: + name: binariesArtifact + + - name: 'πŸ“ƒ Output Current Files' + run: ls -R + + - name: '🏷️ Add binaries to Release Tag' + uses: softprops/action-gh-release@v2 + with: + tag_name: Continuous + files: | + hipims-flood.exe + hipims-flood-mgpus.exe + hipims-landslide.exe + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/actionCacheClear.yml b/.github/workflows/actionCacheClear.yml new file mode 100644 index 0000000..12b2d57 --- /dev/null +++ b/.github/workflows/actionCacheClear.yml @@ -0,0 +1,30 @@ +name: Clear cache + +on: + workflow_dispatch: + +permissions: + actions: write + +jobs: + clear-cache: + runs-on: ubuntu-latest + steps: + - name: Clear cache + uses: actions/github-script@v6 + with: + script: | + console.log("About to clear") + const caches = await github.rest.actions.getActionsCacheList({ + owner: context.repo.owner, + repo: context.repo.repo, + }) + for (const cache of caches.data.actions_caches) { + console.log(cache) + github.rest.actions.deleteActionsCacheById({ + owner: context.repo.owner, + repo: context.repo.repo, + cache_id: cache.id, + }) + } + console.log("Clear completed") \ No newline at end of file From 319fe3979c057561290d4de2382d65fb2b93340e Mon Sep 17 00:00:00 2001 From: alaamroue Date: Wed, 6 Nov 2024 22:45:26 +0100 Subject: [PATCH 3/7] Add Ubuntu CI Pipeline --- .github/workflows/CMakeBuildUbuntu.yml | 78 +++++++++++++------------ .github/workflows/CMakeBuildWindows.yml | 6 +- .gitignore | 5 +- debian/DEBIAN/control | 9 +++ 4 files changed, 56 insertions(+), 42 deletions(-) create mode 100644 debian/DEBIAN/control diff --git a/.github/workflows/CMakeBuildUbuntu.yml b/.github/workflows/CMakeBuildUbuntu.yml index 9eefd32..244b145 100644 --- a/.github/workflows/CMakeBuildUbuntu.yml +++ b/.github/workflows/CMakeBuildUbuntu.yml @@ -1,66 +1,68 @@ ο»Ώname: Building For Linux on: - #push: - # branches: - # - master + push: + branches: + - master pull_request: branches: - master env: BUILD_TYPE: Release + packageName: hipims-cuda-amd64.deb jobs: BuildForUbuntu: name: '🐧 Build for Ubuntu' runs-on: ubuntu-latest - env: - NVIDA_DRIVER_URL: "https://developer.download.nvidia.com/compute/cuda/12.6.2/local_installers/cuda-repo-ubuntu2404-12-6-local_12.6.2-560.35.03-1_amd64.deb" - NVIDA_DRIVER_FILE_NAME: "cuda-repo-ubuntu2404-12-6-local_12.6.2-560.35.03-1_amd64.deb" - NVIDA_PIN_URL: "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-ubuntu2404.pin" - NVIDA_PIN_NAME: "cuda-ubuntu2404.pin" - NVIDA_APT_NAME: "cuda-toolkit-12-6" steps: - uses: actions/checkout@v4 with: - submodules: recursive - - - name: 'Cache Nvdia Driver' - id: cache-nvdia - uses: actions/cache@v4 - with: - path: ${{ env.NVIDA_DRIVER_FILE_NAME }} - key: ${{ runner.os }}-${{ env.NVIDA_DRIVER_FILE_NAME }} - - - name: Download Nvdia driver - if: steps.cache-nvdia.outputs.cache-hit != 'true' - run: wget ${{ env.NVIDA_DRIVER_URL }} + fetch-depth: 1 + + - name: 'Get Nvdia Driver Cache' + uses: Jimver/cuda-toolkit@v0.2.18 + id: cuda-toolkit - - name: 'πŸ”§ Install Nvidia Driver' - run: | - wget ${{ env.NVIDA_PIN_URL }} - sudo mv ${{ env.NVIDA_PIN_NAME }} /etc/apt/preferences.d/cuda-repository-pin-600 - sudo dpkg -i ${{ env.NVIDA_DRIVER_FILE_NAME }} - sudo cp /var/cuda-repo-*-local/cuda-*-keyring.gpg /usr/share/keyrings/ - sudo apt-get update - sudo apt-get -y install ${{ env.NVIDA_APT_NAME }} - - name: 'πŸ—οΈ Configure CMake' run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - name: 'πŸ› οΈ Build' run: | cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 - - - name: 'πŸ“ƒ Output Current Files' - run: ls -R - - - name: '🧩 Install dependencies' + + - name: Set up Debian Package + run: | + mkdir -p debian/usr/local/bin + cp release/bin/* debian/usr/local/bin/ + + - name: Build Debian Package run: | - sudo apt-get update + dpkg-deb --build debian ${{env.packageName}} - - name: 'πŸ“ƒ Output Current Files' - run: ls -R + - name: '⬆️ Upload deb package' + uses: actions/upload-artifact@v4 + with: + name: debArtifact + path: "${{github.workspace}}/${{env.packageName}}" + ReleaseArtifact: + name: 'πŸš€ Release Project' + runs-on: ubuntu-latest + needs: BuildForUbuntu + steps: + - name: '⬇️ Download deb' + uses: actions/download-artifact@v4 + with: + name: debArtifact + + - name: '🏷️ Add binaries to Release Tag' + uses: softprops/action-gh-release@v2 + with: + tag_name: Continuous + files: | + ${{env.packageName}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/CMakeBuildWindows.yml b/.github/workflows/CMakeBuildWindows.yml index 8a4ad01..b57d7ca 100644 --- a/.github/workflows/CMakeBuildWindows.yml +++ b/.github/workflows/CMakeBuildWindows.yml @@ -1,9 +1,9 @@ name: Building For Windows on: - push: - branches: - - master + #push: + # branches: + # - master pull_request: branches: - master diff --git a/.gitignore b/.gitignore index f3d6549..bfb1e64 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -/build/ \ No newline at end of file +/build/ +/release/ +/debian/usr/ +*.deb \ No newline at end of file diff --git a/debian/DEBIAN/control b/debian/DEBIAN/control new file mode 100644 index 0000000..db0d443 --- /dev/null +++ b/debian/DEBIAN/control @@ -0,0 +1,9 @@ +Package: my-cpp-project +Version: 1.0 +Section: utils +Priority: optional +Architecture: amd64 +Depends: libc6 (>= 2.30) +Maintainer: Your Name +Description: A simple C++ project that prints "Hello, World!" to the console. + This is a simple demonstration project for packaging C++ code into a .deb package. From f4d2825d55c07b4d9db1a05ebfa66e3c298a1c88 Mon Sep 17 00:00:00 2001 From: alaamroue Date: Fri, 8 Nov 2024 00:34:31 +0100 Subject: [PATCH 4/7] Clean pipeline --- .github/workflows/CMakeBuildUbuntu.yml | 22 +++++++------- .github/workflows/CMakeBuildWindows.yml | 39 ++++++++++++------------- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/.github/workflows/CMakeBuildUbuntu.yml b/.github/workflows/CMakeBuildUbuntu.yml index 244b145..2fe372a 100644 --- a/.github/workflows/CMakeBuildUbuntu.yml +++ b/.github/workflows/CMakeBuildUbuntu.yml @@ -1,4 +1,4 @@ -ο»Ώname: Building For Linux +ο»Ώname: Building For Ubuntu 🐧 on: push: @@ -14,7 +14,7 @@ env: jobs: BuildForUbuntu: - name: '🐧 Build for Ubuntu' + name: 🐧 Build for Ubuntu runs-on: ubuntu-latest steps: @@ -22,43 +22,43 @@ jobs: with: fetch-depth: 1 - - name: 'Get Nvdia Driver Cache' + - name: ♻️ Get Nvdia Driver Cache uses: Jimver/cuda-toolkit@v0.2.18 id: cuda-toolkit - - name: 'πŸ—οΈ Configure CMake' + - name: πŸ—οΈ Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - name: 'πŸ› οΈ Build' + - name: πŸ› οΈ Build run: | cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 - - name: Set up Debian Package + - name: πŸ—„οΈ Set up Debian Package run: | mkdir -p debian/usr/local/bin cp release/bin/* debian/usr/local/bin/ - - name: Build Debian Package + - name: πŸ”¨ Build Debian Package run: | dpkg-deb --build debian ${{env.packageName}} - - name: '⬆️ Upload deb package' + - name: ⬆️ Upload deb package uses: actions/upload-artifact@v4 with: name: debArtifact path: "${{github.workspace}}/${{env.packageName}}" ReleaseArtifact: - name: 'πŸš€ Release Project' + name: πŸš€ Release Project runs-on: ubuntu-latest needs: BuildForUbuntu steps: - - name: '⬇️ Download deb' + - name: ⬇️ Download deb uses: actions/download-artifact@v4 with: name: debArtifact - - name: '🏷️ Add binaries to Release Tag' + - name: πŸ“¦ Add binaries to Release Tag uses: softprops/action-gh-release@v2 with: tag_name: Continuous diff --git a/.github/workflows/CMakeBuildWindows.yml b/.github/workflows/CMakeBuildWindows.yml index b57d7ca..7899a9a 100644 --- a/.github/workflows/CMakeBuildWindows.yml +++ b/.github/workflows/CMakeBuildWindows.yml @@ -1,9 +1,9 @@ -name: Building For Windows +name: Building For Windows πŸͺŸ on: - #push: - # branches: - # - master + push: + branches: + - master pull_request: branches: - master @@ -13,7 +13,7 @@ env: jobs: BuildForWindows: - name: 'πŸͺŸ Build for Windows' + name: πŸͺŸ Build for Windows runs-on: windows-latest env: CUDA_PATH: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6" @@ -30,29 +30,29 @@ jobs: with: fetch-depth: 1 - - name: 'Get Nvdia Driver Cache' + - name: ♻️ Get Nvdia Driver Cache id: cache-nvdia uses: actions/cache@v4 with: path: nvidia_toolkit_cache key: nvidia-toolkit-${{ env.NVIDA_DRIVER_FILE_NAME }} - - name: Download Nvidia Driver + - name: ⬇️ Download Nvidia Driver if: steps.cache-nvdia.outputs.cache-hit != 'true' run: Invoke-WebRequest -Uri $env:NVIDA_DRIVER_URL -OutFile $env:NVIDA_DRIVER_FILE_NAME - - name: '🧰 Install Nvidia Driver' + - name: βš™οΈ Install Nvidia Driver if: steps.cache-nvdia.outputs.cache-hit != 'true' run: | Start-Process -FilePath $env:NVIDA_DRIVER_FILE_NAME -ArgumentList $env:NVIDA_INSTALL_ARGS -Wait -NoNewWindow - - name: 'Setup for Cache Nvidia Driver' + - name: πŸ—„οΈSetup for Cache Nvidia Driver if: steps.cache-nvdia.outputs.cache-hit != 'true' run: | mkdir -p "nvidia_toolkit_cache" xcopy "C:\Program Files\NVIDIA GPU Computing Toolkit\" "nvidia_toolkit_cache\" /s /e /y - - name: Cache Nvidia Driver + - name: πŸ’Ύ Cache Nvidia Driver id: cache-primes-save if: steps.cache-nvdia.outputs.cache-hit != 'true' uses: actions/cache/save@v4 @@ -60,47 +60,44 @@ jobs: path: nvidia_toolkit_cache key: nvidia-toolkit-${{ env.NVIDA_DRIVER_FILE_NAME }} - - name: 'Restore NVIDIA Toolkit from cache' + - name: πŸ”„ Restore NVIDIA Toolkit from cache if: steps.cache-nvdia.outputs.cache-hit == 'true' run: | xcopy "nvidia_toolkit_cache\" "C:\Program Files\NVIDIA GPU Computing Toolkit\" /s /e /y xcopy "nvidia_toolkit_cache\CUDA\v12.6\extras\visual_studio_integration\MSBuildExtensions\" "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\BuildCustomizations\" /s /e /y - shell: bash - name: Add Nvidia to path + name: πŸ› οΈ Add Nvidia to path run: | echo "CUDA_PATH=$CUDA_PATH" >> $GITHUB_ENV echo "CUDA_PATH_V12_6=$CUDA_PATH_V12_6" >> $GITHUB_ENV echo "CUDA_PATH_VX_Y=$CUDA_PATH_VX_Y" >> $GITHUB_ENV echo "$CUDA_PATH_BIN" >> $GITHUB_PATH - - name: 'πŸ—οΈ Configure CMake' + - name: πŸ—οΈ Configure CMake run: | cmake -B ${{github.workspace}}\build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - name: 'πŸ› οΈ Build' + - name: πŸ› οΈ Build run: cmake --build ${{github.workspace}}\build --config ${{env.BUILD_TYPE}} -j 4 - - name: '⬆️ Upload Exe File' + - name: ⬆️ Upload Exe File uses: actions/upload-artifact@v4 with: name: binariesArtifact path: "${{github.workspace}}\\release\\bin\\Release" ReleaseArtifact: - name: 'πŸš€ Release Project' + name: πŸš€ Release Project runs-on: ubuntu-latest needs: BuildForWindows steps: - - name: '⬇️ Download exe' + - name: ⬇️ Download exe uses: actions/download-artifact@v4 with: name: binariesArtifact - - - name: 'πŸ“ƒ Output Current Files' - run: ls -R - - name: '🏷️ Add binaries to Release Tag' + - name: πŸ“¦ Add binaries to Release Tag uses: softprops/action-gh-release@v2 with: tag_name: Continuous From ec9728676f5762096941cf0cc2147f0d26332076 Mon Sep 17 00:00:00 2001 From: alaamroue Date: Fri, 8 Nov 2024 00:54:06 +0100 Subject: [PATCH 5/7] Update cmake --- CMakeLists.txt | 2 +- apps/cudaFloodSolver/CMakeLists.txt | 2 +- apps/cudaIntegratedShallowFlowSolver/CMakeLists.txt | 2 +- apps/cudaMultiGPUsFloodSolver/CMakeLists.txt | 2 +- lib/CMakeLists.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7567787..d030b22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) project(HiPIMs LANGUAGES CXX CUDA) diff --git a/apps/cudaFloodSolver/CMakeLists.txt b/apps/cudaFloodSolver/CMakeLists.txt index 8fbaa21..db3869b 100644 --- a/apps/cudaFloodSolver/CMakeLists.txt +++ b/apps/cudaFloodSolver/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) set(EXE hipims-flood) set(SRCS cuda_flood_solver.cu) diff --git a/apps/cudaIntegratedShallowFlowSolver/CMakeLists.txt b/apps/cudaIntegratedShallowFlowSolver/CMakeLists.txt index a264da0..8030db3 100755 --- a/apps/cudaIntegratedShallowFlowSolver/CMakeLists.txt +++ b/apps/cudaIntegratedShallowFlowSolver/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) set(EXE hipims-landslide) set(SRCS cuda_integrated_shallow_flow_solver.cu) diff --git a/apps/cudaMultiGPUsFloodSolver/CMakeLists.txt b/apps/cudaMultiGPUsFloodSolver/CMakeLists.txt index 30df868..0c3e52d 100644 --- a/apps/cudaMultiGPUsFloodSolver/CMakeLists.txt +++ b/apps/cudaMultiGPUsFloodSolver/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) set(EXE hipims-flood-mgpus) set(SRCS cuda_mgpus_flood_solver.cu) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index c343c89..3e6eb3e 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) # nvcc flags From 19af72303cb1201660bd96ae4c6a615497965a9d Mon Sep 17 00:00:00 2001 From: alaamroue Date: Fri, 8 Nov 2024 00:54:17 +0100 Subject: [PATCH 6/7] simpler ubuntu pipeline --- .github/workflows/CMakeBuildUbuntu.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/CMakeBuildUbuntu.yml b/.github/workflows/CMakeBuildUbuntu.yml index 2fe372a..f7ba2a3 100644 --- a/.github/workflows/CMakeBuildUbuntu.yml +++ b/.github/workflows/CMakeBuildUbuntu.yml @@ -25,6 +25,9 @@ jobs: - name: ♻️ Get Nvdia Driver Cache uses: Jimver/cuda-toolkit@v0.2.18 id: cuda-toolkit + with: + method: network + sub-packages: '["nvcc"]' - name: πŸ—οΈ Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} From 66501d565f9282c64aa078bf2ca4092f114cade3 Mon Sep 17 00:00:00 2001 From: alaamroue Date: Sat, 9 Nov 2024 00:08:56 +0100 Subject: [PATCH 7/7] Update deb control --- debian/DEBIAN/control | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/debian/DEBIAN/control b/debian/DEBIAN/control index db0d443..69b42aa 100644 --- a/debian/DEBIAN/control +++ b/debian/DEBIAN/control @@ -1,9 +1,16 @@ -Package: my-cpp-project +Package: hipims-cuda Version: 1.0 Section: utils Priority: optional Architecture: amd64 Depends: libc6 (>= 2.30) -Maintainer: Your Name -Description: A simple C++ project that prints "Hello, World!" to the console. - This is a simple demonstration project for packaging C++ code into a .deb package. +Maintainer: HIPIMS +Description: HiPIMS is a high-performance GPU-based flood simulation system. + HiPIMS standards for High-Performance Integrated hydrodynamic Modelling System. + It uses state-of-art numerical schemes (Godunov-type finite volume) to solve the + 2D shallow water equations for flood simulations. To support high-resolution flood + simulations, HiPIMS is implemented on multiple GPUs (Graphics Processing Units) + using CUDA/C++ languages to achieve high-performance computing. Since HiPIMS has + a modular and flexible structure, it has great potential to be further developed + for other applications in hydrological science as long as the problem can be solved + on a uniform rectangular grid.