Skip to content

Commit

Permalink
Merge pull request #1 from ocaisa/cuda_cuda_samples_eessi_io
Browse files Browse the repository at this point in the history
Synch with target branch and correct some errors
  • Loading branch information
casparvl authored Dec 20, 2023
2 parents 46727cb + 039921b commit a4e8de7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
11 changes: 4 additions & 7 deletions EESSI-install-software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,16 @@ pr_diff=$(ls [0-9]*.diff | head -1)

# install any additional required scripts
# order is important: these are needed to install a full CUDA SDK in host_injections
install_scripts_changed=$(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^install_scripts.sh$' > /dev/null; echo $?)
if [ ${install_scripts_changed} == '0' ]; then
# for now, this just reinstalls all scripts. Note the most elegant, but works
${TOPDIR}/install_scripts.sh --prefix ${EESSI_CVMFS_REPO}
fi
# for now, this just reinstalls all scripts. Note the most elegant, but works
${TOPDIR}/install_scripts.sh --prefix ${EESSI_PREFIX}

# Install full CUDA SDK in host_injections
# Hardcode this for now, see if it works
# TODO: We should make a nice yaml and loop over all CUDA versions in that yaml to figure out what to install
${EESSI_CVMFS_REPO}/gpu_support/nvidia/install_cuda_host_injections.sh 12.1.1
${EESSI_PREFIX}/gpu_support/nvidia/install_cuda_host_injections.sh -c 12.1.1 --accept-cuda-eula

# Install drivers in host_injections
${EESSI_CVMFS_REPO}/gpu_support/nvidia/link_nvidia_host_libraries.sh
${EESSI_PREFIX}/gpu_support/nvidia/link_nvidia_host_libraries.sh

# use PR patch file to determine in which easystack files stuff was added
for easystack_file in $(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^easystacks/.*yml$' | egrep -v 'known-issues|missing'); do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ easyconfigs:
- Boost-1.82.0-GCC-12.3.0.eb
- netCDF-4.9.2-gompi-2023a.eb
- FFmpeg-6.0-GCCcore-12.3.0.eb
- CUDA-Samples-12.1-GCC-12.3.0-CUDA-12.1.1.eb

- CUDA-Samples-12.1-GCC-12.3.0-CUDA-12.1.1.eb:
# use easyconfig that only install subset of CUDA samples,
# to circumvent problem with nvcc linking to glibc of host OS;
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/19189
Expand Down
6 changes: 3 additions & 3 deletions gpu_support/nvidia/link_nvidia_host_libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if [ ${#found_paths[@]} -gt 0 ]; then
host_ldconfig=${found_paths[0]}
else
error="$command_name not found in PATH or only found in paths starting with $exclude_prefix."
fatal_error $error
fatal_error "$error"
fi

# Make sure EESSI is initialised (doesn't matter what version)
Expand All @@ -52,7 +52,7 @@ if $nvidia_smi_command > /dev/null; then
host_cuda_version=$(nvidia-smi -q --display=COMPUTE | grep CUDA | awk 'NF>1{print $NF}')
else
error="Failed to successfully execute\n $nvidia_smi_command\n"
fatal_error $error
fatal_error "$error"
fi

# Let's make sure the driver libraries are not already in place
Expand All @@ -71,7 +71,7 @@ if [ -e "$host_injection_driver_version_file" ]; then
rm $host_injection_driver_dir/*
if [ $? -ne 0 ]; then
error="Unable to remove files under '$host_injection_driver_dir'."
fatal_error $error
fatal_error "$error"
fi
fi
fi
Expand Down
16 changes: 8 additions & 8 deletions install_scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ POSITIONAL_ARGS=()

while [[ $# -gt 0 ]]; do
case $1 in
-o|--prefix)
-p|--prefix)
INSTALL_PREFIX="$2"
shift 2
;;
Expand All @@ -38,25 +38,25 @@ set -- "${POSITIONAL_ARGS[@]}"
TOPDIR=$(dirname $(realpath $0))

# Subdirs for generic scripts
SCRIPTS_DIR_SOURCE=${TOPDIR}/scripts/ # Source dir
SCRIPTS_DIR_TARGET=${INSTALL_PREFIX}/scripts/ # Target dir
SCRIPTS_DIR_SOURCE=${TOPDIR}/scripts # Source dir
SCRIPTS_DIR_TARGET=${INSTALL_PREFIX}/scripts # Target dir

# Create target dir
mkdir -p ${SCRIPTS_DIR_TARGET}

# Copy scripts into this prefix
for file in utils.sh; do
cp ${SCRIPTS_DIR_SOURCE}/${file} ${SCRIPTS_DIR_TARGET}/${file}
cp -u ${SCRIPTS_DIR_SOURCE}/${file} ${SCRIPTS_DIR_TARGET}/${file}
done
# Subdirs for GPU support
NVIDIA_GPU_SUPPORT_DIR_SOURCE=${TOPDIR}/gpu_support/nvidia/ # Source dir
NVIDIA_GPU_SUPPORT_DIR_TARGET=${INSTALL_PREFIX}/gpu_support/nvidia/ # Target dir
NVIDIA_GPU_SUPPORT_DIR_SOURCE=${TOPDIR}/gpu_support/nvidia # Source dir
NVIDIA_GPU_SUPPORT_DIR_TARGET=${INSTALL_PREFIX}/gpu_support/nvidia # Target dir

# Create target dir
mkdir -p ${NVIDIA_GPU_SUPPORT_DIR_TARGET}

# Copy files from this directory into the prefix
# To be on the safe side, we dont do recursive copies, but we are explicitely copying each individual file we want to add
for file in install_cuda_host_injections.sh link_nvidia_host_injections.sh; do
cp ${NVIDIA_GPU_SUPPORT_DIR_SOURCE}/${file} ${NVIDIA_GPU_SUPPORT_DIR_TARGET}/${file}
for file in install_cuda_host_injections.sh link_nvidia_host_libraries.sh; do
cp -u ${NVIDIA_GPU_SUPPORT_DIR_SOURCE}/${file} ${NVIDIA_GPU_SUPPORT_DIR_TARGET}/${file}
done

0 comments on commit a4e8de7

Please sign in to comment.