Skip to content

Commit

Permalink
sanity check value of $EESSI_ACCELERATOR_TARGET_OVERRIDE, if it is se…
Browse files Browse the repository at this point in the history
…t, must be 'accel/nvidia/cc[0-9][0-9]'
  • Loading branch information
boegel committed Oct 3, 2024
1 parent 228eaa2 commit f823375
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion init/eessi_archdetect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,15 @@ cpupath(){
accelpath() {
# If EESSI_ACCELERATOR_TARGET_OVERRIDE is set, use it
log "DEBUG" "accelpath: Override variable set as '$EESSI_ACCELERATOR_TARGET_OVERRIDE' "
[ $EESSI_ACCELERATOR_TARGET_OVERRIDE ] && echo ${EESSI_ACCELERATOR_TARGET_OVERRIDE} && exit
if [ ! -z $EESSI_ACCELERATOR_TARGET_OVERRIDE ]; then
if [[ "$EESSI_ACCELERATOR_TARGET_OVERRIDE" =~ ^accel/nvidia/cc[0-9][0-9]$ ]]; then
echo ${EESSI_ACCELERATOR_TARGET_OVERRIDE}
return 0
else
log "ERROR" "Value of \$EESSI_ACCELERATOR_TARGET_OVERRIDE should match 'accel/nvidia/cc[0-9[0-9]', but it does not: '$EESSI_ACCELERATOR_TARGET_OVERRIDE'"
fi
return 0
fi

# check for NVIDIA GPUs via nvidia-smi command
nvidia_smi=$(command -v nvidia-smi)
Expand Down

0 comments on commit f823375

Please sign in to comment.