diff --git a/create_lmodsitepackage.py b/create_lmodsitepackage.py index 33796e56cb..7f4eb114cd 100755 --- a/create_lmodsitepackage.py +++ b/create_lmodsitepackage.py @@ -136,8 +136,9 @@ end -- when loading CUDA (and cu*) enabled modules check if the necessary driver libraries are accessible to the EESSI linker, -- otherwise, refuse to load the requested module and print error message - local haveGpu = mt:haveProperty(simpleName,"arch","gpu") - if haveGpu then + local checkGpu = mt:haveProperty(simpleName,"arch","gpu") + local overrideGpuCheck = os.getenv("EESSI_OVERRIDE_GPU_CHECK") + if checkGpu and (overrideGpuCheck == nil) then local arch = os.getenv("EESSI_CPU_FAMILY") or "" local cvmfs_repo = os.getenv("EESSI_CVMFS_REPO") or "" local cudaVersionFile = cvmfs_repo .. "/host_injections/nvidia/" .. arch .. "/latest/cuda_version.txt" @@ -147,7 +148,9 @@ if not (cudaDriverExists or singularityCudaExists) then local advice = "which relies on the CUDA runtime environment and driver libraries. " advice = advice .. "In order to be able to use the module, you will need " - advice = advice .. "to make sure EESSI can find the GPU driver libraries on your host system.\\n" + advice = advice .. "to make sure EESSI can find the GPU driver libraries on your host system. You can " + advice = advice .. "override this check by setting the environment variable EESSI_OVERRIDE_GPU_CHECK but " + advice = advice .. "the loaded application will not be able to execute on your system.\\n" advice = advice .. refer_to_docs LmodError("\\nYou requested to load ", simpleName, " ", advice) else diff --git a/eessi_container.sh b/eessi_container.sh index 7d00d1400c..a95a2c87c9 100755 --- a/eessi_container.sh +++ b/eessi_container.sh @@ -464,10 +464,9 @@ if [[ ${SETUP_NVIDIA} -eq 1 ]]; then BIND_PATHS="${BIND_PATHS},${EESSI_VAR_LOG}:/var/log,${EESSI_USR_LOCAL_CUDA}:/usr/local/cuda" [[ ${VERBOSE} -eq 1 ]] && echo "BIND_PATHS=${BIND_PATHS}" if [[ "${NVIDIA_MODE}" == "install" ]] ; then - # We need to "trick" our LMOD_RC file to allow us to load CUDA modules even without a CUDA driver - # (this works because we build within a container and the LMOD_RC recognises that) - touch ${EESSI_TMPDIR}/libcuda.so - export SINGULARITY_CONTAINLIBS="${EESSI_TMPDIR}/libcuda.so" + # No GPU so we need to "trick" Lmod to allow us to load CUDA modules even without a CUDA driver + # (this variable means EESSI_OVERRIDE_GPU_CHECK=1 will be set inside the container) + export SINGULARITYENV_EESSI_OVERRIDE_GPU_CHECK=1 fi fi fi