From dde3fcb5e6256b4bfb840835cb634db71b752467 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 22 Apr 2026 15:29:13 +0200 Subject: [PATCH] Allow to override AMD GPU accelerator architectures --- init/eessi_archdetect.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index a6716e21..f8534b09 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -179,13 +179,14 @@ accelpath() { # If EESSI_ACCELERATOR_TARGET_OVERRIDE is set, use it log "DEBUG" "accelpath: Override variable set as '$EESSI_ACCELERATOR_TARGET_OVERRIDE' " if [ ! -z $EESSI_ACCELERATOR_TARGET_OVERRIDE ]; then - if [[ "$EESSI_ACCELERATOR_TARGET_OVERRIDE" =~ ^accel/nvidia/cc[0-9]+$ ]]; then - echo ${EESSI_ACCELERATOR_TARGET_OVERRIDE} + # Regex that allows both NVIDIA and AMD overrides + if [[ "$EESSI_ACCELERATOR_TARGET_OVERRIDE" =~ ^accel/(nvidia/cc[0-9]+|amd/gfx[0-9a-f]+)$ ]]; then + echo "$EESSI_ACCELERATOR_TARGET_OVERRIDE" return 0 else - log "ERROR" "Value of \$EESSI_ACCELERATOR_TARGET_OVERRIDE should match 'accel/nvidia/cc[0-9]+', but it does not: '$EESSI_ACCELERATOR_TARGET_OVERRIDE'" + 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'" + return 1 fi - return 0 fi # check for NVIDIA GPUs via nvidia-smi command