Skip to content

Commit e4bcb4d

Browse files
committed
Isolate ROCm entries within shared Spack config
1 parent 5fa639e commit e4bcb4d

2 files changed

Lines changed: 157 additions & 141 deletions

File tree

docker/spack.yaml

Lines changed: 148 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,17 @@ spack:
9090
when: '%fortran'
9191
- spec: '%openmpi@4.1.2 %gcc@13.3.0'
9292
when: '%mpi'
93-
amdclang-19:
94-
- spec: '%c=llvm-amdgpu@6.4.3'
95-
when: '%c'
96-
- spec: '%cxx=llvm-amdgpu@6.4.3'
97-
when: '%cxx'
98-
- spec: '%fortran=gcc@13.3.0'
99-
when: '%fortran'
100-
- spec: '%openmpi@4.1.2 %llvm-amdgpu@6.4.3'
101-
when: '%mpi'
93+
# ROCM_TOOLCHAIN_BEGIN
94+
# amdclang-19:
95+
# - spec: '%c=llvm-amdgpu@6.4.3'
96+
# when: '%c'
97+
# - spec: '%cxx=llvm-amdgpu@6.4.3'
98+
# when: '%cxx'
99+
# - spec: '%fortran=gcc@13.3.0'
100+
# when: '%fortran'
101+
# - spec: '%openmpi@4.1.2 %llvm-amdgpu@6.4.3'
102+
# when: '%mpi'
103+
# ROCM_TOOLCHAIN_END
102104

103105
packages:
104106
all:
@@ -131,15 +133,17 @@ spack:
131133
compilers:
132134
c: /usr/bin/clang-15
133135
cxx: /usr/bin/clang++-15
134-
llvm-amdgpu:
135-
buildable: false
136-
externals:
137-
- spec: llvm-amdgpu@6.4.3
138-
prefix: /opt/rocm-6.4.3/lib/llvm
139-
extra_attributes:
140-
compilers:
141-
c: /usr/bin/amdclang
142-
cxx: /usr/bin/amdclang++
136+
# ROCM_LLVM_BEGIN
137+
# llvm-amdgpu:
138+
# buildable: false
139+
# externals:
140+
# - spec: llvm-amdgpu@6.4.3
141+
# prefix: /opt/rocm-6.4.3/lib/llvm
142+
# extra_attributes:
143+
# compilers:
144+
# c: /usr/bin/amdclang
145+
# cxx: /usr/bin/amdclang++
146+
# ROCM_LLVM_END
143147
gcc:
144148
externals:
145149
- spec: gcc@9.4.0 languages:='c,c++,fortran'
@@ -183,126 +187,128 @@ spack:
183187
externals:
184188
- spec: cuda@11.8.0 +allow-unsupported-compilers
185189
prefix: /usr/local/cuda
186-
hip:
187-
buildable: false
188-
externals:
189-
- spec: hip@6.4.3
190-
prefix: /opt/rocm-6.4.3
191-
require:
192-
- when: "%llvm-amdgpu@6.4.3"
193-
spec: "@6.4.3"
194-
rocprim:
195-
buildable: false
196-
externals:
197-
- spec: rocprim@6.4.3
198-
prefix: /opt/rocm-6.4.3
199-
require:
200-
- when: "%llvm-amdgpu@6.4.3"
201-
spec: "@6.4.3"
202-
rocsparse:
203-
buildable: false
204-
externals:
205-
- spec: rocsparse@6.4.3
206-
prefix: /opt/rocm-6.4.3
207-
require:
208-
- when: "%llvm-amdgpu@6.4.3"
209-
spec: "@6.4.3"
210-
roctracer:
211-
buildable: false
212-
externals:
213-
- spec: roctracer@6.4.3
214-
prefix: /opt/rocm-6.4.3
215-
require:
216-
- when: "%llvm-amdgpu@6.4.3"
217-
spec: "@6.4.3"
218-
rocblas:
219-
buildable: false
220-
externals:
221-
- spec: rocblas@6.4.3
222-
prefix: /opt/rocm-6.4.3
223-
require:
224-
- when: "%llvm-amdgpu@6.4.3"
225-
spec: "@6.4.3"
226-
rocrand:
227-
buildable: false
228-
externals:
229-
- spec: rocrand@6.4.3
230-
prefix: /opt/rocm-6.4.3
231-
require:
232-
- when: "%llvm-amdgpu@6.4.3"
233-
spec: "@6.4.3"
234-
rocsolver:
235-
buildable: false
236-
externals:
237-
- spec: rocsolver@6.4.3
238-
prefix: /opt/rocm-6.4.3
239-
require:
240-
- when: "%llvm-amdgpu@6.4.3"
241-
spec: "@6.4.3"
242-
rocthrust:
243-
buildable: false
244-
externals:
245-
- spec: rocthrust@6.4.3
246-
prefix: /opt/rocm-6.4.3
247-
require:
248-
- when: "%llvm-amdgpu@6.4.3"
249-
spec: "@6.4.3"
250-
hipblas:
251-
buildable: false
252-
externals:
253-
- spec: hipblas@6.4.3 +rocm
254-
prefix: /opt/rocm-6.4.3
255-
require:
256-
- when: "%llvm-amdgpu@6.4.3"
257-
spec: "@6.4.3"
258-
hipsparse:
259-
buildable: false
260-
externals:
261-
- spec: hipsparse@6.4.3 +rocm
262-
prefix: /opt/rocm-6.4.3
263-
require:
264-
- when: "%llvm-amdgpu@6.4.3"
265-
spec: "@6.4.3"
266-
hipfft:
267-
buildable: false
268-
externals:
269-
- spec: hipfft@6.4.3 +rocm
270-
prefix: /opt/rocm-6.4.3
271-
require:
272-
- when: "%llvm-amdgpu@6.4.3"
273-
spec: "@6.4.3"
274-
hipsolver:
275-
buildable: false
276-
externals:
277-
- spec: hipsolver@6.4.3 +rocm
278-
prefix: /opt/rocm-6.4.3
279-
require:
280-
- when: "%llvm-amdgpu@6.4.3"
281-
spec: "@6.4.3"
282-
hiprand:
283-
buildable: false
284-
externals:
285-
- spec: hiprand@6.4.3 +rocm
286-
prefix: /opt/rocm-6.4.3
287-
require:
288-
- when: "%llvm-amdgpu@6.4.3"
289-
spec: "@6.4.3"
290-
rocm-device-libs:
291-
buildable: false
292-
externals:
293-
- spec: rocm-device-libs@6.4.3
294-
prefix: /opt/rocm-6.4.3
295-
require:
296-
- when: "%llvm-amdgpu@6.4.3"
297-
spec: "@6.4.3"
298-
hsa-rocr-dev:
299-
buildable: false
300-
externals:
301-
- spec: hsa-rocr-dev@6.4.3
302-
prefix: /opt/rocm-6.4.3
303-
require:
304-
- when: "%llvm-amdgpu@6.4.3"
305-
spec: "@6.4.3"
190+
# ROCM_PACKAGES_BEGIN
191+
# hip:
192+
# buildable: false
193+
# externals:
194+
# - spec: hip@6.4.3
195+
# prefix: /opt/rocm-6.4.3
196+
# require:
197+
# - when: "%llvm-amdgpu@6.4.3"
198+
# spec: "@6.4.3"
199+
# rocprim:
200+
# buildable: false
201+
# externals:
202+
# - spec: rocprim@6.4.3
203+
# prefix: /opt/rocm-6.4.3
204+
# require:
205+
# - when: "%llvm-amdgpu@6.4.3"
206+
# spec: "@6.4.3"
207+
# rocsparse:
208+
# buildable: false
209+
# externals:
210+
# - spec: rocsparse@6.4.3
211+
# prefix: /opt/rocm-6.4.3
212+
# require:
213+
# - when: "%llvm-amdgpu@6.4.3"
214+
# spec: "@6.4.3"
215+
# roctracer:
216+
# buildable: false
217+
# externals:
218+
# - spec: roctracer@6.4.3
219+
# prefix: /opt/rocm-6.4.3
220+
# require:
221+
# - when: "%llvm-amdgpu@6.4.3"
222+
# spec: "@6.4.3"
223+
# rocblas:
224+
# buildable: false
225+
# externals:
226+
# - spec: rocblas@6.4.3
227+
# prefix: /opt/rocm-6.4.3
228+
# require:
229+
# - when: "%llvm-amdgpu@6.4.3"
230+
# spec: "@6.4.3"
231+
# rocrand:
232+
# buildable: false
233+
# externals:
234+
# - spec: rocrand@6.4.3
235+
# prefix: /opt/rocm-6.4.3
236+
# require:
237+
# - when: "%llvm-amdgpu@6.4.3"
238+
# spec: "@6.4.3"
239+
# rocsolver:
240+
# buildable: false
241+
# externals:
242+
# - spec: rocsolver@6.4.3
243+
# prefix: /opt/rocm-6.4.3
244+
# require:
245+
# - when: "%llvm-amdgpu@6.4.3"
246+
# spec: "@6.4.3"
247+
# rocthrust:
248+
# buildable: false
249+
# externals:
250+
# - spec: rocthrust@6.4.3
251+
# prefix: /opt/rocm-6.4.3
252+
# require:
253+
# - when: "%llvm-amdgpu@6.4.3"
254+
# spec: "@6.4.3"
255+
# hipblas:
256+
# buildable: false
257+
# externals:
258+
# - spec: hipblas@6.4.3 +rocm
259+
# prefix: /opt/rocm-6.4.3
260+
# require:
261+
# - when: "%llvm-amdgpu@6.4.3"
262+
# spec: "@6.4.3"
263+
# hipsparse:
264+
# buildable: false
265+
# externals:
266+
# - spec: hipsparse@6.4.3 +rocm
267+
# prefix: /opt/rocm-6.4.3
268+
# require:
269+
# - when: "%llvm-amdgpu@6.4.3"
270+
# spec: "@6.4.3"
271+
# hipfft:
272+
# buildable: false
273+
# externals:
274+
# - spec: hipfft@6.4.3 +rocm
275+
# prefix: /opt/rocm-6.4.3
276+
# require:
277+
# - when: "%llvm-amdgpu@6.4.3"
278+
# spec: "@6.4.3"
279+
# hipsolver:
280+
# buildable: false
281+
# externals:
282+
# - spec: hipsolver@6.4.3 +rocm
283+
# prefix: /opt/rocm-6.4.3
284+
# require:
285+
# - when: "%llvm-amdgpu@6.4.3"
286+
# spec: "@6.4.3"
287+
# hiprand:
288+
# buildable: false
289+
# externals:
290+
# - spec: hiprand@6.4.3 +rocm
291+
# prefix: /opt/rocm-6.4.3
292+
# require:
293+
# - when: "%llvm-amdgpu@6.4.3"
294+
# spec: "@6.4.3"
295+
# rocm-device-libs:
296+
# buildable: false
297+
# externals:
298+
# - spec: rocm-device-libs@6.4.3
299+
# prefix: /opt/rocm-6.4.3
300+
# require:
301+
# - when: "%llvm-amdgpu@6.4.3"
302+
# spec: "@6.4.3"
303+
# hsa-rocr-dev:
304+
# buildable: false
305+
# externals:
306+
# - spec: hsa-rocr-dev@6.4.3
307+
# prefix: /opt/rocm-6.4.3
308+
# require:
309+
# - when: "%llvm-amdgpu@6.4.3"
310+
# spec: "@6.4.3"
311+
# ROCM_PACKAGES_END
306312

307313
# System packages
308314
autoconf:
@@ -358,8 +364,10 @@ spack:
358364
- spec: openmpi@4.1.2 %llvm@15.0.7
359365
prefix: /usr/lib/x86_64-linux-gnu/openmpi
360366
modules: [mpi]
361-
- spec: openmpi@4.1.2 %llvm-amdgpu@6.4.3
362-
prefix: /usr/lib/x86_64-linux-gnu/openmpi
367+
# ROCM_OPENMPI_BEGIN
368+
# - spec: openmpi@4.1.2 %llvm-amdgpu@6.4.3
369+
# prefix: /usr/lib/x86_64-linux-gnu/openmpi
370+
# ROCM_OPENMPI_END
363371
- spec: openmpi@4.1.2 %gcc@9.4.0
364372
prefix: /usr/lib/x86_64-linux-gnu/openmpi
365373
- spec: openmpi@4.1.2 %gcc@10.5.0

docker/tpl-ubuntu-hip.Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,17 @@ RUN apt-get update && \
124124
# --spack-debug to debug build
125125
RUN --mount=src=.,dst=$SRC_DIR,readwrite cd ${SRC_DIR} && \
126126
mkdir -p ${GEOSX_TPL_DIR} && \
127+
sed \
128+
-e '/^ # ROCM_TOOLCHAIN_BEGIN$/,/^ # ROCM_TOOLCHAIN_END$/ s/^\([[:space:]]*\)# /\1/' \
129+
-e '/^ # ROCM_LLVM_BEGIN$/,/^ # ROCM_LLVM_END$/ s/^\([[:space:]]*\)# /\1/' \
130+
-e '/^ # ROCM_PACKAGES_BEGIN$/,/^ # ROCM_PACKAGES_END$/ s/^\([[:space:]]*\)# /\1/' \
131+
-e '/^ # ROCM_OPENMPI_BEGIN$/,/^ # ROCM_OPENMPI_END$/ s/^\([[:space:]]*\)# /\1/' \
132+
${SRC_DIR}/docker/spack.yaml | \
133+
sed '/^[[:space:]]*ROCM_TOOLCHAIN_BEGIN$/d;/^[[:space:]]*ROCM_TOOLCHAIN_END$/d;/^[[:space:]]*ROCM_LLVM_BEGIN$/d;/^[[:space:]]*ROCM_LLVM_END$/d;/^[[:space:]]*ROCM_PACKAGES_BEGIN$/d;/^[[:space:]]*ROCM_PACKAGES_END$/d;/^[[:space:]]*ROCM_OPENMPI_BEGIN$/d;/^[[:space:]]*ROCM_OPENMPI_END$/d' > /tmp/spack-rocm.yaml && \
134+
test -f /tmp/spack-rocm.yaml && \
127135
./scripts/uberenv/uberenv.py \
128136
--spec "+rocm~uncrustify~openmp~pygeosx~trilinos~petsc amdgpu_target=${AMDGPU_TARGET} %amdclang-19 ^caliper~papi~gotcha~sampler~libunwind~libdw" \
129-
--spack-env-file=${SRC_DIR}/docker/spack.yaml \
137+
--spack-env-file=/tmp/spack-rocm.yaml \
130138
--project-json=.uberenv_config.json \
131139
--prefix ${GEOSX_TPL_DIR} \
132140
-k && \

0 commit comments

Comments
 (0)