Skip to content

Commit 68aa119

Browse files
committed
add changes from EESSI#579
1 parent 2008870 commit 68aa119

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

create_lmodsitepackage.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@
136136
end
137137
-- when loading CUDA (and cu*) enabled modules check if the necessary driver libraries are accessible to the EESSI linker,
138138
-- otherwise, refuse to load the requested module and print error message
139-
local haveGpu = mt:haveProperty(simpleName,"arch","gpu")
140-
if haveGpu then
139+
local checkGpu = mt:haveProperty(simpleName,"arch","gpu")
140+
local overrideGpuCheck = os.getenv("EESSI_OVERRIDE_GPU_CHECK")
141+
if checkGpu and (overrideGpuCheck == nil) then
141142
local arch = os.getenv("EESSI_CPU_FAMILY") or ""
142143
local cvmfs_repo = os.getenv("EESSI_CVMFS_REPO") or ""
143144
local cudaVersionFile = cvmfs_repo .. "/host_injections/nvidia/" .. arch .. "/latest/cuda_version.txt"
@@ -147,7 +148,9 @@
147148
if not (cudaDriverExists or singularityCudaExists) then
148149
local advice = "which relies on the CUDA runtime environment and driver libraries. "
149150
advice = advice .. "In order to be able to use the module, you will need "
150-
advice = advice .. "to make sure EESSI can find the GPU driver libraries on your host system.\\n"
151+
advice = advice .. "to make sure EESSI can find the GPU driver libraries on your host system. You can "
152+
advice = advice .. "override this check by setting the environment variable EESSI_OVERRIDE_GPU_CHECK but "
153+
advice = advice .. "the loaded application will not be able to execute on your system.\\n"
151154
advice = advice .. refer_to_docs
152155
LmodError("\\nYou requested to load ", simpleName, " ", advice)
153156
else

eessi_container.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,9 @@ if [[ ${SETUP_NVIDIA} -eq 1 ]]; then
464464
BIND_PATHS="${BIND_PATHS},${EESSI_VAR_LOG}:/var/log,${EESSI_USR_LOCAL_CUDA}:/usr/local/cuda"
465465
[[ ${VERBOSE} -eq 1 ]] && echo "BIND_PATHS=${BIND_PATHS}"
466466
if [[ "${NVIDIA_MODE}" == "install" ]] ; then
467-
# We need to "trick" our LMOD_RC file to allow us to load CUDA modules even without a CUDA driver
468-
# (this works because we build within a container and the LMOD_RC recognises that)
469-
touch ${EESSI_TMPDIR}/libcuda.so
470-
export SINGULARITY_CONTAINLIBS="${EESSI_TMPDIR}/libcuda.so"
467+
# No GPU so we need to "trick" Lmod to allow us to load CUDA modules even without a CUDA driver
468+
# (this variable means EESSI_OVERRIDE_GPU_CHECK=1 will be set inside the container)
469+
export SINGULARITYENV_EESSI_OVERRIDE_GPU_CHECK=1
471470
fi
472471
fi
473472
fi

0 commit comments

Comments
 (0)