Skip to content
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/tests_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
# can't test with EasyBuild versions older than v4.5.2 when using EESSI 2023.06,
# since Python in compat layer is Python 3.11.x;
# testing with a single EasyBuild version takes a while in GitHub Actions, so stick to a single sensible version
for EB_VERSION in '4.6.0'; do
for EB_VERSION in '5.1.0'; do
# Create script that uses load_easybuild_module.sh which we can run in compat layer environment
# note: Be careful with single vs double quotes below!
# ${EB_VERSION} should be expanded, so use double quotes;
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:

# scripts need to be copied to /tmp,
# since create_directory_tarballs.sh must be accessible from within build container
./eessi_container.sh --mode run --verbose /software-layer-scripts/create_directory_tarballs.sh 2023.06
./eessi_container.sh --mode run --verbose /software-layer-scripts/create_directory_tarballs.sh "${{matrix.EESSI_VERSION}}"
# check if tarballs have been produced
ls -l *.tar.gz

Expand Down
25 changes: 9 additions & 16 deletions EESSI-install-software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ display_help() {
echo " --skip-cuda-install - disable installing a full CUDA SDK in the host_injections prefix (e.g. in CI)"
}

# Function to check if a command exists
function command_exists() {
command -v "$1" >/dev/null 2>&1
}

function copy_build_log() {
# copy specified build log to specified directory, with some context added
build_log=${1}
Expand Down Expand Up @@ -315,19 +310,17 @@ else
fi

# Install NVIDIA drivers in host_injections (if they exist)
if command_exists "nvidia-smi"; then
# Accept that this may fail
set +e
verify_nvidia-smi
ec=$?
if [ ${ec} -eq 0 ]; then
export LD_LIBRARY_PATH="/.singularity.d/libs:${LD_LIBRARY_PATH}"
${EESSI_PREFIX}/scripts/gpu_support/nvidia/link_nvidia_host_libraries.sh
elif [ ${ec} -eq 1 ]; then
export LD_LIBRARY_PATH="/.singularity.d/libs:${LD_LIBRARY_PATH}"
nvidia-smi --version
ec=$?
if [ ${ec} -eq 0 ]; then
echo "Command 'nvidia-smi' found. Installing NVIDIA drivers for use in prefix shell..."
${EESSI_PREFIX}/scripts/gpu_support/nvidia/link_nvidia_host_libraries.sh
else
echo "Warning: command 'nvidia-smi' found, but 'nvidia-smi --version' did not run succesfully."
echo "This script now assumes this is NOT a GPU node."
echo "If, and only if, the current node actually does contain Nvidia GPUs, this should be considered an error."
fi
fi
set -e

if [ ! -z "${shared_fs_path}" ]; then
shared_eb_sourcepath=${shared_fs_path}/easybuild/sources
Expand Down
27 changes: 10 additions & 17 deletions bot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,25 +220,18 @@ BUILD_STEP_ARGS+=("--save" "${TARBALL_TMP_BUILD_STEP_DIR}")
BUILD_STEP_ARGS+=("--storage" "${STORAGE}")

# add options required to handle NVIDIA support
if command_exists "nvidia-smi"; then
# Accept that this may fail
set +e
nvidia-smi --version
ec=$?
set -e
if [ ${ec} -eq 0 ]; then
echo "Command 'nvidia-smi' found, using available GPU"
BUILD_STEP_ARGS+=("--nvidia" "all")
else
echo "Warning: command 'nvidia-smi' found, but 'nvidia-smi --version' did not run succesfully."
echo "This script now assumes this is NOT a GPU node."
echo "If, and only if, the current node actually does contain Nvidia GPUs, this should be considered an error."
BUILD_STEP_ARGS+=("--nvidia" "install")
fi
else
echo "No 'nvidia-smi' found, no available GPU but allowing overriding this check"
# Accept that this may fail
set +e
verify_nvidia-smi
ec=$?
if [ ${ec} -eq 0 ]; then
BUILD_STEP_ARGS+=("--nvidia" "all")
elif [ ${ec} -eq 1 ]; then
BUILD_STEP_ARGS+=("--nvidia" "install")
elif [ ${ec} -eq 2 ]; then
BUILD_STEP_ARGS+=("--nvidia" "install")
fi
set -e

# Retain location for host injections so we don't reinstall CUDA
# (Always need to run the driver installation as available driver may change)
Expand Down
21 changes: 7 additions & 14 deletions bot/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,21 +225,14 @@ fi
TEST_STEP_ARGS+=("--extra-bind-paths" "/sys/fs/cgroup:/hostsys/fs/cgroup:ro")

# add options required to handle NVIDIA support
if command_exists "nvidia-smi"; then
# Accept that this may fail
set +e
nvidia-smi --version
ec=$?
set -e
if [ ${ec} -eq 0 ]; then
echo "Command 'nvidia-smi' found, using available GPU"
TEST_STEP_ARGS+=("--nvidia" "run")
else
echo "Warning: command 'nvidia-smi' found, but 'nvidia-smi --version' did not run succesfully."
echo "This script now assumes this is NOT a GPU node."
echo "If, and only if, the current node actually does contain Nvidia GPUs, this should be considered an error."
fi
# Accept that this may fail
set +e
verify_nvidia-smi
ec=$?
if [ ${ec} -eq 0 ]; then
TEST_STEP_ARGS+=("--nvidia" "run")
fi
set -e

# prepare arguments to test_suite.sh (specific to test step)
declare -a TEST_SUITE_ARGS=()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
easyconfigs:
- pmt-1.2.0-GCCcore-12.3.0-CUDA-12.1.1.eb
19 changes: 19 additions & 0 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,22 @@ function get_ipv4_address {
echo "${hipv4}"
return 0
}

function verify_nvidia-smi {
if command_exists "nvidia-smi"; then
nvidia-smi --version
ec=$?
if [ ${ec} -eq 0 ]; then
echo "Command 'nvidia-smi' found. Installing NVIDIA drivers for use in prefix shell..."
return 0
else
echo "Warning: command 'nvidia-smi' found, but 'nvidia-smi --version' did not run succesfully."
echo "This script now assumes this is NOT a GPU node."
echo "If, and only if, the current node actually does contain Nvidia GPUs, this should be considered an error."
return 1
fi
else
echo echo "No 'nvidia-smi' found, no available GPU but allowing overriding this check"
return 2
fi
}