Skip to content
Snippets Groups Projects
Commit c2cd4a13 authored by Damian Alvarez's avatar Damian Alvarez
Browse files

To get rid of the nvidia-driver headaches. But for older stages, let's...

To get rid of the nvidia-driver headaches. But for older stages, let's preserve the module and structure.
parent 29c0857a
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ class EB_nvidia_minus_driver(Binary): ...@@ -32,6 +32,7 @@ class EB_nvidia_minus_driver(Binary):
"""Support for generic 'default' modules with specific real versions""" """Support for generic 'default' modules with specific real versions"""
extra_vars = { extra_vars = {
'realversion': [None, "Real version to be used when version = 'default'", CUSTOM], 'realversion': [None, "Real version to be used when version = 'default'", CUSTOM],
'just_GL_libs': [False, "Install just GL-related libs", CUSTOM],
} }
return extra_vars return extra_vars
...@@ -68,13 +69,25 @@ class EB_nvidia_minus_driver(Binary): ...@@ -68,13 +69,25 @@ class EB_nvidia_minus_driver(Binary):
"Install NVIDIA libs simply by copying files. We can't use the installer because it requires root privileges." "Install NVIDIA libs simply by copying files. We can't use the installer because it requires root privileges."
# list of libs # list of libs
if not self.cfg['just_GL_libs']:
libs = expand_glob_paths([os.path.join(self.libsdir, 'lib*.so*')]) libs = expand_glob_paths([os.path.join(self.libsdir, 'lib*.so*')])
try: try:
libs += expand_glob_paths([os.path.join(self.libsdir, '*.la')]) libs += expand_glob_paths([os.path.join(self.libsdir, '*.la')])
except EasyBuildError: except EasyBuildError:
self.log.info("No *.la files found. Proceeding without them.") self.log.info("No *.la files found. Proceeding without them.")
libs += [os.path.join(self.libsdir, 'nvidia_drv.so')] libs += [os.path.join(self.libsdir, 'nvidia_drv.so')]
else:
libs = expand_glob_paths([os.path.join(self.libsdir, 'libEGL*.so*')])
libs += expand_glob_paths([os.path.join(self.libsdir, 'libGL*.so*')])
libs += expand_glob_paths([os.path.join(self.libsdir, 'libnvidia-egl*.so*')])
libs += expand_glob_paths([os.path.join(self.libsdir, 'libnvidia-gl*.so*')])
libs += expand_glob_paths([os.path.join(self.libsdir, 'libnvidia-ptx*.so*')])
libs += expand_glob_paths([os.path.join(self.libsdir, 'libnvidia-rtcore*.so*')])
libs += expand_glob_paths([os.path.join(self.libsdir, 'libnvidia-tls*.so*')])
libs += expand_glob_paths([os.path.join(self.libsdir, 'libnvidia-vulkan*.so*')])
if not self.cfg['just_GL_libs']:
# list of binaries # list of binaries
binaries = ['nvidia-bug-report.sh', binaries = ['nvidia-bug-report.sh',
'nvidia-cuda-mps-control', 'nvidia-cuda-mps-control',
...@@ -92,10 +105,11 @@ class EB_nvidia_minus_driver(Binary): ...@@ -92,10 +105,11 @@ class EB_nvidia_minus_driver(Binary):
'nvidia-smi.1.gz'] 'nvidia-smi.1.gz']
manpages = [os.path.join(self.libsdir, x) for x in manpages] manpages = [os.path.join(self.libsdir, x) for x in manpages]
copy(libs, os.path.join(self.installdir, 'lib64'))
copy(binaries, os.path.join(self.installdir, 'bin')) copy(binaries, os.path.join(self.installdir, 'bin'))
copy(manpages, os.path.join(self.installdir, 'man', 'man1')) copy(manpages, os.path.join(self.installdir, 'man', 'man1'))
copy(libs, os.path.join(self.installdir, 'lib64'))
def post_install_step(self): def post_install_step(self):
"""Generate the appropriate symlinks""" """Generate the appropriate symlinks"""
...@@ -104,6 +118,7 @@ class EB_nvidia_minus_driver(Binary): ...@@ -104,6 +118,7 @@ class EB_nvidia_minus_driver(Binary):
# Run ldconfig to create missing symlinks (libcuda.so.1, etc) # Run ldconfig to create missing symlinks (libcuda.so.1, etc)
run_cmd("/usr/sbin/ldconfig -N %s" % libdir) run_cmd("/usr/sbin/ldconfig -N %s" % libdir)
if not self.cfg['just_GL_libs']:
# Create an extra symlink for libcuda.so, otherwise PGI 19.X breaks # Create an extra symlink for libcuda.so, otherwise PGI 19.X breaks
# Create an extra symlink for libnvidia-ml.so, otherwise MVAPICH2 doesn't find it if it doesn't rely on stubs # Create an extra symlink for libnvidia-ml.so, otherwise MVAPICH2 doesn't find it if it doesn't rely on stubs
missing_links = ['libcuda.so', 'libnvidia-ml.so'] missing_links = ['libcuda.so', 'libnvidia-ml.so']
...@@ -120,13 +135,26 @@ class EB_nvidia_minus_driver(Binary): ...@@ -120,13 +135,26 @@ class EB_nvidia_minus_driver(Binary):
chk_libdir = ["lib64"] chk_libdir = ["lib64"]
if not self.cfg['just_GL_libs']:
nvlibs = ["cuda"] nvlibs = ["cuda"]
binaries = [os.path.join("bin", x) for x in ["nvidia-smi"]]
libs = [os.path.join("%s", "lib%s.%s.1") % (x, y, shlib_ext)
for x in chk_libdir for y in nvlibs]
else:
nvlibs_0_suffix = ["EGL_nvidia", "GLX_nvidia"]
nvlibs_1_suffix = ["GLESv1_CM_nvidia"]
nvlibs_2_suffix = ["GLESv2_nvidia"]
binaries = []
libs = [os.path.join("%s", "lib%s.%s.0") % (x, y, shlib_ext)
for x in chk_libdir for y in nvlibs_0_suffix]
libs += [os.path.join("%s", "lib%s.%s.1") % (x, y, shlib_ext)
for x in chk_libdir for y in nvlibs_1_suffix]
libs += [os.path.join("%s", "lib%s.%s.2") % (x, y, shlib_ext)
for x in chk_libdir for y in nvlibs_2_suffix]
custom_paths = { custom_paths = {
'files': [os.path.join("bin", x) for x in ["nvidia-smi"]] + 'files': binaries + libs,
[os.path.join("%s", "lib%s.%s.1") % (x, y, shlib_ext)
for x in chk_libdir for y in nvlibs],
'dirs': [''], 'dirs': [''],
} }
super(EB_nvidia_minus_driver, self).sanity_check_step( super(EB_nvidia_minus_driver, self).sanity_check_step(
custom_paths=custom_paths) custom_paths=custom_paths)
...@@ -17,11 +17,6 @@ source_urls = ['http://us.download.nvidia.com/tesla/%s/' % realversion] ...@@ -17,11 +17,6 @@ source_urls = ['http://us.download.nvidia.com/tesla/%s/' % realversion]
sources = ['NVIDIA-Linux-x86_64-%s.run' % realversion] sources = ['NVIDIA-Linux-x86_64-%s.run' % realversion]
checksums = ['0492ddc5b5e65aa00cbc762e8d6680205c8d08e103b7131087a15126aee495e9'] checksums = ['0492ddc5b5e65aa00cbc762e8d6680205c8d08e103b7131087a15126aee495e9']
# To avoid conflicts between NVML and the kernel driver just_GL_libs = True
postinstallcmds = ['rm %(installdir)s/lib64/libnvidia-ml.so*']
modluafooter = '''
add_property("arch","gpu")
'''
moduleclass = 'system' moduleclass = 'system'
name = 'nvidia-driver'
version = 'default'
realversion = '535.54.03'
homepage = 'https://developer.nvidia.com/cuda-toolkit'
description = f"""
This is a set of libraries normally installed by the NVIDIA driver installer.
The real version of this package is {realversion}.
"""
site_contacts = 'sc@fz-juelich.de'
toolchain = SYSTEM
source_urls = ['http://us.download.nvidia.com/tesla/%s/' % realversion]
sources = ['NVIDIA-Linux-x86_64-%s.run' % realversion]
checksums = ['454764f57ea1b9e19166a370f78be10e71f0626438fb197f726dc3caf05b4082']
# To avoid conflicts between NVML and the kernel driver
postinstallcmds = ['rm %(installdir)s/lib64/libnvidia-ml.so*']
modluafooter = '''
add_property("arch","gpu")
'''
moduleclass = 'system'
name = 'nvidia-driver'
version = 'default'
realversion = '535.54.03'
homepage = 'https://developer.nvidia.com/cuda-toolkit'
description = f"""
This is a set of libraries normally installed by the NVIDIA driver installer.
The real version of this package is {realversion}.
"""
site_contacts = 'sc@fz-juelich.de'
toolchain = SYSTEM
source_urls = ['http://us.download.nvidia.com/tesla/%s/' % realversion]
sources = ['NVIDIA-Linux-x86_64-%s.run' % realversion]
checksums = ['454764f57ea1b9e19166a370f78be10e71f0626438fb197f726dc3caf05b4082']
# To avoid conflicts between NVML and the kernel driver
postinstallcmds = ['rm %(installdir)s/lib64/libnvidia-ml.so*']
modluafooter = '''
add_property("arch","gpu")
'''
moduleclass = 'system'
name = 'nvidia-driver'
version = 'default'
realversion = '535.54.03'
homepage = 'https://developer.nvidia.com/cuda-toolkit'
description = f"""
This is a set of libraries normally installed by the NVIDIA driver installer.
The real version of this package is {realversion}.
"""
site_contacts = 'sc@fz-juelich.de'
toolchain = SYSTEM
source_urls = ['http://us.download.nvidia.com/tesla/%s/' % realversion]
sources = ['NVIDIA-Linux-x86_64-%s.run' % realversion]
checksums = ['454764f57ea1b9e19166a370f78be10e71f0626438fb197f726dc3caf05b4082']
# To avoid conflicts between NVML and the kernel driver
postinstallcmds = ['rm %(installdir)s/lib64/libnvidia-ml.so*']
modluafooter = '''
add_property("arch","gpu")
'''
moduleclass = 'system'
name = 'nvidia-driver'
version = 'default'
realversion = '535.54.03'
homepage = 'https://developer.nvidia.com/cuda-toolkit'
description = f"""
This is a set of libraries normally installed by the NVIDIA driver installer.
The real version of this package is {realversion}.
"""
site_contacts = 'sc@fz-juelich.de'
toolchain = SYSTEM
source_urls = ['http://us.download.nvidia.com/tesla/%s/' % realversion]
sources = ['NVIDIA-Linux-x86_64-%s.run' % realversion]
checksums = ['454764f57ea1b9e19166a370f78be10e71f0626438fb197f726dc3caf05b4082']
# To avoid conflicts between NVML and the kernel driver
postinstallcmds = ['rm %(installdir)s/lib64/libnvidia-ml.so*']
modluafooter = '''
add_property("arch","gpu")
'''
moduleclass = 'system'
name = 'nvidia-driver'
version = 'default'
realversion = '535.54.03'
homepage = 'https://developer.nvidia.com/cuda-toolkit'
description = f"""
This is a set of libraries normally installed by the NVIDIA driver installer.
The real version of this package is {realversion}.
"""
site_contacts = 'sc@fz-juelich.de'
toolchain = SYSTEM
source_urls = ['http://us.download.nvidia.com/tesla/%s/' % realversion]
sources = ['NVIDIA-Linux-x86_64-%s.run' % realversion]
checksums = ['454764f57ea1b9e19166a370f78be10e71f0626438fb197f726dc3caf05b4082']
# To avoid conflicts between NVML and the kernel driver
postinstallcmds = ['rm %(installdir)s/lib64/libnvidia-ml.so*']
modluafooter = '''
add_property("arch","gpu")
'''
moduleclass = 'system'
name = 'nvidia-driver'
version = 'default'
realversion = '535.54.03'
homepage = 'https://developer.nvidia.com/cuda-toolkit'
description = f"""
This is a set of libraries normally installed by the NVIDIA driver installer.
The real version of this package is {realversion}.
"""
site_contacts = 'sc@fz-juelich.de'
toolchain = SYSTEM
source_urls = ['http://us.download.nvidia.com/tesla/%s/' % realversion]
sources = ['NVIDIA-Linux-x86_64-%s.run' % realversion]
checksums = ['454764f57ea1b9e19166a370f78be10e71f0626438fb197f726dc3caf05b4082']
# To avoid conflicts between NVML and the kernel driver
postinstallcmds = ['rm %(installdir)s/lib64/libnvidia-ml.so*']
modluafooter = '''
add_property("arch","gpu")
'''
moduleclass = 'system'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment