Skip to content

Commit

Permalink
Workflows: get Cuda arch from nvidia-smi in eamxx-sa-XYZ.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bartgol committed Nov 15, 2024
1 parent 2354936 commit 74dfb81
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 3 deletions.
34 changes: 33 additions & 1 deletion .github/workflows/eamxx-sa-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,43 @@ 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:
build_type: cov
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 }}
34 changes: 33 additions & 1 deletion .github/workflows/eamxx-sa-sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,43 @@ 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:
build_type: ${{ matrix.build_type }}
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 }}
34 changes: 33 additions & 1 deletion .github/workflows/eamxx-sa-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,43 @@ 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:
build_type: ${{ matrix.build_type }}
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 }}

0 comments on commit 74dfb81

Please sign in to comment.