Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
base
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
base
Commits
abeb1239
Commit
abeb1239
authored
3 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Plain Diff
Merge branch 'rf/default-cuda-home' into 'master'
Rf/default cuda home See merge request
fsl/base!16
parents
1c4672a5
dc2d0627
No related branches found
Branches containing commit
Tags
2107.3
Tags containing commit
1 merge request
!16
Rf/default cuda home
Pipeline
#9630
passed
3 years ago
Stage: test
Stage: fsl-ci-build
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+6
-0
6 additions, 0 deletions
CHANGELOG.md
README.md
+14
-4
14 additions, 4 deletions
README.md
config/buildSettings.mk
+17
-19
17 additions, 19 deletions
config/buildSettings.mk
with
37 additions
and
23 deletions
CHANGELOG.md
+
6
−
0
View file @
abeb1239
# FSL base project changelog
## 2107.3 (Monday 12th July 2021)
-
Change CUDA build configuration so that now all is needed is for
`nvcc`
to
be on the
`$PATH`
, or a
`$NVCC`
variable to be set.
## 2107.2 (Sunday 11th July 2021)
-
Further tweaks to CUDA linking logic.
...
...
This diff is collapsed.
Click to expand it.
README.md
+
14
−
4
View file @
abeb1239
...
...
@@ -17,11 +17,17 @@ The `.ci` directory contains a collection of tests which validate the
behaviour of various aspects of the
`base`
project. All tests are written
in Python, and are executed with
`pytest`
.
## CUDA build options
The following options may be used to control compilation of a CUDA project:
## Building FSL CUDA projects.
Some FSL projects (e.g. [
`fsl/eddy`
(https://git.fmrib.ox.ac.uk/fsl/eddy) use
CUDA for GPU acceleration. In order to compile these projects, the
`nvcc`
compiler must be available on your
`$PATH`
, or a variable called
`$NVCC`
must
refer to the
`nvcc`
executable to use.
The following additional options may be used to control compilation of a CUDA
project:
-
`CUDA_HOME`
: Specify the path to the CUDA installation directory
-
`CUDA_STATIC`
: Statically link against the CUDA runtime and certain;
CUDA Toolkit libraris (default is to use dynamic linking).
-
`GENCODEFLAGS`
:
`-gencode`
options specifying the device architectures to
...
...
@@ -31,4 +37,8 @@ The following options may be used to control compilation of a CUDA project:
For example, to compile a CUDA project with a specific CUDA installation, and
using static linking:
make CUDA_STATIC=1 CUDA_HOME=/usr/local/cuda-10.1
export PATH=/usr/local/cuda-10.2/bin:$PATH
make CUDA_STATIC=1
The
`Makefile`
for each FSL CUDA project may provide additional options for
controlling compilation.
This diff is collapsed.
Click to expand it.
config/buildSettings.mk
+
17
−
19
View file @
abeb1239
...
...
@@ -114,25 +114,17 @@ endif
#####################################################################
#
# Default compiler commands, flags, and basic external libraries for
# CUDA projects.
# CUDA projects.
nvcc must be on the $PATH, or $NVCC must be set.
#
#####################################################################
ifneq
($(shell which nvcc), )
# NVCC, CUDA_HOME, CUDA_VER, GENCODEFLAGS,
# NVCCFLAGS, NVCCLDFLAGS, and CUDA_STATIC
# may be specified/overridden by the
# environment.
# We specifically use variable names "CUDA_VER"
# and "CUDA_HOME" because they will be set in
# the conda-forge CUDA build environment (and
# will take precedence over these definitions
# here when they are set).
NVCC
?=
nvcc
CUDA_HOME
?=
${
FSLDIR
}
CUDA_VER
?=
$(
shell nvcc
--version
|
grep
-Po
"release
\K
[0-9
\.
]+"
)
NVCC
?=
$(
shell which nvcc
)
ifneq
(${NVCC}, )
# NVCC, GENCODEFLAGS, NVCCFLAGS, NVCCLDFLAGS,
# and CUDA_STATIC may be specified/overridden
# by the environment.
CUDA_HOME
=
$(
shell
dirname
${
NVCC
})
/../
CUDA_VER
=
$(
shell
${
NVCC
}
--version
|
grep
-Po
"release
\K
[0-9
\.
]+"
)
GENCODEFLAGS
?=
$(
shell
${
FSLCONFDIR
}
/supportedGencodes.sh
${
CUDA_VER
})
# We specify the compiler to use with -ccbin, as
...
...
@@ -151,6 +143,8 @@ ifneq ($(shell which nvcc), )
# Link CUDA libraries statically, if compilation
# was invoked with "make CUDA_STATIC=1".
# Compiler / linker options vary depending on the
# CUDA version
_CUDALIBS
=
-lcuda
ifdef
CUDA_STATIC
# The cuda/cudart/cudadevrt libs are handled by nvcc.
...
...
@@ -176,7 +170,11 @@ ifneq ($(shell which nvcc), )
_CUDALIBS
+=
$(
subst
-lcublas
,
${
CUBLAS_STATIC
}
,
\
$(
subst
-lcurand
,-lcurand_static,
${
CUDALIBS
}))
else
NVCCFLAGS
+=
--cudart
=
shared
--cudadevrt
=
static
_CUDALIBS
+=
${
CUDALIBS
}
ifeq
($(patsubst 9.%,,${CUDA_VER}),)
NVCCFLAGS
+=
--cudart
=
shared
else
NVCCFLAGS
+=
--cudart
=
shared
--cudadevrt
=
static
endif
_CUDALIBS
+=
${
CUDALIBS
}
endif
endif
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