Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
easybuild-repository-public-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DEEP-SEA
easybuild-repository-public-release
Commits
48c299a8
Commit
48c299a8
authored
Jan 17, 2022
by
Damian Alvarez
Browse files
Options
Downloads
Patches
Plain Diff
To align the style and line breaks with upstream
parent
a6ae3060
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Custom_EasyBlocks/cuda.py
+23
-27
23 additions, 27 deletions
Custom_EasyBlocks/cuda.py
with
23 additions
and
27 deletions
Custom_EasyBlocks/cuda.py
+
23
−
27
View file @
48c299a8
...
...
@@ -84,8 +84,7 @@ class EB_CUDA(Binary):
elif
myarch
==
X86_64
:
cudaarch
=
''
else
:
raise
EasyBuildError
(
"
Architecture %s is not supported for CUDA on EasyBuild
"
,
myarch
)
raise
EasyBuildError
(
"
Architecture %s is not supported for CUDA on EasyBuild
"
,
myarch
)
super
(
EB_CUDA
,
self
).
__init__
(
*
args
,
**
kwargs
)
...
...
@@ -95,8 +94,7 @@ class EB_CUDA(Binary):
def
extract_step
(
self
):
"""
Extract installer to have more control, e.g. options, patching Perl scripts, etc.
"""
execpath
=
self
.
src
[
0
][
'
path
'
]
run_cmd
(
"
/bin/sh
"
+
execpath
+
"
--noexec --nox11 --target
"
+
self
.
builddir
)
run_cmd
(
"
/bin/sh
"
+
execpath
+
"
--noexec --nox11 --target
"
+
self
.
builddir
)
self
.
src
[
0
][
'
finalpath
'
]
=
self
.
builddir
def
install_step
(
self
):
...
...
@@ -112,8 +110,7 @@ class EB_CUDA(Binary):
install_interpreter
=
"
perl
"
install_script
=
"
cuda-installer.pl
"
# note: samples are installed by default
self
.
cfg
.
update
(
'
installopts
'
,
"
-verbose -silent -toolkitpath=%s -toolkit
"
%
self
.
installdir
)
self
.
cfg
.
update
(
'
installopts
'
,
"
-verbose -silent -toolkitpath=%s -toolkit
"
%
self
.
installdir
)
else
:
install_interpreter
=
""
install_script
=
"
./cuda-installer
"
...
...
@@ -171,8 +168,7 @@ class EB_CUDA(Binary):
# patch install script to handle Q&A autonomously
if
install_interpreter
==
"
perl
"
:
patch_perl_script_autoflush
(
os
.
path
.
join
(
self
.
builddir
,
install_script
))
patch_perl_script_autoflush
(
os
.
path
.
join
(
self
.
builddir
,
install_script
))
p5lib
=
os
.
getenv
(
'
PERL5LIB
'
,
''
)
if
p5lib
==
''
:
p5lib
=
self
.
builddir
...
...
@@ -193,8 +189,7 @@ class EB_CUDA(Binary):
# overriding maxhits default value to 1000 (seconds to wait for nothing to change in the output
# without seeing a known question)
run_cmd_qa
(
cmd
,
qanda
,
std_qa
=
stdqa
,
no_qa
=
noqanda
,
log_all
=
True
,
simple
=
True
,
maxhits
=
1000
)
run_cmd_qa
(
cmd
,
qanda
,
std_qa
=
stdqa
,
no_qa
=
noqanda
,
log_all
=
True
,
simple
=
True
,
maxhits
=
1000
)
# Remove the cuda-installer log file
remove_file
(
'
/tmp/cuda-installer.log
'
)
...
...
@@ -233,8 +228,7 @@ class EB_CUDA(Binary):
self
.
log
.
info
(
"
ldconfig found at %s
"
,
ldconfig
)
else
:
path
=
os
.
environ
.
get
(
'
PATH
'
,
''
)
raise
EasyBuildError
(
"
Unable to find
'
ldconfig
'
in $PATH (%s), nor in any of %s
"
,
path
,
sbin_dirs
)
raise
EasyBuildError
(
"
Unable to find
'
ldconfig
'
in $PATH (%s), nor in any of %s
"
,
path
,
sbin_dirs
)
stubs_dir
=
os
.
path
.
join
(
self
.
installdir
,
'
lib64
'
,
'
stubs
'
)
# Run ldconfig to create missing symlinks in the stubs directory (libcuda.so.1, etc)
...
...
@@ -262,35 +256,37 @@ class EB_CUDA(Binary):
culibs
=
[
"
cublas
"
,
"
cudart
"
,
"
cufft
"
,
"
curand
"
,
"
cusparse
"
]
custom_paths
=
{
'
files
'
:
[
os
.
path
.
join
(
"
bin
"
,
x
)
for
x
in
[
"
fatbinary
"
,
"
nvcc
"
,
"
nvlink
"
,
"
ptxas
"
]]
+
[
os
.
path
.
join
(
"
%s
"
,
"
lib%s.%s
"
)
%
(
x
,
y
,
shlib_ext
)
for
x
in
chk_libdir
for
y
in
culibs
],
[
os
.
path
.
join
(
"
%s
"
,
"
lib%s.%s
"
)
%
(
x
,
y
,
shlib_ext
)
for
x
in
chk_libdir
for
y
in
culibs
],
'
dirs
'
:
[
"
include
"
],
}
if
LooseVersion
(
self
.
version
)
>
LooseVersion
(
'
5
'
):
custom_paths
[
'
files
'
].
append
(
os
.
path
.
join
(
'
samples
'
,
'
Makefile
'
))
if
LooseVersion
(
self
.
version
)
<
LooseVersion
(
'
7
'
):
custom_paths
[
'
files
'
].
append
(
os
.
path
.
join
(
'
open64
'
,
'
bin
'
,
'
nvopencc
'
))
custom_paths
[
'
files
'
].
append
(
os
.
path
.
join
(
'
open64
'
,
'
bin
'
,
'
nvopencc
'
))
if
LooseVersion
(
self
.
version
)
>=
LooseVersion
(
'
7
'
):
custom_paths
[
'
files
'
].
append
(
os
.
path
.
join
(
"
extras
"
,
"
CUPTI
"
,
"
lib64
"
,
"
libcupti.%s
"
)
%
shlib_ext
)
custom_paths
[
'
dirs
'
].
append
(
os
.
path
.
join
(
"
extras
"
,
"
CUPTI
"
,
"
include
"
))
custom_paths
[
'
files
'
].
append
(
os
.
path
.
join
(
"
extras
"
,
"
CUPTI
"
,
"
lib64
"
,
"
libcupti.%s
"
)
%
shlib_ext
)
custom_paths
[
'
dirs
'
].
append
(
os
.
path
.
join
(
"
extras
"
,
"
CUPTI
"
,
"
include
"
))
# Just a subset of files are checked, since the whole list is likely to change, and irrelevant in most cases
# anyway
pc_files
=
[
'
cublas.pc
'
,
'
cudart.pc
'
,
'
cuda.pc
'
,
'
nvidia-ml.pc
'
,
'
nvjpeg.pc
'
]
custom_paths
[
'
files
'
]
=
custom_paths
[
'
files
'
]
+
[
os
.
path
.
join
(
'
pkgconfig
'
,
x
)
for
x
in
pc_files
]
super
(
EB_CUDA
,
self
).
sanity_check_step
(
custom_paths
=
custom_paths
)
def
make_module_extra
(
self
):
"""
Set the install directory as CUDA_HOME, CUDA_ROOT, CUDA_PATH.
"""
# So %(installdir)s is not added to the PATH
# avoid adding of installation directory to $PATH (cfr. Binary easyblock) since that may cause trouble,
# for example when there's a clash between command name and a subdirectory in the installation directory
# (like compute-sanitizer)
self
.
cfg
[
'
prepend_to_path
'
]
=
False
txt
=
super
(
EB_CUDA
,
self
).
make_module_extra
()
txt
+=
self
.
module_generator
.
set_environment
(
'
CUDA_HOME
'
,
self
.
installdir
)
txt
+=
self
.
module_generator
.
set_environment
(
'
CUDA_ROOT
'
,
self
.
installdir
)
txt
+=
self
.
module_generator
.
set_environment
(
'
CUDA_PATH
'
,
self
.
installdir
)
txt
+=
self
.
module_generator
.
set_environment
(
'
CUDA_HOME
'
,
self
.
installdir
)
txt
+=
self
.
module_generator
.
set_environment
(
'
CUDA_ROOT
'
,
self
.
installdir
)
txt
+=
self
.
module_generator
.
set_environment
(
'
CUDA_PATH
'
,
self
.
installdir
)
self
.
log
.
debug
(
"
make_module_extra added this: %s
"
,
txt
)
return
txt
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment