Skip to content

Commit 93a99aa

Browse files
committed
Workflows: get Cuda arch from nvidia-smi in eamxx-sa-XYZ.yml
1 parent 2354936 commit 93a99aa

File tree

3 files changed

+99
-3
lines changed

3 files changed

+99
-3
lines changed

.github/workflows/eamxx-sa-coverage.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,43 @@ jobs:
4848
submodules: recursive
4949
- name: Show action trigger
5050
uses: ./.github/actions/show-workflow-trigger
51+
- name: Get CUDA Arch
52+
run: |
53+
# Ensure nvidia-smi is available
54+
if ! command -v nvidia-smi &> /dev/null; then
55+
echo "nvidia-smi could not be found. Please ensure you have Nvidia drivers installed."
56+
exit 1
57+
fi
58+
59+
# Get the GPU model from nvidia-smi
60+
gpu_model=$(nvidia-smi --query-gpu=name --format=csv,noheader | head -n 1)
61+
case "$gpu_model" in
62+
*"H100"*)
63+
Hopper=ON
64+
ARCH=90
65+
;;
66+
*"A100"*)
67+
Amper=ON
68+
ARCH=80
69+
;;
70+
*"V100"*)
71+
Volta=ON
72+
ARCH=70
73+
;;
74+
*)
75+
echo "Unsupported GPU model: $gpu_model"
76+
exit 1
77+
;;
78+
esac
79+
80+
# Set the output variables for the next step
81+
echo "KOKKOS_ARCH=${KOKKOS_ARCH}" >> $GITHUB_ENV
82+
echo "CMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES}" >> $GITHUB_ENV
5183
- name: Run tests
5284
uses: ./.github/actions/test-all-scream
5385
with:
5486
build_type: cov
5587
machine: ghci-snl-cuda
5688
generate: false
5789
submit: ${{ env.submit }}
58-
cmake-configs: Kokkos_ARCH_VOLTA70=ON;CMAKE_CUDA_ARCHITECTURES=70
90+
cmake-configs: Kokkos_ARCH_HOPPER90=${{ env.Hopper }};Kokkos_ARCH_AMPERE80=${{ env.Ampere }};Kokkos_ARCH_VOLTA70=${{ env.Volta }};CMAKE_CUDA_ARCHITECTURES=${{ env.ARCH }}

.github/workflows/eamxx-sa-sanitizer.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,43 @@ jobs:
5252
submodules: recursive
5353
- name: Show action trigger
5454
uses: ./.github/actions/show-workflow-trigger
55+
- name: Get CUDA Arch
56+
run: |
57+
# Ensure nvidia-smi is available
58+
if ! command -v nvidia-smi &> /dev/null; then
59+
echo "nvidia-smi could not be found. Please ensure you have Nvidia drivers installed."
60+
exit 1
61+
fi
62+
63+
# Get the GPU model from nvidia-smi
64+
gpu_model=$(nvidia-smi --query-gpu=name --format=csv,noheader | head -n 1)
65+
case "$gpu_model" in
66+
*"H100"*)
67+
Hopper=ON
68+
ARCH=90
69+
;;
70+
*"A100"*)
71+
Amper=ON
72+
ARCH=80
73+
;;
74+
*"V100"*)
75+
Volta=ON
76+
ARCH=70
77+
;;
78+
*)
79+
echo "Unsupported GPU model: $gpu_model"
80+
exit 1
81+
;;
82+
esac
83+
84+
# Set the output variables for the next step
85+
echo "KOKKOS_ARCH=${KOKKOS_ARCH}" >> $GITHUB_ENV
86+
echo "CMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES}" >> $GITHUB_ENV
5587
- name: Run tests
5688
uses: ./.github/actions/test-all-scream
5789
with:
5890
build_type: ${{ matrix.build_type }}
5991
machine: ghci-snl-cuda
6092
generate: false
6193
submit: ${{ env.submit }}
62-
cmake-configs: Kokkos_ARCH_VOLTA70=ON;CMAKE_CUDA_ARCHITECTURES=70
94+
cmake-configs: Kokkos_ARCH_HOPPER90=${{ env.Hopper }};Kokkos_ARCH_AMPERE80=${{ env.Ampere }};Kokkos_ARCH_VOLTA70=${{ env.Volta }};CMAKE_CUDA_ARCHITECTURES=${{ env.ARCH }}

.github/workflows/eamxx-sa-testing.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,43 @@ jobs:
172172
echo "generate=true" >> $GITHUB_ENV
173173
fi
174174
fi
175+
- name: Get CUDA Arch
176+
run: |
177+
# Ensure nvidia-smi is available
178+
if ! command -v nvidia-smi &> /dev/null; then
179+
echo "nvidia-smi could not be found. Please ensure you have Nvidia drivers installed."
180+
exit 1
181+
fi
182+
183+
# Get the GPU model from nvidia-smi
184+
gpu_model=$(nvidia-smi --query-gpu=name --format=csv,noheader | head -n 1)
185+
case "$gpu_model" in
186+
*"H100"*)
187+
Hopper=ON
188+
ARCH=90
189+
;;
190+
*"A100"*)
191+
Amper=ON
192+
ARCH=80
193+
;;
194+
*"V100"*)
195+
Volta=ON
196+
ARCH=70
197+
;;
198+
*)
199+
echo "Unsupported GPU model: $gpu_model"
200+
exit 1
201+
;;
202+
esac
203+
204+
# Set the output variables for the next step
205+
echo "KOKKOS_ARCH=${KOKKOS_ARCH}" >> $GITHUB_ENV
206+
echo "CMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES}" >> $GITHUB_ENV
175207
- name: Run tests
176208
uses: ./.github/actions/test-all-scream
177209
with:
178210
build_type: ${{ matrix.build_type }}
179211
machine: ghci-snl-cuda
180212
generate: ${{ env.generate }}
181213
submit: ${{ env.submit }}
182-
cmake-configs: Kokkos_ARCH_VOLTA70=ON;CMAKE_CUDA_ARCHITECTURES=70
214+
cmake-configs: Kokkos_ARCH_HOPPER90=${{ env.Hopper }};Kokkos_ARCH_AMPERE80=${{ env.Ampere }};Kokkos_ARCH_VOLTA70=${{ env.Volta }};CMAKE_CUDA_ARCHITECTURES=${{ env.ARCH }}

0 commit comments

Comments
 (0)