Repository navigation
feat :: --cpu-target builds for another CPU target - #451
Merged
Merged
Conversation
gen_cpuid_rules.py maps the features a target lacks to the CPUID bits to clear through GCC's own tables; gen_profiles.py assembles the profile data file from targets.toml and the rule files. Rules exist for zen2, zen3, zen4, skylake_avx512, cascadelake, icelake and sapphirerapids.
…ROMACS SIMD level
The cpuid route runs the build in an unprivileged user and mount namespace that keeps the caller's uid, with a target /proc/cpuinfo bound over the real one and a preload library that answers CPUID as the target. A preflight inside the mask refuses the build unless EESSI archdetect, archspec, gcc and the CPUID vendor all name the target. The kvm and tcg routes call the __vm-run helper and refuse while this binary has none. The installed tree is audited with audit-isa unless --no-audit, and each installed directory gets easybuild/eb-local-build-mode.json. doctor --cpu-target reports what the host can present.
…ic declarations and the doctor option
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Base:
develop. Second of three PRs that merge in this order:feat/isa-audit,feat/cpu-target(this one),feat/cpu-target-vm. This branch containsdevelop(merged in, 57 commits) andfeat/isa-audit, so oncefeat/isa-audithas merged this PR shows only the--cpu-targetwork. It does not contain__vm-run; that arrives withfeat/cpu-target-vm.What
eb-local --cpu-target TARGET recipe.ebbuilds for another CPU target on this machine and installs it where EESSI-extend puts software for that target. TARGET is an EESSI subdirectory (x86_64/amd/zen4) or its last component (zen4).--mask auto|cpuid|kvm|tcgpicks the route;autotakescpuidwhere the host can present the target, elsekvm(same architecture), elsetcg. The host's own target needs no mask.This PR has the
cpuidroute and the shared parts:ccon first use, cached by source hash, target triple and libc version), with the target's/proc/cpuinfobound in an unprivileged user and mount namespace that keeps the caller's uid (a mapped root makes OpenMPI's prterun refuse). aarch64: maskedgetauxvalplus the same cpuinfo bind.share/eb-local/mask/profiles.conf, generated bytools/mask/gen_profiles.pyfromtools/mask/targets.tomland the CPUID rule files made bytools/mask/gen_cpuid_rules.py./dev/fd, EESSI archdetect, archspec (when importable),gcc -march=nativeand the CPUID vendor all name the target, and CPUID faulting is active. A host without faulting is refused; there is no native fallback.EESSI_SOFTWARE_SUBDIR_OVERRIDEis set to the target, and EasyBuild runs the stack's hooks plus one rule: GROMACS gets-DGMX_SIMDfrom the target, because GROMACS times FMA units for an Intel brand string and a Zen 5 host picks AVX2 for an Icelake tree.eb-local audit-isa DIR --target TARGETruns on each installed directory; a non-zero exit fails the run (--no-auditskips it). Each directory getseasybuild/eb-local-build-mode.json(route, profile, host CPU, kernel, version, audit result).--explain, replay hints and thesubmitsbatch lines carry the options;doctor --cpu-targetreports faulting,/dev/kvm, QEMU binaries and the routeautotakes.--mask kvm|tcgcalleb-local __vm-run --mode MODE --cpu-target TARGET [--allow-archspec-mismatch] -- COMMAND...and refuse, naming__vm-run, while this binary has none;feat/cpu-target-vmadds it. The audit step refuses the same way, without--no-audit, whileaudit-isais missing; withfeat/isa-auditmerged it is present.Checks
On a Zen 5 host (Ryzen 9 9950X, kernel 7.0), EESSI 2026.06 mounted,
cpuidroute, audit on:bzip2-1.0.8-GCCcore-15.2.0.eb --rebuildunder--cpu-target x86_64/amd/zen3andx86_64/amd/zen4(2 min 14 s and 2 min 7 s): preflight ok for archdetect, archspec,gcc -march=native(znver3,znver4), CPUID vendor and faulting; the audit step ran on the installed directory and passed;easybuild/eb-local-build-mode.jsonholds"route": "cpuid"and"isa_audit": "pass"in both trees.eb-local audit-isaon the installed trees: zen3-built against zen3 and zen4, exit 0; zen4-built against zen4, exit 0; zen4-built againstx86_64/amd/zen3, exit 1 withavx512f x486,avx512bw x113,avx512vl x307,avx512dq x46,avx512vbmi x4inbunzip2andbzcat.zlib-2.3.2-GCCcore-15.2.0.ebunder the zen3 mask passes its own audit: zlib-ng's run-time dispatched AVX-512 kernels print asdispatch(feat/isa-auditlists zlib).eb_hooks.pyand setsGMX_SIMD=AVX_512for icelake,AVX2_256for zen3, and leaves an explicit-DGMX_SIMD=alone.zig build unit: 208 tests pass.zig build -Dtest-ops=true test: the same 43 failure lines asdevelopat aecc5a5 on this host, none new. CI: zig (x86_64 and aarch64) and shellcheck green on the merge commit (runs 45916937124 and 45916937205).The aarch64 profiles are unit-tested for parsing, cpuinfo rewriting and preflight decisions; the
tcgroute infeat/cpu-target-vmexercises the aarch64 target under emulation.