Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always set $LMOD_RC (even when EESSI_BASIC_ENV is set), and make sure loading CUDA apps always work when building #475

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions eessi_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,12 @@ if [[ ${SETUP_NVIDIA} -eq 1 ]]; then
mkdir -p ${EESSI_USR_LOCAL_CUDA}
BIND_PATHS="${BIND_PATHS},${EESSI_VAR_LOG}:/var/log,${EESSI_USR_LOCAL_CUDA}:/usr/local/cuda"
[[ ${VERBOSE} -eq 1 ]] && echo "BIND_PATHS=${BIND_PATHS}"
if [[ "${NVIDIA_MODE}" == "install" ]] ; then
# We need to "trick" our LMOD_RC file to allow us to load CUDA modules even without a CUDA driver
# (this works because we build within a container and the LMOD_RC recognises that)
touch ${EESSI_TMPDIR}/libcuda.so
export SINGULARITY_CONTAINLIBS="${EESSI_TMPDIR}/libcuda.so"
fi
fi
fi

Expand Down
16 changes: 9 additions & 7 deletions init/eessi_environment_variables
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ if [ -d $EESSI_PREFIX ]; then

show_msg "Using ${EESSI_SOFTWARE_SUBDIR} as software subdirectory."
export EESSI_SOFTWARE_PATH=$EESSI_PREFIX/software/$EESSI_OS_TYPE/$EESSI_SOFTWARE_SUBDIR

# Configure our LMOD_RC file
export LMOD_RC="$EESSI_SOFTWARE_PATH/.lmod/lmodrc.lua"
if [ -f $LMOD_RC ]; then
show_msg "Found Lmod configuration file at $LMOD_RC"
else
error "Lmod configuration file not found at $LMOD_RC"
fi

if [ ! -z $EESSI_BASIC_ENV ]; then
show_msg "Only setting up basic environment, so we're done"
elif [ -d $EESSI_SOFTWARE_PATH ]; then
Expand All @@ -76,13 +85,6 @@ if [ -d $EESSI_PREFIX ]; then
false
fi

export LMOD_RC="$EESSI_SOFTWARE_PATH/.lmod/lmodrc.lua"
if [ -f $LMOD_RC ]; then
show_msg "Found Lmod configuration file at $LMOD_RC"
else
error "Lmod configuration file not found at $LMOD_RC"
fi

else
error "EESSI software layer at $EESSI_SOFTWARE_PATH not found!"
fi
Expand Down