-
Notifications
You must be signed in to change notification settings - Fork 781
{bio}[foss/2023a] RELION v5.0.0 w/ CUDA 12.1.1 #19678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
akesandgren
merged 21 commits into
easybuilders:develop
from
jfgrimm:20240122173303_new_pr_RELION500_beta20231221
Dec 22, 2025
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
cba2cc3
adding easyconfigs: RELION-5.0.0_beta.2023.12.21-foss-2023a-CUDA-12.1…
jfgrimm 8bdb9d8
update optional deps stuff
jfgrimm fc9aa54
optional deps
jfgrimm 8ffed03
adjust model weight download build instructions
jfgrimm d765b38
Update easybuild/easyconfigs/r/RELION/RELION-5.0.0_beta.2023.12.21-fo…
jfgrimm 7a4251c
update RELION 5 beta to latest commit
jfgrimm 18539ae
use PyTorch-bundle instead of torchvision easyconfig
jfgrimm 73d1e0f
update relion commits, use napari 0.4.19.post1, switch to mod*footers
jfgrimm 2b6e5cd
add comment to revisit _torch_home once Dataset easyblock is merged
jfgrimm 1792cd9
use PyHMMER easyconfig dependency instead of extension
jfgrimm 593b0eb
fix indentation
jfgrimm 453a6ec
Merge branch 'develop' of https://github.com/easybuilders/easybuild-e…
jfgrimm 7e542d4
bump to 5.0.0 stable version
bedroge 61f171c
reflect bump to stable version in filename
bedroge 999a637
Merge pull request #7 from bedroge/relion_5.0.0_stable
jfgrimm 6fcff1c
Merge branch 'develop' of https://github.com/easybuilders/easybuild-e…
akesandgren 20e2005
remove pythonpackage options that are now set by default
jfgrimm b2e695e
use modextravars instead of mod*footer since framework PR #4855 has b…
jfgrimm e2fe133
drop PYTHONPATH
jfgrimm 4469193
add test exception for napari
jfgrimm 3b708d6
test exception for VisPY
jfgrimm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
218 changes: 218 additions & 0 deletions
218
easybuild/easyconfigs/r/RELION/RELION-5.0.0-foss-2023a-CUDA-12.1.1.eb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,218 @@ | ||
| # Author: Jasper Grimm (UoY) | ||
| easyblock = 'CMakeMake' | ||
|
|
||
| name = 'RELION' | ||
| version = '5.0.0' | ||
| versionsuffix = '-CUDA-%(cudaver)s' | ||
|
|
||
| homepage = 'http://www2.mrc-lmb.cam.ac.uk/relion/index.php/Main_Page' | ||
| description = """RELION (for REgularised LIkelihood OptimisatioN, pronounce rely-on) is a stand-alone computer | ||
| program that employs an empirical Bayesian approach to refinement of (multiple) 3D reconstructions or 2D class | ||
| averages in electron cryo-microscopy (cryo-EM). | ||
| """ | ||
|
|
||
| build_info_msg = """To install RELION, it's recommended to change the defaults in this easyconfig, | ||
| to something suitable for your site. Recommended changes: | ||
| * Set '_torch_home' to the location where the model weights are downloaded (~12GB). The weights | ||
| can be downloaded manually by setting 'TORCH_HOME' and running 'relion_python_fetch_weights'. | ||
|
|
||
| * RELION has various optional dependencies. The following have been enaled by default, since they | ||
| only add extra functionality, but can be commented out to build without: | ||
| - X11 and FLTK (GUI) | ||
| - Ghostscript (PDF) | ||
| - xpdf (PDF viewer) | ||
| - XZ, zstd, PBZIP2 (compression libraries) | ||
| - tcsh | ||
| - gnuplot | ||
| Other dependencies that are not enabled by default: | ||
| - evince (alternate PDF viewer) | ||
| - ctffind or GCTF | ||
| - MotionCor2/MotionCor3 | ||
| - AreTomo2 | ||
| - ResMap | ||
| these can be enabled by uncommenting the corresponding entry in the dependencies list. | ||
|
|
||
| * Set additional 'RELION_*' variables, such as 'RELION_SCRATCH_DIR'. See: | ||
| https://relion.readthedocs.io/en/release-5.0/Installation.html#edit-the-environment-set-up | ||
| These variables should be added to 'modextrapaths' or 'modextravars' as appropriate. | ||
|
|
||
| * Add a job submission template for queue submission. See: | ||
| https://relion.readthedocs.io/en/release-5.0/Installation.html#set-up-queue-job-submission | ||
| """ | ||
|
|
||
|
|
||
| toolchain = {'name': 'foss', 'version': '2023a'} | ||
| toolchainopts = {'opt': True} | ||
|
|
||
| source_urls = ['https://github.com/3dem/relion/archive'] | ||
| sources = ['%(version)s.tar.gz'] | ||
| patches = ['%(name)s-5.0.0_target-all-cuda-compute-capabilities.patch'] | ||
| checksums = [ | ||
| {'5.0.0.tar.gz': '5d02d529bfdb396204310b35963f35e5ec40ed9fd10bc88c901119ae7d7739fc'}, | ||
| {'RELION-5.0.0_target-all-cuda-compute-capabilities.patch': | ||
| 'd53ca4873278ebf8d297f062218c7096679531b1289b76d8bd4b35152a6c1543'}, | ||
| ] | ||
|
|
||
| builddependencies = [ | ||
| ('CMake', '3.26.3'), | ||
| ('poetry', '1.7.1'), # use poetry compatible with build 1.x | ||
| ('meson-python', '0.15.0'), # pandas 2.1.4 needs meson >= 1.2.1 | ||
| ] | ||
|
|
||
| dependencies = [ | ||
| # required dependencies # | ||
| ('CUDA', '12.1.1', '', SYSTEM), | ||
| ('LibTIFF', '4.5.0'), | ||
| ('tbb', '2021.11.0'), | ||
| ('libpng', '1.6.39'), | ||
| ('morphosamplers', '0.0.10'), # required for: src/tomography_python_programs/get_particle_poses/filaments.py | ||
|
|
||
| # optional dependencies # | ||
| ('tcsh', '6.24.10'), | ||
| ('gnuplot', '5.4.8'), | ||
| ('FLTK', '1.3.8'), # for GUI | ||
| ('X11', '20230603'), # for GUI | ||
| ('PBZIP2', '1.1.13'), # for compression | ||
| ('zstd', '1.5.5'), # for compression | ||
| ('XZ', '5.4.2'), # for compression | ||
| ('Ghostscript', '10.01.2'), # for PDF files | ||
| ('xpdf', '4.04'), # pdf viewer | ||
| # ('evince', '45.0'), # pdf viewer | ||
| # ('ctffind', '4.1.14'), # lens defocus estimation | ||
| # ('AreTomo2', '1.0.0', versionsuffix), # alternative movie alignment | ||
| # ('MotionCor2', '1.5.0'), # alternative movie alignment | ||
| # ('MotionCor3', '1.0.1', versionsuffix), # alternative movie alignment | ||
| # ('ResMap', '1.1.4'), # alternative local resolution estimation | ||
|
|
||
| # dependencies from conda environment.yaml file # | ||
| ('Python', '3.11.3'), | ||
| ('PyTorch-bundle', '2.1.2', versionsuffix), | ||
| ('SciPy-bundle', '2023.07'), | ||
| ('tqdm', '4.66.1'), | ||
| ('scikit-learn', '1.3.1'), | ||
| ('matplotlib', '3.7.2'), | ||
| ('PyQt5', '5.15.10'), | ||
| ('Biopython', '1.83'), | ||
| ('Seaborn', '0.13.2'), | ||
| ('dill', '0.3.7'), | ||
| ('umap-learn', '0.5.5'), | ||
| ('einops', '0.7.0'), | ||
| ('mrcfile', '1.5.0'), | ||
| ('t-SNE-CUDA', '3.0.1', versionsuffix), | ||
| ('ESM-2', '2.0.0', versionsuffix), | ||
| ('topaz', '0.2.5.20231120', versionsuffix), | ||
| ('dask', '2023.9.2'), | ||
| ('imageio', '2.33.1'), | ||
| ('napari', '0.4.19.post1'), | ||
| ('tensorboard', '2.15.1'), | ||
| ('PyHMMER', '0.10.6'), | ||
| ] | ||
|
|
||
| # set this to the path to the Blush model weight database | ||
| # workaround until we merged the "Dataset" easyblock: | ||
| # https://github.com/easybuilders/easybuild-easyblocks/pull/3246 | ||
| # https://github.com/easybuilders/easybuild-framework/pull/4474 | ||
| _torch_home = '' | ||
|
|
||
| _copts = [ | ||
| '-DCMAKE_SHARED_LINKER="$LIBS"', | ||
| '-DMPI_INCLUDE_PATH="$MPI_INC_DIR"', | ||
| '-DCUDA_NVCC_FLAGS="--std=c++14"', | ||
| '-DCUDA_ARCH="%(cuda_cc_semicolon_sep)s"', | ||
| '-DCUDA_TEXTURE=ON', | ||
| '-DDoublePrec_CPU=OFF', | ||
| '-DFETCH_WEIGHTS=OFF', | ||
| '-DTORCH_HOME="%s"' % _torch_home, | ||
| ] | ||
|
|
||
| configopts = ' '.join(_copts) | ||
|
|
||
| install_cmd = 'make -j %(parallel)s install' | ||
|
|
||
| exts_defaultclass = 'PythonPackage' | ||
|
|
||
| exts_default_options = { | ||
| 'source_urls': [PYPI_SOURCE], | ||
| } | ||
|
|
||
| exts_list = [ | ||
| # starfile 0.5.4 needs pandas>=2.1.1 | ||
| ('pandas', '2.1.4', { | ||
| 'checksums': ['fcb68203c833cc735321512e13861358079a96c174a61f5116a1de89c58c0ef7'], | ||
| }), | ||
| ('starfile', '0.5.4', { | ||
| 'checksums': ['4e7cea4f871f5aeeff6829b2cd95efc0c2212ca7a3a583f5fc8ff53329bc4417'], | ||
| }), | ||
| ('loguru', '0.7.2', { | ||
| 'checksums': ['e671a53522515f34fd406340ee968cb9ecafbc4b36c679da03c18fd8d0bd51ac'], | ||
| }), | ||
| ('typer', '0.9.0', { | ||
| 'checksums': ['50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2'], | ||
| }), | ||
| ('fastcluster', '1.2.6', { | ||
| 'checksums': ['aab886efa7b6bba7ac124f4498153d053e5a08b822d2254926b7206cdf5a8aa6'], | ||
| }), | ||
| ('relion-classranker', '0.0.1_20230822', { | ||
| 'sources': [{ | ||
| 'filename': '%(name)s-%(version)s.tar.gz', | ||
| 'git_config': { | ||
| 'url': 'https://github.com/3dem', | ||
| 'repo_name': '%(name)s', | ||
| 'commit': 'b6e751e5cb4205d8e9b36d0ae38c3687b3395acb', | ||
| 'keep_git_dir': True, | ||
| }, | ||
| }], | ||
| 'checksums': [None], | ||
| }), | ||
| ('relion-blush', '0.0.1_20231105', { | ||
| 'sources': [{ | ||
| 'filename': '%(name)s-%(version)s.tar.gz', | ||
| 'git_config': { | ||
| 'url': 'https://github.com/3dem', | ||
| 'repo_name': '%(name)s', | ||
| 'commit': '3148869de884fc01cff6c51a047b1413fc0b62cb', | ||
| 'keep_git_dir': True, | ||
| }, | ||
| }], | ||
| 'checksums': [None], | ||
| }), | ||
| ('DynaMight', '0.0.1_20240319', { | ||
| 'sources': [{ | ||
| 'filename': '%(name)s-%(version)s.tar.gz', | ||
| 'git_config': { | ||
| 'url': 'https://github.com/3dem', | ||
| 'repo_name': '%(name)s', | ||
| 'commit': 'eef4aa673af6cc908042b38646ae489ee8f2fde9', | ||
| 'keep_git_dir': True, | ||
| }, | ||
| }], | ||
| 'checksums': [None], | ||
| }), | ||
| ('model-angelo', '1.0.12_20240226', { | ||
| 'sources': [{ | ||
| 'filename': '%(name)s-%(version)s.tar.gz', | ||
| 'git_config': { | ||
| 'url': 'https://github.com/3dem', | ||
| 'repo_name': '%(name)s', | ||
| 'commit': '6fdad9b47a0a2abb86990803f243ef028197a04d', | ||
| 'keep_git_dir': True, | ||
| }, | ||
| }], | ||
| 'checksums': [None], | ||
| }), | ||
| ] | ||
|
|
||
| sanity_check_paths = { | ||
| 'files': ['bin/relion%s' % x for x in ['', '_autopick', '_batchrun', '_batchrun_mpi']], | ||
| 'dirs': ['lib/python%(pyshortver)s/site-packages'], | ||
| } | ||
|
|
||
| sanity_check_commands = ['relion --help', 'relion --version'] | ||
|
|
||
| modextravars = { | ||
| 'TORCH_HOME': _torch_home, | ||
| 'RELION_PDFVIEWER_EXECUTABLE': '$EBROOTXPDF/bin/xpdf', | ||
| # 'RELION_SHELL': '$EBROOTTCSH/bin/tcsh', | ||
| } | ||
|
|
||
| moduleclass = 'bio' | ||
60 changes: 60 additions & 0 deletions
60
easybuild/easyconfigs/r/RELION/RELION-5.0.0_target-all-cuda-compute-capabilities.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| Description: enhance the cmake build scripts to: | ||
| - allow targetting of multiple CUDA architectures (with -gencode=) | ||
| - introduce DEFAULT_CUDA_ARCH to set the default CUDA arch target (-arch=) | ||
| Original Author: Jasper Grimm <jasper.grimm@york.ac.uk> | ||
| Updated by: | ||
| - Ake Sandgren <ake.sandgren@hpc2n.umu.se> | ||
| Modified to correctly set NVCC build flags and allow externally setting --std=xxx flag. | ||
| - Jasper Grimm <jasper.grimm@york.ac.uk> | ||
| Update for relion 5.0.0 beta | ||
|
|
||
| diff -Nru relion.orig/cmake/BuildTypes.cmake relion/cmake/BuildTypes.cmake | ||
| --- relion.orig/cmake/BuildTypes.cmake 2024-01-12 16:34:35.601247994 +0000 | ||
| +++ relion/cmake/BuildTypes.cmake 2024-01-12 16:36:40.744752894 +0000 | ||
| @@ -4,8 +4,8 @@ | ||
| # So -D__INTEL_COMPILER just manages to avoid compiling float128-targets (see fftw3.h, for instance). | ||
| # Add -G to allow cuda-gdb to break inside kernels. | ||
| if(CUDA) | ||
| - set(EXTRA_NVCC_FLAGS "-D__INTEL_COMPILER --default-stream per-thread --std=c++14") | ||
| - set(RELION_NVCC_FLAGS "${CUDARCH} ${WARN_DBL} ${EXTRA_NVCC_FLAGS}" CACHE STRING "" FORCE) | ||
| + set(EXTRA_NVCC_FLAGS "-D__INTEL_COMPILER --default-stream per-thread") | ||
| + set(RELION_NVCC_FLAGS "${WARN_DBL} ${EXTRA_NVCC_FLAGS}" CACHE STRING "" FORCE) | ||
| elseif (HIP) | ||
| if (${HIP_VERSION} VERSION_LESS "5.3" ) | ||
| set(EXTRA_HIPCC_FLAGS "-fgpu-default-stream=legacy -fno-gpu-rdc -munsafe-fp-atomics") | ||
| diff -Nru relion.orig/CMakeLists.txt relion/CMakeLists.txt | ||
| --- relion.orig/CMakeLists.txt 2024-01-12 16:34:35.601247994 +0000 | ||
| +++ relion/CMakeLists.txt 2024-01-12 16:41:34.615595884 +0000 | ||
| @@ -84,13 +84,20 @@ | ||
|
|
||
| set(CUDA_ARCH "" CACHE STRING "CUDA architecture to use") | ||
| if (CUDA_ARCH STREQUAL "") | ||
| - message(STATUS "Setting fallback CUDA_ARCH=50") | ||
| - set(CUDARCH "-arch=sm_50") | ||
| + message(STATUS "Setting fallback CUDA_ARCH=5.0") | ||
| + set(CUDA_ARCH "5.0") | ||
| else () | ||
| message(STATUS "Using provided CUDA_ARCH=${CUDA_ARCH}") | ||
| - set(CUDARCH "-arch=sm_${CUDA_ARCH}") | ||
| endif () | ||
|
|
||
| +if(NOT DEFINED DEFAULT_CUDA_ARCH) | ||
| + string(REGEX MATCH "[0-9]+\\.[0-9]+" DEFAULT_CUDA_ARCH "${CUDA_ARCH}") | ||
| + message(STATUS "Setting fallback DEFAULT_CUDA_ARCH=${DEFAULT_CUDA_ARCH}") | ||
| +endif() | ||
| + | ||
| +string(REPLACE "." "" DEFAULT_CUDA_SM ${DEFAULT_CUDA_ARCH}) | ||
| +set(CUDA_SM "-arch=sm_${DEFAULT_CUDA_SM}") | ||
| + | ||
| # -------------------------------------------------------------------FURTHER OPTIONS-- | ||
|
|
||
| # CUDA on by default, so check for other GPU/CPU-accelration request and possible conflicting dual-requests | ||
| @@ -204,6 +211,8 @@ | ||
| if(CUDA) | ||
| add_definitions(-D_CUDA_ENABLED) | ||
| endif() | ||
| + cuda_select_nvcc_arch_flags(CUDA_GENCODE "${CUDA_ARCH}") | ||
| + list(APPEND CUDA_NVCC_FLAGS ${CUDA_SM} ${CUDA_GENCODE}) | ||
| else(CUDA_FOUND) | ||
| message(FATAL_ERROR "CUDA enabled but unlable to locate packages...") | ||
| endif(CUDA_FOUND) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.