@@ -17,11 +17,6 @@ display_help() {
1717 echo " --skip-cuda-install - disable installing a full CUDA SDK in the host_injections prefix (e.g. in CI)"
1818}
1919
20- # Function to check if a command exists
21- function command_exists() {
22- command -v " $1 " > /dev/null 2>&1
23- }
24-
2520function copy_build_log() {
2621 # copy specified build log to specified directory, with some context added
2722 build_log=${1}
@@ -315,18 +310,9 @@ else
315310fi
316311
317312# Install NVIDIA drivers in host_injections (if they exist)
318- if command_exists " nvidia-smi" ; then
319- export LD_LIBRARY_PATH=" /.singularity.d/libs:${LD_LIBRARY_PATH} "
320- nvidia-smi --version
321- ec=$?
322- if [ ${ec} -eq 0 ]; then
323- echo " Command 'nvidia-smi' found. Installing NVIDIA drivers for use in prefix shell..."
324- ${EESSI_PREFIX} /scripts/gpu_support/nvidia/link_nvidia_host_libraries.sh
325- else
326- echo " Warning: command 'nvidia-smi' found, but 'nvidia-smi --version' did not run succesfully."
327- echo " This script now assumes this is NOT a GPU node."
328- echo " If, and only if, the current node actually does contain Nvidia GPUs, this should be considered an error."
329- fi
313+ if nvidia_gpu_available; then
314+ echo " Installing NVIDIA drivers for use in prefix shell..."
315+ ${EESSI_PREFIX} /scripts/gpu_support/nvidia/link_nvidia_host_libraries.sh
330316fi
331317
332318if [ ! -z " ${shared_fs_path} " ]; then
0 commit comments