Skip to content

Commit 2e10d3d

Browse files
author
Caspar van Leeuwen
committed
Update Lmod hook to print more specific warning in case the CUDA / cuDNN package was found in the old host-injections location (with micro-arch specific subdir). Also, adapt the path to search for the regular LmodError
1 parent e3f746f commit 2e10d3d

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

create_lmodsitepackage.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,29 @@
123123
local refer_to_docs = "For more information on how to do this, see https://www.eessi.io/docs/site_specific_config/gpu/.\\n"
124124
if packagesList[simpleName] then
125125
-- simpleName is a module in packagesList
126-
-- get the full host_injections path
127-
local hostInjections = string.gsub(os.getenv('EESSI_SOFTWARE_PATH') or "", 'versions', 'host_injections')
126+
-- first, check the old host_injections path. If that exists, print a more targetted, explainatory warning
127+
local previousHostInjections = string.gsub(os.getenv('EESSI_SOFTWARE_PATH') or "", 'versions', 'host_injections')
128+
local previousPackageEasyBuildDir = hostInjections .. "/software/" .. t.modFullName .. "/easybuild"
129+
local previousPackageDirExists = isDir(previousPackageEasyBuildDir)
130+
131+
-- get the host_injections path, and add only the EESSI_CPU_FAMILY at the end
132+
local strip_suffix = os.getenv('EESSI_VERSION') .. "/software/" .. os.getenv('EESSI_OS_TYPE') .. "/"
133+
strip_suffix = strip_suffix .. "os.getenv('EESSI_SOFTWARE_SUBDIR')
134+
local hostInjections = string.gsub(os.getenv('EESSI_SOFTWARE_PATH') or "", strip_suffix, os.getenv('EESSI_CPU_FAMILY'))
128135
129136
-- build final path where the software should be installed
130137
local packageEasyBuildDir = hostInjections .. "/software/" .. t.modFullName .. "/easybuild"
131138
local packageDirExists = isDir(packageEasyBuildDir)
132-
if not packageDirExists then
139+
if previousPackageDirExists and not packageDirExists then
140+
local targettedAdvice = "but while the module file exists, the actual software is not entirely shipped with EESSI "
141+
advice = advice .. "due to licencing. You will need to install a full copy of the " .. simpleName .. " package where EESSI "
142+
advice = advice .. "can find it.\\n"
143+
advice = advice .. "Note that a full copy is installed at " .. previoushostInjections .. "/software/" .. t.modFullName ". "
144+
advice = advice .. "However, EESSI now expects it in a different location, namely at "
145+
advice = advice .. hostInjections .. "/software/" .. t.modFullName "."
146+
advice = advice .. "Please re-install the package at the new location."
147+
advice = advice .. refer_to_docs
148+
elseif not packageDirExists then
133149
local advice = "but while the module file exists, the actual software is not entirely shipped with EESSI "
134150
advice = advice .. "due to licencing. You will need to install a full copy of the " .. simpleName .. " package where EESSI "
135151
advice = advice .. "can find it.\\n"

0 commit comments

Comments
 (0)