Skip to content

Commit

Permalink
Move envvar setting outside of command
Browse files Browse the repository at this point in the history
  • Loading branch information
ocaisa committed Nov 30, 2023
1 parent cb12649 commit f9268e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gpu_support/nvidia/link_nvidia_host_libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ check_eessi_initialised

# Find the CUDA version of the host CUDA drivers
# (making sure that this can still work inside prefix environment inside a container)
nvidia_smi_command="LD_LIBRARY_PATH=/.singularity/libs:$LD_LIBRARY_PATH nvidia-smi --query-gpu=driver_version --format=csv,noheader"
if $($nvidia_smi_command); then
LD_LIBRARY_PATH=/.singularity/libs:$LD_LIBRARY_PATH
nvidia_smi_command="nvidia-smi --query-gpu=driver_version --format=csv,noheader"
if $nvidia_smi_command; then
host_cuda_version=$($nvidia_smi_command | tail -n1)
else
error="Failed to successfully execute\n $nvidia_smi_command\n"
Expand Down

0 comments on commit f9268e0

Please sign in to comment.