From e5c261203b0419f26b53568f907c19ae9f6814a8 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 12 Sep 2024 13:03:19 +0200 Subject: [PATCH 1/2] install_cuda_host_injections: Don't fail if temp dir exists or parent is missing Use `mkdir -p` such that `--temp-dir /tmp/$USER/EESSI` works out of the box. It also avoids failures if the user got "ERROR: Could not create directory /tmp/root/EESSI/temp" and did `mkdir -p /tmp/root/EESSI/temp` manually. --- scripts/gpu_support/nvidia/install_cuda_host_injections.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gpu_support/nvidia/install_cuda_host_injections.sh b/scripts/gpu_support/nvidia/install_cuda_host_injections.sh index a9310d817a..0d363fde5e 100755 --- a/scripts/gpu_support/nvidia/install_cuda_host_injections.sh +++ b/scripts/gpu_support/nvidia/install_cuda_host_injections.sh @@ -123,7 +123,7 @@ else tmpdir=$(mktemp -d) else tmpdir="${CUDA_TEMP_DIR}"/temp - if ! mkdir "$tmpdir" ; then + if ! mkdir -p "$tmpdir" ; then fatal_error "Could not create directory ${tmpdir}" fi fi From 007712c32da14d139e2b12ed232f1cf0b1776b6d Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 12 Sep 2024 13:39:46 +0200 Subject: [PATCH 2/2] install_cuda_host_injections: Fix CUDA-EC-not-found error message The search query is a regexp not a glob, so add the missing dot. Also add the missing "of CUDA" in the message --- scripts/gpu_support/nvidia/install_cuda_host_injections.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/gpu_support/nvidia/install_cuda_host_injections.sh b/scripts/gpu_support/nvidia/install_cuda_host_injections.sh index 0d363fde5e..3842aff307 100755 --- a/scripts/gpu_support/nvidia/install_cuda_host_injections.sh +++ b/scripts/gpu_support/nvidia/install_cuda_host_injections.sh @@ -175,13 +175,13 @@ else # Check the exit code if [ $? -ne 0 ]; then eb_version=$(eb --version) - available_cuda_easyconfigs=$(eb --search ^CUDA-*.eb|grep CUDA) + available_cuda_easyconfigs=$(eb --search "^CUDA-.*.eb"|grep CUDA) error="The easyconfig ${cuda_easyconfig} was not found in EasyBuild version:\n" error="${error} ${eb_version}\n" error="${error}You either need to give a different version of CUDA to install _or_ \n" error="${error}use a different version of EasyBuild for the installation.\n" - error="${error}\nThe versions of available with the current eb command are:\n" + error="${error}\nThe versions of CUDA available with the current eb command are:\n" error="${error}${available_cuda_easyconfigs}" fatal_error "${error}" fi