Skip to content

Commit dde3fcb

Browse files
author
Caspar van Leeuwen
committed
Allow to override AMD GPU accelerator architectures
1 parent 9950110 commit dde3fcb

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

init/eessi_archdetect.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,14 @@ accelpath() {
179179
# If EESSI_ACCELERATOR_TARGET_OVERRIDE is set, use it
180180
log "DEBUG" "accelpath: Override variable set as '$EESSI_ACCELERATOR_TARGET_OVERRIDE' "
181181
if [ ! -z $EESSI_ACCELERATOR_TARGET_OVERRIDE ]; then
182-
if [[ "$EESSI_ACCELERATOR_TARGET_OVERRIDE" =~ ^accel/nvidia/cc[0-9]+$ ]]; then
183-
echo ${EESSI_ACCELERATOR_TARGET_OVERRIDE}
182+
# Regex that allows both NVIDIA and AMD overrides
183+
if [[ "$EESSI_ACCELERATOR_TARGET_OVERRIDE" =~ ^accel/(nvidia/cc[0-9]+|amd/gfx[0-9a-f]+)$ ]]; then
184+
echo "$EESSI_ACCELERATOR_TARGET_OVERRIDE"
184185
return 0
185186
else
186-
log "ERROR" "Value of \$EESSI_ACCELERATOR_TARGET_OVERRIDE should match 'accel/nvidia/cc[0-9]+', but it does not: '$EESSI_ACCELERATOR_TARGET_OVERRIDE'"
187+
log "ERROR" "Value of \$EESSI_ACCELERATOR_TARGET_OVERRIDE should match 'accel/nvidia/cc[0-9]+' or 'accel/amd/gfx[0-9a-f]+', but it does not: '$EESSI_ACCELERATOR_TARGET_OVERRIDE'"
188+
return 1
187189
fi
188-
return 0
189190
fi
190191

191192
# check for NVIDIA GPUs via nvidia-smi command

0 commit comments

Comments
 (0)