Skip to content

Commit 82d7f38

Browse files
authored
Merge pull request #370 from trz42/nessi-2023.06-skip-haveGPU-Lmod-hook-when-building
don't check for GPU driver libs when building
2 parents da4971d + e9b55f5 commit 82d7f38

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

create_lmodsitepackage.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@
133133
end
134134
-- when loading CUDA (and cu*) enabled modules check if the necessary driver libraries are accessible to the NESSI linker,
135135
-- otherwise, refuse to load the requested module and print error message
136-
local haveGpu = mt:haveProperty(simpleName,"arch","gpu")
137-
if haveGpu then
136+
local checkGpu = mt:haveProperty(simpleName,"arch","gpu")
137+
local overrideGpuCheck = os.getenv("EESSI_OVERRIDE_GPU_CHECK")
138+
if checkGpu and (overrideGpuCheck == nil) then
138139
local arch = os.getenv("EESSI_CPU_FAMILY") or ""
139140
local cvmfs_repo = os.getenv("EESSI_CVMFS_REPO") or ""
140141
local cudaVersionFile = cvmfs_repo .. "/host_injections/nvidia/" .. arch .. "/latest/cuda_version.txt"
@@ -144,7 +145,9 @@
144145
if not (cudaDriverExists or singularityCudaExists) then
145146
local advice = "which relies on the CUDA runtime environment and driver libraries. "
146147
advice = advice .. "In order to be able to use the module, you will need "
147-
advice = advice .. "to make sure NESSI can find the GPU driver libraries on your host system.\\n"
148+
advice = advice .. "to make sure NESSI can find the GPU driver libraries on your host system. You can "
149+
advice = advice .. "override this check by setting the environment variable EESSI_OVERRIDE_GPU_CHECK but "
150+
advice = advice .. "the loaded application will not be able to execute on your system.\\n"
148151
advice = advice .. refer_to_docs
149152
LmodError("\\nYou requested to load ", simpleName, " ", advice)
150153
else

0 commit comments

Comments
 (0)