-
Notifications
You must be signed in to change notification settings - Fork 304
enhance LLVM easyblock to use dlopen for AMDGPU/CUDA libomptarget / offload target libraries
#3747
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
enhance LLVM easyblock to use dlopen for AMDGPU/CUDA libomptarget / offload target libraries
#3747
Conversation
Avoid linking in a system CUDA / ROCm by mistake by forcing LLVM to use dlopen the libraries instead. This also removes the need to pass in these libraries as dependencies when building LLVM altogether, except if testing of the built libraries is wanted. This should only really matter for systems where a system ROCm or CUDA exists.
|
Hm, a single stage test build ignored the set flag for LLVM 18.1.8. Investigating... |
Pass arguments to top-level build instead.
|
LLVM 18 requires top-level CMake options, LLVM 19+ need their options as runtime arguments. Tests with both CUDA & AMDGPU enabled at the same time looked good. Tests can be done by building LLVM EasyConfigs with e.g. CUDA as a direct dependency, and then checking the logs for: Example EasyConfig: Click to openname = 'LLVM'
version = '20.1.5'
homepage = "https://llvm.org/"
description = """The LLVM Core libraries provide a modern source- and target-independent
optimizer, along with code generation support for many popular CPUs
(as well as some less common ones!) These libraries are built around a well
specified code representation known as the LLVM intermediate representation
("LLVM IR"). The LLVM Core libraries are well documented, and it is
particularly easy to invent your own language (or port an existing compiler)
to use LLVM as an optimizer and code generator."""
toolchain = {'name': 'GCCcore', 'version': '13.3.0'}
toolchainopts = {
# 'cstd': 'gnu++11',
'pic': True
}
source_urls = ['https://github.com/llvm/llvm-project/releases/download/llvmorg-%(version)s/']
sources = [
'llvm-project-%(version)s.src.tar.xz',
]
patches = [
'LLVM-18.1.8_envintest.patch',
'LLVM-19.1.7_libomptarget_tests.patch',
'LLVM-19.1.7_clang_rpathwrap_test.patch',
]
checksums = [
{'llvm-project-20.1.5.src.tar.xz': 'a069565cd1c6aee48ee0f36de300635b5781f355d7b3c96a28062d50d575fa3e'},
{'LLVM-18.1.8_envintest.patch': '8e25dfab8a29a860717b4bd2d8cdd0e795433766d7fffbda32d06a2bde47058d'},
{'LLVM-19.1.7_libomptarget_tests.patch': '79a67c118d034cfb74e255696369150c73432d2b422f4834efacb26f7904edbf'},
{'LLVM-19.1.7_clang_rpathwrap_test.patch': '5ee6a87ec8ff1c8b736ffe0513aa2098bd2b83a1ffc647a1ad2cf966f567e8a1'},
]
local_gcc_version = '13.3.0'
local_gcc_compiler = ('GCCcore', local_gcc_version)
builddependencies = [
('binutils', '2.42'),
('Python', '3.12.3'),
('CMake', '3.29.3'),
('psutil', '6.0.0'), # Needed to enable test timeout in lit
('lit', '18.1.8'),
('git', '2.45.1'),
]
dependencies = [
('libxml2', '2.12.7'),
('ncurses', '6.5'),
('zlib', '1.3.1'),
('Z3', '4.13.0'),
('CUDA', '12.6.0', '', SYSTEM),
]
build_shared_libs = True
bootstrap = False
full_llvm = False
build_clang_extras = False
build_runtimes = True
build_lld = True
build_lldb = False
build_bolt = True
build_openmp = True
build_openmp_tools = True
build_openmp_offload = True
usepolly = True
python_bindings = False
build_targets = ['all']
# disable_werror = True
skip_all_tests = False
skip_sanitizer_tests = True
test_suite_max_failed = 10
test_suite_timeout_single = 5 * 60
test_suite_ignore_patterns = [
"X86/register-fragments-bolt-symbols.s",
"modularize/ProblemsCoverage.modularize",
"Driver/atomic.f90",
"Driver/gcc-toolchain-install-dir.f90",
"api_tests/test_ompd_get_icv_from_scope.c",
]
# LLVM will produce .mod files for its flang installation at the 3rd stage of the build via Clang+Flang
# These should not be checked for sanity, as we want to build LLVM on top of GCCcore to be used as a new toolchain
skip_mod_files_sanity_check = True
amd_gfx_list = ['gfx1201']
moduleclass = 'compiler' |
|
Test report by @Thyre Overview of tested easyconfigs (in order)
Build succeeded for 1 out of 1 (1 easyconfigs in total) Test with explicit CUDA dependency and an external ROCm module loaded. No NVIDIA drivers present: |
Co-authored-by: Alexander Grund <[email protected]>
Signed-off-by: Jan André Reuter <[email protected]>
Signed-off-by: Jan André Reuter <[email protected]>
|
@boegelbot please test @ jsc-zen3-a100 |
|
@Crivella: Request for testing this PR well received on jsczen3l1.int.jsc-zen3.fz-juelich.de PR test command '
Test results coming soon (I hope)... - notification for comment with ID 3018220653 processed Message to humans: this is just bookkeeping information for me, |
|
Test report by @boegelbot Overview of tested easyconfigs (in order)
Build succeeded for 1 out of 1 (1 easyconfigs in total) |
Manual test report
|
Manual test report
|
Crivella
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Going in, thanks @Thyre! |
|
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 0 out of 3 (3 easyconfigs in total) |
|
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 1 out of 3 (3 easyconfigs in total) |
|
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 2 out of 3 (3 easyconfigs in total) |
|
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 2 out of 3 (3 easyconfigs in total) |
|
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 2 out of 3 (3 easyconfigs in total) |
|
Al these tests do not have the fix for #3758 right? |
|
True, forgot about that, that might be a reason. But I see LLVM-18.1.8-GCCcore-13.3.0.eb failing throughout all PRs even the fixed one. That's why I ran the test for this. |
See also easybuild-easyblocks/easybuild/easyblocks/l/llvm.py Lines 1153 to 1156 in 1d80183
How do the test failures look like? |
|
I see a lot nvptx64 failures and the following errors in various tests: |
|
I mean, the In any case, we should probably go from just checking |
|
I think I got it:
So the ignore part is never added. And indeed if I extract the parsing code, manually add the pattern and run on the same output I get:
PR incoming |
|
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 0 out of 1 (1 easyconfigs in total) |
|
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 0 out of 1 (1 easyconfigs in total) |
For LLVM 18, we set |
|
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 1 out of 1 (1 easyconfigs in total) |
|
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 0 out of 1 (1 easyconfigs in total) |
dlopen for AMDGPU/CUDA libomptarget / offload target libraries
Avoid linking in a system CUDA / ROCm by mistake by forcing LLVM to use
dlopenthe libraries instead. This also removes the need to pass in these libraries as dependencies when building LLVM altogether, except if testing of the built libraries is wanted.This should only really matter for systems where a system ROCm or CUDA exists.