diff --git a/.github/workflows/eamxx-sa-coverage.yml b/.github/workflows/eamxx-sa-coverage.yml index aa69d6263e6..ec0bf7bdb20 100644 --- a/.github/workflows/eamxx-sa-coverage.yml +++ b/.github/workflows/eamxx-sa-coverage.yml @@ -48,6 +48,38 @@ jobs: submodules: recursive - name: Show action trigger uses: ./.github/actions/show-workflow-trigger + - name: Get CUDA Arch + run: | + # Ensure nvidia-smi is available + if ! command -v nvidia-smi &> /dev/null; then + echo "nvidia-smi could not be found. Please ensure you have Nvidia drivers installed." + exit 1 + fi + + # Get the GPU model from nvidia-smi + gpu_model=$(nvidia-smi --query-gpu=name --format=csv,noheader | head -n 1) + case "$gpu_model" in + *"H100"*) + Hopper=ON + ARCH=89 + ;; + *"A100"*) + Amper=ON + ARCH=80 + ;; + *"V100"*) + Volta=ON + ARCH=70 + ;; + *) + echo "Unsupported GPU model: $gpu_model" + exit 1 + ;; + esac + + # Set the output variables for the next step + echo "KOKKOS_ARCH=${KOKKOS_ARCH}" >> $GITHUB_ENV + echo "CMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES}" >> $GITHUB_ENV - name: Run tests uses: ./.github/actions/test-all-scream with: @@ -55,4 +87,4 @@ jobs: machine: ghci-snl-cuda generate: false submit: ${{ env.submit }} - cmake-configs: Kokkos_ARCH_VOLTA70=ON;CMAKE_CUDA_ARCHITECTURES=70 + cmake-configs: Kokkos_ARCH_HOPPER89=${{ env.Hopper }};Kokkos_ARCH_AMPERE80=${{ env.Ampere }};Kokkos_ARCH_VOLTA70=${{ env.Volta }};CMAKE_CUDA_ARCHITECTURES=${{ env.ARCH }} diff --git a/.github/workflows/eamxx-sa-sanitizer.yml b/.github/workflows/eamxx-sa-sanitizer.yml index 7e3a1a49fcf..4544506b095 100644 --- a/.github/workflows/eamxx-sa-sanitizer.yml +++ b/.github/workflows/eamxx-sa-sanitizer.yml @@ -52,6 +52,38 @@ jobs: submodules: recursive - name: Show action trigger uses: ./.github/actions/show-workflow-trigger + - name: Get CUDA Arch + run: | + # Ensure nvidia-smi is available + if ! command -v nvidia-smi &> /dev/null; then + echo "nvidia-smi could not be found. Please ensure you have Nvidia drivers installed." + exit 1 + fi + + # Get the GPU model from nvidia-smi + gpu_model=$(nvidia-smi --query-gpu=name --format=csv,noheader | head -n 1) + case "$gpu_model" in + *"H100"*) + Hopper=ON + ARCH=89 + ;; + *"A100"*) + Amper=ON + ARCH=80 + ;; + *"V100"*) + Volta=ON + ARCH=70 + ;; + *) + echo "Unsupported GPU model: $gpu_model" + exit 1 + ;; + esac + + # Set the output variables for the next step + echo "KOKKOS_ARCH=${KOKKOS_ARCH}" >> $GITHUB_ENV + echo "CMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES}" >> $GITHUB_ENV - name: Run tests uses: ./.github/actions/test-all-scream with: @@ -59,4 +91,4 @@ jobs: machine: ghci-snl-cuda generate: false submit: ${{ env.submit }} - cmake-configs: Kokkos_ARCH_VOLTA70=ON;CMAKE_CUDA_ARCHITECTURES=70 + cmake-configs: Kokkos_ARCH_HOPPER89=${{ env.Hopper }};Kokkos_ARCH_AMPERE80=${{ env.Ampere }};Kokkos_ARCH_VOLTA70=${{ env.Volta }};CMAKE_CUDA_ARCHITECTURES=${{ env.ARCH }} diff --git a/.github/workflows/eamxx-sa-testing.yml b/.github/workflows/eamxx-sa-testing.yml index baa1508ea6c..8c9056a0238 100644 --- a/.github/workflows/eamxx-sa-testing.yml +++ b/.github/workflows/eamxx-sa-testing.yml @@ -172,6 +172,38 @@ jobs: echo "generate=true" >> $GITHUB_ENV fi fi + - name: Get CUDA Arch + run: | + # Ensure nvidia-smi is available + if ! command -v nvidia-smi &> /dev/null; then + echo "nvidia-smi could not be found. Please ensure you have Nvidia drivers installed." + exit 1 + fi + + # Get the GPU model from nvidia-smi + gpu_model=$(nvidia-smi --query-gpu=name --format=csv,noheader | head -n 1) + case "$gpu_model" in + *"H100"*) + Hopper=ON + ARCH=89 + ;; + *"A100"*) + Amper=ON + ARCH=80 + ;; + *"V100"*) + Volta=ON + ARCH=70 + ;; + *) + echo "Unsupported GPU model: $gpu_model" + exit 1 + ;; + esac + + # Set the output variables for the next step + echo "KOKKOS_ARCH=${KOKKOS_ARCH}" >> $GITHUB_ENV + echo "CMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES}" >> $GITHUB_ENV - name: Run tests uses: ./.github/actions/test-all-scream with: @@ -179,4 +211,4 @@ jobs: machine: ghci-snl-cuda generate: ${{ env.generate }} submit: ${{ env.submit }} - cmake-configs: Kokkos_ARCH_VOLTA70=ON;CMAKE_CUDA_ARCHITECTURES=70 + cmake-configs: Kokkos_ARCH_HOPPER89=${{ env.Hopper }};Kokkos_ARCH_AMPERE80=${{ env.Ampere }};Kokkos_ARCH_VOLTA70=${{ env.Volta }};CMAKE_CUDA_ARCHITECTURES=${{ env.ARCH }}