Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions EESSI-extend-easybuild.eb
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ sysroot = os.getenv("EESSI_EPREFIX")
-- Check if we have GPU capabilities and configure CUDA compute capabilities
eessi_accelerator_target = os.getenv("EESSI_ACCELERATOR_TARGET")
if (eessi_accelerator_target ~= nil) then
cuda_compute_capability = string.match(eessi_accelerator_target, "^accel/nvidia/cc([0-9][0-9])$")
cuda_compute_capability = string.match(eessi_accelerator_target, "^accel/nvidia/cc([0-9]+)$")
if (cuda_compute_capability ~= nil) then
easybuild_cuda_compute_capabilities = cuda_compute_capability:sub(1, 1) .. "." .. cuda_compute_capability:sub(2, 2)
-- The last digit should be the minor version, insert a dot in the one-but-last position
major_version = cuda_compute_capability:sub(1, #cuda_compute_capability - 1)
minor_version = cuda_compute_capability:sub(#cuda_compute_capability)
easybuild_cuda_compute_capabilities = string.format("%s.%s", major_version, minor_version)
else
LmodError("Incorrect value for $EESSI_ACCELERATOR_TARGET: " .. eessi_accelerator_target)
end
Expand Down
4 changes: 2 additions & 2 deletions init/eessi_archdetect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ 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][0-9]$ ]]; then
if [[ "$EESSI_ACCELERATOR_TARGET_OVERRIDE" =~ ^accel/nvidia/cc[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'"
log "ERROR" "Value of \$EESSI_ACCELERATOR_TARGET_OVERRIDE should match 'accel/nvidia/cc[0-9]+', but it does not: '$EESSI_ACCELERATOR_TARGET_OVERRIDE'"
fi
return 0
fi
Expand Down