From 9d06a89345d751c40b83fb298c8608e01dfddf23 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 05:34:10 +0200 Subject: [PATCH 01/55] alternative to detect cpu arch for path --- init/eessi_archdetect.sh | 70 ++++++++++++++++++++++++++++++++ init/eessi_environment_variables | 12 ++++-- 2 files changed, 79 insertions(+), 3 deletions(-) create mode 100755 init/eessi_archdetect.sh diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh new file mode 100755 index 0000000000..e9514ee439 --- /dev/null +++ b/init/eessi_archdetect.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +# current pathways implemented in EESSI +# x86_64/generic +# x86_64/intel/haswell +# x86_64/intel/skylake_avx512 +# x86_64/amd/zen2 +# x86_64/amd/zen3 +# aarch64/generic +# ppc64le/generic +# ppc64le/power9le + +ARGUMENT=${1:-none} + +cpupath () { + # let the kernel tell base machine type + MACHINE_TYPE=$(uname -m) + + # fallback path + CPU_PATH="${MACHINE_TYPE}/generic" + + if [ ${MACHINE_TYPE} == "aarch64" ]; then + echo ${CPU_PATH} + exit + fi + + if [ ${MACHINE_TYPE} == "ppc64le" ]; then + echo ${CPU_PATH} "not sure what to do next..." + echo "please mail output of lscpu to me..." + exit + fi + + if [ ${MACHINE_TYPE} == "x86_64" ]; then + # check for vendor info, if available, for x86_64 + CPUINFO_VENDOR_FLAG=$(grep -m 1 ^vendor_id /proc/cpuinfo) + [[ $CPUINFO_VENDOR_FLAG =~ .*GenuineIntel* ]] && CPU_VENDOR=intel + [[ $CPU_VENDOR_FLAG =~ .*AuthenticAMD* ]] && CPU_VENDOR=amd + + CPU_FLAGS=$(grep -m 1 ^flags /proc/cpuinfo) + [[ $CPU_FLAGS =~ .*avx2* ]] && HAS_AVX2=true + [[ $CPU_FLAGS =~ .*fma* ]] && HAS_FMA=true + [[ $CPU_FLAGS =~ .*avx512f* ]] && HAS_AVX512F=true + [[ $CPU_FLAGS =~ .*avx512vl* ]] && HAS_AVX512VL=true + [[ $CPU_FLAGS =~ .*avx512ifma* ]] && HAS_AVX512IFMA=true + [[ $CPU_FLAGS =~ .*avx512_vbmi2* ]] && HAS_AVX512_VBMI2=true + [[ $CPU_FLAGS =~ .*avx512_vnni* ]] && HAS_AVX512_VNNI=true + [[ $CPU_FLAGS =~ .*avx512fp16* ]] && HAS_AVX512FP16=true + + [[ ${CPU_VENDOR} == "intel" ]] && [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && CPU_TYPE=haswell + [[ ${CPU_VENDOR} == "intel" ]] && [[ ${HAS_AVX512F} ]] && CPU_TYPE=skylake_avx512 + # [[ ${HAS_AVX512IFMA} ]] && [[ ${HAS_AVX512_VBMI2} ]] && CPU_TYPE=icelake_avx512 + # [[ ${HAS_AVX512_VNNI} ]] && [[ ${HAS_AVX512VL} ]] && [[ ${HAS_AVX512FP16} ]] && CPU_TYPE=sapphire_rapids_avx512 + + [[ ${CPU_VENDOR} ]] && [[ $CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${CPU_VENDOR}/${CPU_TYPE}" + + echo ${CPU_PATH} + exit + fi + + echo "should not see this...something weird going on..." + echo "please mail output of lscpu to me..." +} + +if [ ${ARGUMENT} == "none" ]; then + echo usage: $0 cpupath + exit +elif [ ${ARGUMENT} == "cpupath" ]; then + echo $(cpupath) + exit +fi diff --git a/init/eessi_environment_variables b/init/eessi_environment_variables index 34dc8f9f98..caf935751e 100644 --- a/init/eessi_environment_variables +++ b/init/eessi_environment_variables @@ -25,9 +25,15 @@ if [ -d $EESSI_PREFIX ]; then if [ -d $EESSI_EPREFIX ]; then # determine subdirectory in software layer - # note: eessi_software_subdir_for_host.py will pick up value from $EESSI_SOFTWARE_SUBDIR_OVERRIDE if it's defined! - export EESSI_EPREFIX_PYTHON=$EESSI_EPREFIX/usr/bin/python3 - export EESSI_SOFTWARE_SUBDIR=$($EESSI_EPREFIX_PYTHON ${EESSI_INIT_DIR_PATH}/eessi_software_subdir_for_host.py $EESSI_PREFIX) + if [ -z $EESSI_USE_ARCHDETECT ]; then + # if archdetect is enabled, use internal code + export EESSI_SOFTWARE_SUBDIR=$(${EESSI_INIT_DIR_PATH}/eessi_archdetect.sh cpupath) + echo "archdetect says ${EESSI_SOFTWARE_SUBDIR}" + else + # note: eessi_software_subdir_for_host.py will pick up value from $EESSI_SOFTWARE_SUBDIR_OVERRIDE if it's defined! + export EESSI_EPREFIX_PYTHON=$EESSI_EPREFIX/usr/bin/python3 + export EESSI_SOFTWARE_SUBDIR=$($EESSI_EPREFIX_PYTHON ${EESSI_INIT_DIR_PATH}/eessi_software_subdir_for_host.py $EESSI_PREFIX) + fi if [ ! -z $EESSI_SOFTWARE_SUBDIR ]; then echo "Using ${EESSI_SOFTWARE_SUBDIR} as software subdirectory." >> $output From 898b4d564be11119178246343c8aa306a5d10355 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 06:34:29 +0200 Subject: [PATCH 02/55] adding support for amd detection --- init/eessi_archdetect.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index e9514ee439..2463741283 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -45,12 +45,16 @@ cpupath () { [[ $CPU_FLAGS =~ .*avx512_vbmi2* ]] && HAS_AVX512_VBMI2=true [[ $CPU_FLAGS =~ .*avx512_vnni* ]] && HAS_AVX512_VNNI=true [[ $CPU_FLAGS =~ .*avx512fp16* ]] && HAS_AVX512FP16=true + [[ $CPU_FLAGS =~ .*vaes* ]] && HAS_VAES=true [[ ${CPU_VENDOR} == "intel" ]] && [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && CPU_TYPE=haswell [[ ${CPU_VENDOR} == "intel" ]] && [[ ${HAS_AVX512F} ]] && CPU_TYPE=skylake_avx512 # [[ ${HAS_AVX512IFMA} ]] && [[ ${HAS_AVX512_VBMI2} ]] && CPU_TYPE=icelake_avx512 # [[ ${HAS_AVX512_VNNI} ]] && [[ ${HAS_AVX512VL} ]] && [[ ${HAS_AVX512FP16} ]] && CPU_TYPE=sapphire_rapids_avx512 + [[ ${CPU_VENDOR} == "amd" ]] && [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && CPU_TYPE=zen2 + [[ ${CPU_VENDOR} == "amd" ]] && [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && [[ ${HAS_VAES} ]] && CPU_TYPE=zen3 + [[ ${CPU_VENDOR} ]] && [[ $CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${CPU_VENDOR}/${CPU_TYPE}" echo ${CPU_PATH} From 46e0c070a0bcb6a62343c9f80eaef0630a88acf6 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 06:38:05 +0200 Subject: [PATCH 03/55] document example lscpu outputs which is input to archdetect --- init/archdetect.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 init/archdetect.md diff --git a/init/archdetect.md b/init/archdetect.md new file mode 100644 index 0000000000..8d371d14ea --- /dev/null +++ b/init/archdetect.md @@ -0,0 +1,64 @@ +# archdetect + +bash based script to detect e.g. cpu architectures and provide cpupath for setting pointer to optimized software + + +example lscpu outputs: + +# Zen2 +Architecture: x86_64 +CPU op-mode(s): 32-bit, 64-bit +Byte Order: Little Endian +CPU(s): 120 +On-line CPU(s) list: 0-119 +Thread(s) per core: 1 +Core(s) per socket: 60 +Socket(s): 2 +NUMA node(s): 4 +Vendor ID: AuthenticAMD +CPU family: 23 +Model: 49 +Model name: AMD EPYC 7V12 64-Core Processor +Stepping: 0 +CPU MHz: 2445.424 +BogoMIPS: 4890.84 +Hypervisor vendor: Microsoft +Virtualization type: full +L1d cache: 32K +L1i cache: 32K +L2 cache: 512K +L3 cache: 16384K +NUMA node0 CPU(s): 0-29 +NUMA node1 CPU(s): 30-59 +NUMA node2 CPU(s): 60-89 +NUMA node3 CPU(s): 90-119 +Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm art rep_good nopl extd_apicid aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext retpoline_amd ssbd vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat umip + +# Zen3 +Architecture: x86_64 +CPU op-mode(s): 32-bit, 64-bit +Byte Order: Little Endian +CPU(s): 120 +On-line CPU(s) list: 0-119 +Thread(s) per core: 1 +Core(s) per socket: 60 +Socket(s): 2 +NUMA node(s): 4 +Vendor ID: AuthenticAMD +CPU family: 25 +Model: 1 +Model name: AMD EPYC 7V73X 64-Core Processor +Stepping: 2 +CPU MHz: 1846.550 +BogoMIPS: 3693.10 +Hypervisor vendor: Microsoft +Virtualization type: full +L1d cache: 32K +L1i cache: 32K +L2 cache: 512K +L3 cache: 98304K +NUMA node0 CPU(s): 0-29 +NUMA node1 CPU(s): 30-59 +NUMA node2 CPU(s): 60-89 +NUMA node3 CPU(s): 90-119 +Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm art rep_good nopl extd_apicid aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core invpcid_single retpoline_amd vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat umip vaes vpclmulqdq From eb9f8911f0815d4efcae91a94cc112c1ccce61f6 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 07:28:42 +0200 Subject: [PATCH 04/55] add arm ampere altra lscpu example --- init/archdetect.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/init/archdetect.md b/init/archdetect.md index 8d371d14ea..384567ad4a 100644 --- a/init/archdetect.md +++ b/init/archdetect.md @@ -62,3 +62,35 @@ NUMA node1 CPU(s): 30-59 NUMA node2 CPU(s): 60-89 NUMA node3 CPU(s): 90-119 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm art rep_good nopl extd_apicid aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core invpcid_single retpoline_amd vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat umip vaes vpclmulqdq + +# Arm Ampere Altra +Architecture: aarch64 +CPU op-mode(s): 32-bit, 64-bit +Byte Order: Little Endian +CPU(s): 64 +On-line CPU(s) list: 0-63 +Thread(s) per core: 1 +Core(s) per socket: 64 +Socket(s): 1 +NUMA node(s): 1 +Vendor ID: ARM +Model: 1 +Model name: Neoverse-N1 +Stepping: r3p1 +BogoMIPS: 50.00 +L1d cache: 4 MiB +L1i cache: 4 MiB +L2 cache: 64 MiB +L3 cache: 32 MiB +NUMA node0 CPU(s): 0-63 +Vulnerability Itlb multihit: Not affected +Vulnerability L1tf: Not affected +Vulnerability Mds: Not affected +Vulnerability Meltdown: Mitigation; PTI +Vulnerability Mmio stale data: Not affected +Vulnerability Spec store bypass: Not affected +Vulnerability Spectre v1: Mitigation; __user pointer sanitization +Vulnerability Spectre v2: Mitigation; CSV2, BHB +Vulnerability Srbds: Not affected +Vulnerability Tsx async abort: Not affected +Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp From 2c561a497d943f2c8a0f6bf3c610d0f62b2d6339 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 08:26:11 +0200 Subject: [PATCH 05/55] allow overrides for unittesting and make cpu_vendor more readable --- init/eessi_archdetect.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index 2463741283..5785b9db22 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -14,7 +14,7 @@ ARGUMENT=${1:-none} cpupath () { # let the kernel tell base machine type - MACHINE_TYPE=$(uname -m) + MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} # fallback path CPU_PATH="${MACHINE_TYPE}/generic" @@ -32,11 +32,12 @@ cpupath () { if [ ${MACHINE_TYPE} == "x86_64" ]; then # check for vendor info, if available, for x86_64 - CPUINFO_VENDOR_FLAG=$(grep -m 1 ^vendor_id /proc/cpuinfo) + PROC_CPUINFO=${EESSI_PROC_CPUINFO:-/proc/cpuinfo} + CPUINFO_VENDOR_FLAG=$(grep -m 1 ^vendor_id ${PROC_CPUINFO}) [[ $CPUINFO_VENDOR_FLAG =~ .*GenuineIntel* ]] && CPU_VENDOR=intel [[ $CPU_VENDOR_FLAG =~ .*AuthenticAMD* ]] && CPU_VENDOR=amd - CPU_FLAGS=$(grep -m 1 ^flags /proc/cpuinfo) + CPU_FLAGS=$(grep -m 1 ^flags ${PROC_CPUINFO}) [[ $CPU_FLAGS =~ .*avx2* ]] && HAS_AVX2=true [[ $CPU_FLAGS =~ .*fma* ]] && HAS_FMA=true [[ $CPU_FLAGS =~ .*avx512f* ]] && HAS_AVX512F=true @@ -47,13 +48,15 @@ cpupath () { [[ $CPU_FLAGS =~ .*avx512fp16* ]] && HAS_AVX512FP16=true [[ $CPU_FLAGS =~ .*vaes* ]] && HAS_VAES=true - [[ ${CPU_VENDOR} == "intel" ]] && [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && CPU_TYPE=haswell - [[ ${CPU_VENDOR} == "intel" ]] && [[ ${HAS_AVX512F} ]] && CPU_TYPE=skylake_avx512 - # [[ ${HAS_AVX512IFMA} ]] && [[ ${HAS_AVX512_VBMI2} ]] && CPU_TYPE=icelake_avx512 - # [[ ${HAS_AVX512_VNNI} ]] && [[ ${HAS_AVX512VL} ]] && [[ ${HAS_AVX512FP16} ]] && CPU_TYPE=sapphire_rapids_avx512 - - [[ ${CPU_VENDOR} == "amd" ]] && [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && CPU_TYPE=zen2 - [[ ${CPU_VENDOR} == "amd" ]] && [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && [[ ${HAS_VAES} ]] && CPU_TYPE=zen3 + if [ ${CPU_VENDOR} == "intel" ]; then + [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && CPU_TYPE=haswell + [[ ${HAS_AVX512F} ]] && CPU_TYPE=skylake_avx512 + # [[ ${HAS_AVX512IFMA} ]] && [[ ${HAS_AVX512_VBMI2} ]] && CPU_TYPE=icelake_avx512 + # [[ ${HAS_AVX512_VNNI} ]] && [[ ${HAS_AVX512VL} ]] && [[ ${HAS_AVX512FP16} ]] && CPU_TYPE=sapphire_rapids_avx512 + elif [ ${CPU_VENDOR} == "amd" ]; then + [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && CPU_TYPE=zen2 + [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && [[ ${HAS_VAES} ]] && CPU_TYPE=zen3 + fi [[ ${CPU_VENDOR} ]] && [[ $CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${CPU_VENDOR}/${CPU_TYPE}" From 0dd9a2a3cb9e9a79b6f6bdf0d00b56567991c92c Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 08:31:53 +0200 Subject: [PATCH 06/55] adding ref files for lscpu for unit tests --- tests/archdetect/x86_64/amd/zen2 | 27 +++++++++++++++++++++++++++ tests/archdetect/x86_64/amd/zen3 | 27 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 tests/archdetect/x86_64/amd/zen2 create mode 100644 tests/archdetect/x86_64/amd/zen3 diff --git a/tests/archdetect/x86_64/amd/zen2 b/tests/archdetect/x86_64/amd/zen2 new file mode 100644 index 0000000000..edf9c3e15b --- /dev/null +++ b/tests/archdetect/x86_64/amd/zen2 @@ -0,0 +1,27 @@ +Architecture: x86_64 +CPU op-mode(s): 32-bit, 64-bit +Byte Order: Little Endian +CPU(s): 120 +On-line CPU(s) list: 0-119 +Thread(s) per core: 1 +Core(s) per socket: 60 +Socket(s): 2 +NUMA node(s): 4 +Vendor ID: AuthenticAMD +CPU family: 23 +Model: 49 +Model name: AMD EPYC 7V12 64-Core Processor +Stepping: 0 +CPU MHz: 2445.424 +BogoMIPS: 4890.84 +Hypervisor vendor: Microsoft +Virtualization type: full +L1d cache: 32K +L1i cache: 32K +L2 cache: 512K +L3 cache: 16384K +NUMA node0 CPU(s): 0-29 +NUMA node1 CPU(s): 30-59 +NUMA node2 CPU(s): 60-89 +NUMA node3 CPU(s): 90-119 +Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm art rep_good nopl extd_apicid aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext retpoline_amd ssbd vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat umip diff --git a/tests/archdetect/x86_64/amd/zen3 b/tests/archdetect/x86_64/amd/zen3 new file mode 100644 index 0000000000..24961c80c3 --- /dev/null +++ b/tests/archdetect/x86_64/amd/zen3 @@ -0,0 +1,27 @@ +Architecture: x86_64 +CPU op-mode(s): 32-bit, 64-bit +Byte Order: Little Endian +CPU(s): 120 +On-line CPU(s) list: 0-119 +Thread(s) per core: 1 +Core(s) per socket: 60 +Socket(s): 2 +NUMA node(s): 4 +Vendor ID: AuthenticAMD +CPU family: 25 +Model: 1 +Model name: AMD EPYC 7V73X 64-Core Processor +Stepping: 2 +CPU MHz: 1846.550 +BogoMIPS: 3693.10 +Hypervisor vendor: Microsoft +Virtualization type: full +L1d cache: 32K +L1i cache: 32K +L2 cache: 512K +L3 cache: 98304K +NUMA node0 CPU(s): 0-29 +NUMA node1 CPU(s): 30-59 +NUMA node2 CPU(s): 60-89 +NUMA node3 CPU(s): 90-119 +Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm art rep_good nopl extd_apicid aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core invpcid_single retpoline_amd vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat umip vaes vpclmulqdq From 4914394291d23943fb9458ddc3f01dcf748ad2e5 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Thu, 15 Sep 2022 13:53:09 +0200 Subject: [PATCH 07/55] add CI workflow to test cpu_archdetect.yml --- .github/workflows/tests_archdetect.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/tests_archdetect.yml diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml new file mode 100644 index 0000000000..c54eef94fa --- /dev/null +++ b/.github/workflows/tests_archdetect.yml @@ -0,0 +1,25 @@ +# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions +name: Tests for eessi_archdetect.sh +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-20.04 + strategy: + matrix: + proc_cpuinfo: + - x86_64/intel/haswell + - x86_64/amd/zen2 + fail-fast: false + steps: + - uses: actions/checkout@v2 + + - name: test eessi_archdetect.sh + run: | + export EESSI_PROC_CPUINFO=./tests/archdetect/${{matrix.proc_cpuinfo}} + CPU_ARCH=$(./init/eessi_archdetect.sh cpupath) + if [[ $CPU_ARCH == "${{matrix.python}}" ]]; then + echo "Test for ${{matrix.proc_cpuinfo}} PASSED: $CPU_ARCH" >&2 + else + echo "Test for ${{matrix.proc_cpuinfo}} FAILED: $CPU_ARCH" >&2 + exit 1 + fi From 0aab86fb418d63c6675f4fda4234eb541db43db6 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 09:06:39 +0200 Subject: [PATCH 08/55] ignore case in cpuinfo to allow CentOS & Ubuntu --- init/eessi_archdetect.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index 5785b9db22..e8f24aadc9 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -33,11 +33,11 @@ cpupath () { if [ ${MACHINE_TYPE} == "x86_64" ]; then # check for vendor info, if available, for x86_64 PROC_CPUINFO=${EESSI_PROC_CPUINFO:-/proc/cpuinfo} - CPUINFO_VENDOR_FLAG=$(grep -m 1 ^vendor_id ${PROC_CPUINFO}) + CPUINFO_VENDOR_FLAG=$(grep -m 1 -i ^vendor ${PROC_CPUINFO}) [[ $CPUINFO_VENDOR_FLAG =~ .*GenuineIntel* ]] && CPU_VENDOR=intel - [[ $CPU_VENDOR_FLAG =~ .*AuthenticAMD* ]] && CPU_VENDOR=amd + [[ $CPUINFO_VENDOR_FLAG =~ .*AuthenticAMD* ]] && CPU_VENDOR=amd - CPU_FLAGS=$(grep -m 1 ^flags ${PROC_CPUINFO}) + CPU_FLAGS=$(grep -m 1 -i ^flags ${PROC_CPUINFO}) [[ $CPU_FLAGS =~ .*avx2* ]] && HAS_AVX2=true [[ $CPU_FLAGS =~ .*fma* ]] && HAS_FMA=true [[ $CPU_FLAGS =~ .*avx512f* ]] && HAS_AVX512F=true From c51613d91dcc81bf565e8f1ae49d85cd9ada19f9 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 09:13:23 +0200 Subject: [PATCH 09/55] correct variable for positive check --- .github/workflows/tests_archdetect.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index c54eef94fa..8035cb8a9e 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -17,7 +17,7 @@ jobs: run: | export EESSI_PROC_CPUINFO=./tests/archdetect/${{matrix.proc_cpuinfo}} CPU_ARCH=$(./init/eessi_archdetect.sh cpupath) - if [[ $CPU_ARCH == "${{matrix.python}}" ]]; then + if [[ $CPU_ARCH == "${{matrix.proc_cpuinfo}}" ]]; then echo "Test for ${{matrix.proc_cpuinfo}} PASSED: $CPU_ARCH" >&2 else echo "Test for ${{matrix.proc_cpuinfo}} FAILED: $CPU_ARCH" >&2 From d31887407fee46ed3dc58b73e2d94c280e59d00e Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 09:16:58 +0200 Subject: [PATCH 10/55] add testcases for intel cpuinfo --- tests/archdetect/x86_64/intel/haswell | 25 ++++++++++++++++++++ tests/archdetect/x86_64/intel/skylake_avx512 | 25 ++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 tests/archdetect/x86_64/intel/haswell create mode 100644 tests/archdetect/x86_64/intel/skylake_avx512 diff --git a/tests/archdetect/x86_64/intel/haswell b/tests/archdetect/x86_64/intel/haswell new file mode 100644 index 0000000000..7bb5aa958f --- /dev/null +++ b/tests/archdetect/x86_64/intel/haswell @@ -0,0 +1,25 @@ +processor : 0 +vendor_id : GenuineIntel +cpu family : 6 +model : 63 +model name : Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz +stepping : 2 +microcode : 0x3c +cpu MHz : 1757.910 +cache size : 30720 KB +physical id : 0 +siblings : 12 +core id : 0 +cpu cores : 12 +apicid : 0 +initial apicid : 0 +fpu : yes +fpu_exception : yes +cpuid level : 15 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc ibpb ibrs stibp dtherm arat pln pts spec_ctrl intel_stibp +bogomips : 4987.97 +clflush size : 64 +cache_alignment : 64 +address sizes : 46 bits physical, 48 bits virtual +power management: diff --git a/tests/archdetect/x86_64/intel/skylake_avx512 b/tests/archdetect/x86_64/intel/skylake_avx512 new file mode 100644 index 0000000000..e9ab1987dd --- /dev/null +++ b/tests/archdetect/x86_64/intel/skylake_avx512 @@ -0,0 +1,25 @@ +processor : 0 +vendor_id : GenuineIntel +cpu family : 6 +model : 85 +model name : Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz +stepping : 4 +microcode : 0x200004d +cpu MHz : 2600.000 +cache size : 19712 KB +physical id : 0 +siblings : 14 +core id : 0 +cpu cores : 14 +apicid : 0 +initial apicid : 0 +fpu : yes +fpu_exception : yes +cpuid level : 22 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 cdp_l3 invpcid_single intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local ibpb ibrs stibp dtherm ida arat pln pts spec_ctrl intel_stibp ssbd +bogomips : 5200.00 +clflush size : 64 +cache_alignment : 64 +address sizes : 46 bits physical, 48 bits virtual +power management: From 978e16a4a5fcf75b7f3d3963cdc5ab012a66814a Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 09:18:59 +0200 Subject: [PATCH 11/55] add testcases for intel and amd cpuinfo --- .github/workflows/tests_archdetect.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index 8035cb8a9e..9a26efe437 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -8,7 +8,9 @@ jobs: matrix: proc_cpuinfo: - x86_64/intel/haswell + - x86_64/intel/skylake_avx512 - x86_64/amd/zen2 + - x86_64/amd/zen3 fail-fast: false steps: - uses: actions/checkout@v2 From 4a9fc68497699f58000c9abd53c5a77139591403 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 09:34:04 +0200 Subject: [PATCH 12/55] add power9 detection --- init/eessi_archdetect.sh | 8 ++++++-- tests/archdetect/ppc64le/power9le | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 tests/archdetect/ppc64le/power9le diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index e8f24aadc9..3b2fc2986a 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -25,8 +25,12 @@ cpupath () { fi if [ ${MACHINE_TYPE} == "ppc64le" ]; then - echo ${CPU_PATH} "not sure what to do next..." - echo "please mail output of lscpu to me..." + PROC_CPUINFO=${EESSI_PROC_CPUINFO:-/proc/cpuinfo} + CPU_FLAGS=$(grep -m 1 -i ^cpu ${PROC_CPUINFO}) + [[ $CPU_FLAGS =~ .*POWER9* ]] && HAS_POWER9=true + + [[ ${HAS_POWER9} ]] && CPU_PATH=${MACHINE_TYPE}/power9le + echo ${CPU_PATH} exit fi diff --git a/tests/archdetect/ppc64le/power9le b/tests/archdetect/ppc64le/power9le new file mode 100644 index 0000000000..4e6bdbb97b --- /dev/null +++ b/tests/archdetect/ppc64le/power9le @@ -0,0 +1,4 @@ +processor : 0 +cpu : POWER9 (architected), altivec supported +clock : 2200.000000MHz +revision : 2.2 (pvr 004e 1202) From a7fc80adcf4ce09ccae44f09ac50dbc082a8a61b Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 09:34:55 +0200 Subject: [PATCH 13/55] add power9 test --- .github/workflows/tests_archdetect.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index 9a26efe437..8fbe8d7946 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -11,6 +11,7 @@ jobs: - x86_64/intel/skylake_avx512 - x86_64/amd/zen2 - x86_64/amd/zen3 + - ppc64le/power9le fail-fast: false steps: - uses: actions/checkout@v2 From 636ef94bd57f7a25519c42402a730bc07c5437b8 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 09:54:49 +0200 Subject: [PATCH 14/55] update matrix --- .github/workflows/tests_archdetect.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index 8fbe8d7946..54dccf76f5 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -6,18 +6,29 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: + machine_type: + - x86_64 + - ppc64le proc_cpuinfo: - x86_64/intel/haswell - x86_64/intel/skylake_avx512 - x86_64/amd/zen2 - x86_64/amd/zen3 - ppc64le/power9le + exclude: + - machine_type: x86_64 + proc_cpuinfo: ppc64le/power9le + - machine_type: ppc64le + include: + - machine_type: ppc64le + proc_cpuinfo: ppc64le/power9le fail-fast: false steps: - uses: actions/checkout@v2 - name: test eessi_archdetect.sh run: | + export EESSI_MACHINE_TYPE=${{matrix.machine_type}} export EESSI_PROC_CPUINFO=./tests/archdetect/${{matrix.proc_cpuinfo}} CPU_ARCH=$(./init/eessi_archdetect.sh cpupath) if [[ $CPU_ARCH == "${{matrix.proc_cpuinfo}}" ]]; then From 78f76ffb68b87484547033c3a8cda0ac510609c1 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 10:10:18 +0200 Subject: [PATCH 15/55] remove matrix --- .github/workflows/tests_archdetect.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index 54dccf76f5..124a95ca74 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -6,29 +6,19 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - machine_type: - - x86_64 - - ppc64le proc_cpuinfo: - x86_64/intel/haswell - x86_64/intel/skylake_avx512 - x86_64/amd/zen2 - x86_64/amd/zen3 - ppc64le/power9le - exclude: - - machine_type: x86_64 - proc_cpuinfo: ppc64le/power9le - - machine_type: ppc64le - include: - - machine_type: ppc64le - proc_cpuinfo: ppc64le/power9le fail-fast: false steps: - uses: actions/checkout@v2 - name: test eessi_archdetect.sh run: | - export EESSI_MACHINE_TYPE=${{matrix.machine_type}} + export EESSI_MACHINE_TYPE=${{matrix.proc_cpuinfo%%/*}} export EESSI_PROC_CPUINFO=./tests/archdetect/${{matrix.proc_cpuinfo}} CPU_ARCH=$(./init/eessi_archdetect.sh cpupath) if [[ $CPU_ARCH == "${{matrix.proc_cpuinfo}}" ]]; then From 09d822d3ddd6ad3b12b3c633e79c83bee8d8aeef Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 10:11:53 +0200 Subject: [PATCH 16/55] remove matrix --- .github/workflows/tests_archdetect.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index 124a95ca74..b5d51ea3c8 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -18,7 +18,8 @@ jobs: - name: test eessi_archdetect.sh run: | - export EESSI_MACHINE_TYPE=${{matrix.proc_cpuinfo%%/*}} + export EESSI_MACHINE_TYPE=${{matrix.proc_cpuinfo}} + export EESSI_MACHINE_TYPE=${EESSI_MACHINE_TYPE%%/*} export EESSI_PROC_CPUINFO=./tests/archdetect/${{matrix.proc_cpuinfo}} CPU_ARCH=$(./init/eessi_archdetect.sh cpupath) if [[ $CPU_ARCH == "${{matrix.proc_cpuinfo}}" ]]; then From e821c4e4dddfbe2404b8b45d6d70febd9d75843f Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 10:26:55 +0200 Subject: [PATCH 17/55] code cleanup --- init/eessi_archdetect.sh | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index 3b2fc2986a..9a9b8f793e 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -15,6 +15,7 @@ ARGUMENT=${1:-none} cpupath () { # let the kernel tell base machine type MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} + PROC_CPUINFO=${EESSI_PROC_CPUINFO:-/proc/cpuinfo} # fallback path CPU_PATH="${MACHINE_TYPE}/generic" @@ -25,9 +26,8 @@ cpupath () { fi if [ ${MACHINE_TYPE} == "ppc64le" ]; then - PROC_CPUINFO=${EESSI_PROC_CPUINFO:-/proc/cpuinfo} CPU_FLAGS=$(grep -m 1 -i ^cpu ${PROC_CPUINFO}) - [[ $CPU_FLAGS =~ .*POWER9* ]] && HAS_POWER9=true + [[ $CPU_FLAGS =~ ".* POWER9 *" ]] && HAS_POWER9=true [[ ${HAS_POWER9} ]] && CPU_PATH=${MACHINE_TYPE}/power9le echo ${CPU_PATH} @@ -36,21 +36,20 @@ cpupath () { if [ ${MACHINE_TYPE} == "x86_64" ]; then # check for vendor info, if available, for x86_64 - PROC_CPUINFO=${EESSI_PROC_CPUINFO:-/proc/cpuinfo} CPUINFO_VENDOR_FLAG=$(grep -m 1 -i ^vendor ${PROC_CPUINFO}) - [[ $CPUINFO_VENDOR_FLAG =~ .*GenuineIntel* ]] && CPU_VENDOR=intel - [[ $CPUINFO_VENDOR_FLAG =~ .*AuthenticAMD* ]] && CPU_VENDOR=amd + [[ $CPUINFO_VENDOR_FLAG =~ ".*GenuineIntel*" ]] && CPU_VENDOR=intel + [[ $CPUINFO_VENDOR_FLAG =~ ".*AuthenticAMD*" ]] && CPU_VENDOR=amd CPU_FLAGS=$(grep -m 1 -i ^flags ${PROC_CPUINFO}) - [[ $CPU_FLAGS =~ .*avx2* ]] && HAS_AVX2=true - [[ $CPU_FLAGS =~ .*fma* ]] && HAS_FMA=true - [[ $CPU_FLAGS =~ .*avx512f* ]] && HAS_AVX512F=true - [[ $CPU_FLAGS =~ .*avx512vl* ]] && HAS_AVX512VL=true - [[ $CPU_FLAGS =~ .*avx512ifma* ]] && HAS_AVX512IFMA=true - [[ $CPU_FLAGS =~ .*avx512_vbmi2* ]] && HAS_AVX512_VBMI2=true - [[ $CPU_FLAGS =~ .*avx512_vnni* ]] && HAS_AVX512_VNNI=true - [[ $CPU_FLAGS =~ .*avx512fp16* ]] && HAS_AVX512FP16=true - [[ $CPU_FLAGS =~ .*vaes* ]] && HAS_VAES=true + [[ $CPU_FLAGS =~ ".*avx2*" ]] && HAS_AVX2=true + [[ $CPU_FLAGS =~ ".*fma*" ]] && HAS_FMA=true + [[ $CPU_FLAGS =~ ".*avx512f*" ]] && HAS_AVX512F=true + [[ $CPU_FLAGS =~ ".*avx512vl*" ]] && HAS_AVX512VL=true + [[ $CPU_FLAGS =~ ".*avx512ifma*" ]] && HAS_AVX512IFMA=true + [[ $CPU_FLAGS =~ ".*avx512_vbmi2*" ]] && HAS_AVX512_VBMI2=true + [[ $CPU_FLAGS =~ ".*avx512_vnni*" ]] && HAS_AVX512_VNNI=true + [[ $CPU_FLAGS =~ ".*avx512fp16*" ]] && HAS_AVX512FP16=true + [[ $CPU_FLAGS =~ ".*vaes*" ]] && HAS_VAES=true if [ ${CPU_VENDOR} == "intel" ]; then [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && CPU_TYPE=haswell From c7d3e2bb656e068b5bb35def399573a51008f384 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 10:42:17 +0200 Subject: [PATCH 18/55] code cleanup --- init/eessi_archdetect.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index 9a9b8f793e..cfb05c0204 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -27,7 +27,7 @@ cpupath () { if [ ${MACHINE_TYPE} == "ppc64le" ]; then CPU_FLAGS=$(grep -m 1 -i ^cpu ${PROC_CPUINFO}) - [[ $CPU_FLAGS =~ ".* POWER9 *" ]] && HAS_POWER9=true + [[ $CPU_FLAGS =~ " POWER9( |$)" ]] && HAS_POWER9=true [[ ${HAS_POWER9} ]] && CPU_PATH=${MACHINE_TYPE}/power9le echo ${CPU_PATH} @@ -37,19 +37,19 @@ cpupath () { if [ ${MACHINE_TYPE} == "x86_64" ]; then # check for vendor info, if available, for x86_64 CPUINFO_VENDOR_FLAG=$(grep -m 1 -i ^vendor ${PROC_CPUINFO}) - [[ $CPUINFO_VENDOR_FLAG =~ ".*GenuineIntel*" ]] && CPU_VENDOR=intel + [[ $CPUINFO_VENDOR_FLAG =~ "GenuineIntel" ]] && CPU_VENDOR=intel [[ $CPUINFO_VENDOR_FLAG =~ ".*AuthenticAMD*" ]] && CPU_VENDOR=amd CPU_FLAGS=$(grep -m 1 -i ^flags ${PROC_CPUINFO}) - [[ $CPU_FLAGS =~ ".*avx2*" ]] && HAS_AVX2=true - [[ $CPU_FLAGS =~ ".*fma*" ]] && HAS_FMA=true - [[ $CPU_FLAGS =~ ".*avx512f*" ]] && HAS_AVX512F=true - [[ $CPU_FLAGS =~ ".*avx512vl*" ]] && HAS_AVX512VL=true - [[ $CPU_FLAGS =~ ".*avx512ifma*" ]] && HAS_AVX512IFMA=true - [[ $CPU_FLAGS =~ ".*avx512_vbmi2*" ]] && HAS_AVX512_VBMI2=true - [[ $CPU_FLAGS =~ ".*avx512_vnni*" ]] && HAS_AVX512_VNNI=true - [[ $CPU_FLAGS =~ ".*avx512fp16*" ]] && HAS_AVX512FP16=true - [[ $CPU_FLAGS =~ ".*vaes*" ]] && HAS_VAES=true + [[ $CPU_FLAGS =~ " avx2( |$)" ]] && HAS_AVX2=true + [[ $CPU_FLAGS =~ " fma( |$)" ]] && HAS_FMA=true + [[ $CPU_FLAGS =~ " avx512f( |$)" ]] && HAS_AVX512F=true + [[ $CPU_FLAGS =~ " avx512vl( |$)" ]] && HAS_AVX512VL=true + [[ $CPU_FLAGS =~ " avx512ifma( |$)" ]] && HAS_AVX512IFMA=true + [[ $CPU_FLAGS =~ " avx512_vbmi2( |$)" ]] && HAS_AVX512_VBMI2=true + [[ $CPU_FLAGS =~ " avx512_vnni( |$)" ]] && HAS_AVX512_VNNI=true + [[ $CPU_FLAGS =~ " avx512fp16( |$)" ]] && HAS_AVX512FP16=true + [[ $CPU_FLAGS =~ " vaes( |$)" ]] && HAS_VAES=true if [ ${CPU_VENDOR} == "intel" ]; then [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && CPU_TYPE=haswell From 36e8fa4f48f19460479f296f1caa76787b88bb72 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 10:50:39 +0200 Subject: [PATCH 19/55] code cleanup --- init/eessi_archdetect.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index cfb05c0204..f9f9871fe9 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -27,7 +27,7 @@ cpupath () { if [ ${MACHINE_TYPE} == "ppc64le" ]; then CPU_FLAGS=$(grep -m 1 -i ^cpu ${PROC_CPUINFO}) - [[ $CPU_FLAGS =~ " POWER9( |$)" ]] && HAS_POWER9=true + [[ $CPU_FLAGS =~ " POWER9 " ]] && HAS_POWER9=true [[ ${HAS_POWER9} ]] && CPU_PATH=${MACHINE_TYPE}/power9le echo ${CPU_PATH} @@ -38,18 +38,18 @@ cpupath () { # check for vendor info, if available, for x86_64 CPUINFO_VENDOR_FLAG=$(grep -m 1 -i ^vendor ${PROC_CPUINFO}) [[ $CPUINFO_VENDOR_FLAG =~ "GenuineIntel" ]] && CPU_VENDOR=intel - [[ $CPUINFO_VENDOR_FLAG =~ ".*AuthenticAMD*" ]] && CPU_VENDOR=amd + [[ $CPUINFO_VENDOR_FLAG =~ "AuthenticAMD" ]] && CPU_VENDOR=amd - CPU_FLAGS=$(grep -m 1 -i ^flags ${PROC_CPUINFO}) - [[ $CPU_FLAGS =~ " avx2( |$)" ]] && HAS_AVX2=true - [[ $CPU_FLAGS =~ " fma( |$)" ]] && HAS_FMA=true - [[ $CPU_FLAGS =~ " avx512f( |$)" ]] && HAS_AVX512F=true - [[ $CPU_FLAGS =~ " avx512vl( |$)" ]] && HAS_AVX512VL=true - [[ $CPU_FLAGS =~ " avx512ifma( |$)" ]] && HAS_AVX512IFMA=true - [[ $CPU_FLAGS =~ " avx512_vbmi2( |$)" ]] && HAS_AVX512_VBMI2=true - [[ $CPU_FLAGS =~ " avx512_vnni( |$)" ]] && HAS_AVX512_VNNI=true - [[ $CPU_FLAGS =~ " avx512fp16( |$)" ]] && HAS_AVX512FP16=true - [[ $CPU_FLAGS =~ " vaes( |$)" ]] && HAS_VAES=true + CPU_FLAGS=$(grep -m 1 -i ^flags ${PROC_CPUINFO} | sed 's/$/ /g') + [[ $CPU_FLAGS =~ " avx2 " ]] && HAS_AVX2=true + [[ $CPU_FLAGS =~ " fma " ]] && HAS_FMA=true + [[ $CPU_FLAGS =~ " avx512f " ]] && HAS_AVX512F=true + [[ $CPU_FLAGS =~ " avx512vl " ]] && HAS_AVX512VL=true + [[ $CPU_FLAGS =~ " avx512ifma " ]] && HAS_AVX512IFMA=true + [[ $CPU_FLAGS =~ " avx512_vbmi2 " ]] && HAS_AVX512_VBMI2=true + [[ $CPU_FLAGS =~ " avx512_vnni " ]] && HAS_AVX512_VNNI=true + [[ $CPU_FLAGS =~ " avx512fp16 " ]] && HAS_AVX512FP16=true + [[ $CPU_FLAGS =~ " vaes " ]] && HAS_VAES=true if [ ${CPU_VENDOR} == "intel" ]; then [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && CPU_TYPE=haswell From e796e4f26549be77de1c4c2874eefe8cf666c12a Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 11:04:39 +0200 Subject: [PATCH 20/55] code cleanup --- init/eessi_archdetect.sh | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index f9f9871fe9..3dcc5a70d6 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -27,9 +27,9 @@ cpupath () { if [ ${MACHINE_TYPE} == "ppc64le" ]; then CPU_FLAGS=$(grep -m 1 -i ^cpu ${PROC_CPUINFO}) - [[ $CPU_FLAGS =~ " POWER9 " ]] && HAS_POWER9=true + [[ $CPU_FLAGS =~ " POWER9 " ]] && EESSI_HAS_POWER9=true - [[ ${HAS_POWER9} ]] && CPU_PATH=${MACHINE_TYPE}/power9le + [[ ${EESSI_HAS_POWER9} ]] && CPU_PATH=${MACHINE_TYPE}/power9le echo ${CPU_PATH} exit fi @@ -37,31 +37,31 @@ cpupath () { if [ ${MACHINE_TYPE} == "x86_64" ]; then # check for vendor info, if available, for x86_64 CPUINFO_VENDOR_FLAG=$(grep -m 1 -i ^vendor ${PROC_CPUINFO}) - [[ $CPUINFO_VENDOR_FLAG =~ "GenuineIntel" ]] && CPU_VENDOR=intel - [[ $CPUINFO_VENDOR_FLAG =~ "AuthenticAMD" ]] && CPU_VENDOR=amd + [[ $CPUINFO_VENDOR_FLAG =~ "GenuineIntel" ]] && EESSI_CPU_VENDOR=intel + [[ $CPUINFO_VENDOR_FLAG =~ "AuthenticAMD" ]] && EESSI_CPU_VENDOR=amd CPU_FLAGS=$(grep -m 1 -i ^flags ${PROC_CPUINFO} | sed 's/$/ /g') - [[ $CPU_FLAGS =~ " avx2 " ]] && HAS_AVX2=true - [[ $CPU_FLAGS =~ " fma " ]] && HAS_FMA=true - [[ $CPU_FLAGS =~ " avx512f " ]] && HAS_AVX512F=true - [[ $CPU_FLAGS =~ " avx512vl " ]] && HAS_AVX512VL=true - [[ $CPU_FLAGS =~ " avx512ifma " ]] && HAS_AVX512IFMA=true - [[ $CPU_FLAGS =~ " avx512_vbmi2 " ]] && HAS_AVX512_VBMI2=true - [[ $CPU_FLAGS =~ " avx512_vnni " ]] && HAS_AVX512_VNNI=true - [[ $CPU_FLAGS =~ " avx512fp16 " ]] && HAS_AVX512FP16=true - [[ $CPU_FLAGS =~ " vaes " ]] && HAS_VAES=true + [[ $CPU_FLAGS =~ " avx2 " ]] && EESSI_HAS_AVX2=true + [[ $CPU_FLAGS =~ " fma " ]] && EESSI_HAS_FMA=true + [[ $CPU_FLAGS =~ " avx512f " ]] && EESSI_HAS_AVX512F=true + [[ $CPU_FLAGS =~ " avx512vl " ]] && EESSI_HAS_AVX512VL=true + [[ $CPU_FLAGS =~ " avx512ifma " ]] && EESSI_HAS_AVX512IFMA=true + [[ $CPU_FLAGS =~ " avx512_vbmi2 " ]] && EESSI_HAS_AVX512_VBMI2=true + [[ $CPU_FLAGS =~ " avx512_vnni " ]] && EESSI_HAS_AVX512_VNNI=true + [[ $CPU_FLAGS =~ " avx512fp16 " ]] && EESSI_HAS_AVX512FP16=true + [[ $CPU_FLAGS =~ " vaes " ]] && EESSI_HAS_VAES=true - if [ ${CPU_VENDOR} == "intel" ]; then - [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && CPU_TYPE=haswell - [[ ${HAS_AVX512F} ]] && CPU_TYPE=skylake_avx512 + if [ ${EESSI_CPU_VENDOR} == "intel" ]; then + [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && EESSI_CPU_TYPE=haswell + [[ ${EESSI_HAS_AVX512F} ]] && EESSI_CPU_TYPE=skylake_avx512 # [[ ${HAS_AVX512IFMA} ]] && [[ ${HAS_AVX512_VBMI2} ]] && CPU_TYPE=icelake_avx512 # [[ ${HAS_AVX512_VNNI} ]] && [[ ${HAS_AVX512VL} ]] && [[ ${HAS_AVX512FP16} ]] && CPU_TYPE=sapphire_rapids_avx512 - elif [ ${CPU_VENDOR} == "amd" ]; then - [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && CPU_TYPE=zen2 - [[ ${HAS_AVX2} ]] && [[ ${HAS_FMA} ]] && [[ ${HAS_VAES} ]] && CPU_TYPE=zen3 + elif [ ${EESSI_CPU_VENDOR} == "amd" ]; then + [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && CPU_TYPE=zen2 + [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && [[ ${EESSI_HAS_VAES} ]] && CPU_TYPE=zen3 fi - [[ ${CPU_VENDOR} ]] && [[ $CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${CPU_VENDOR}/${CPU_TYPE}" + [[ ${EESSI_CPU_VENDOR} ]] && [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_VENDOR}/${EESSI_CPU_TYPE}" echo ${CPU_PATH} exit From 572143e866fa4249d8d29d1888b063966a688bc0 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 11:06:36 +0200 Subject: [PATCH 21/55] code cleanup --- init/eessi_archdetect.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index 3dcc5a70d6..09feff8c36 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -57,8 +57,8 @@ cpupath () { # [[ ${HAS_AVX512IFMA} ]] && [[ ${HAS_AVX512_VBMI2} ]] && CPU_TYPE=icelake_avx512 # [[ ${HAS_AVX512_VNNI} ]] && [[ ${HAS_AVX512VL} ]] && [[ ${HAS_AVX512FP16} ]] && CPU_TYPE=sapphire_rapids_avx512 elif [ ${EESSI_CPU_VENDOR} == "amd" ]; then - [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && CPU_TYPE=zen2 - [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && [[ ${EESSI_HAS_VAES} ]] && CPU_TYPE=zen3 + [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && EESSI_CPU_TYPE=zen2 + [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && [[ ${EESSI_HAS_VAES} ]] && EESSI_CPU_TYPE=zen3 fi [[ ${EESSI_CPU_VENDOR} ]] && [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_VENDOR}/${EESSI_CPU_TYPE}" From b3c9b13b75e8d907f9786fdff8fb890280cbb06a Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 11:17:20 +0200 Subject: [PATCH 22/55] add aarch64 cpuinfo test data --- tests/archdetect/aarch64/graviton2 | 8 ++++++++ tests/archdetect/aarch64/graviton3 | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 tests/archdetect/aarch64/graviton2 create mode 100644 tests/archdetect/aarch64/graviton3 diff --git a/tests/archdetect/aarch64/graviton2 b/tests/archdetect/aarch64/graviton2 new file mode 100644 index 0000000000..17f1615825 --- /dev/null +++ b/tests/archdetect/aarch64/graviton2 @@ -0,0 +1,8 @@ +processor : 0 +BogoMIPS : 243.75 +Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs +CPU implementer : 0x41 +CPU architecture: 8 +CPU variant : 0x3 +CPU part : 0xd0c +CPU revision : 1 diff --git a/tests/archdetect/aarch64/graviton3 b/tests/archdetect/aarch64/graviton3 new file mode 100644 index 0000000000..01246f99da --- /dev/null +++ b/tests/archdetect/aarch64/graviton3 @@ -0,0 +1,8 @@ +processor : 0 +BogoMIPS : 2100.00 +Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm ssbs paca pacg dcpodp svei8mm svebf16 i8mm bf16 dgh rng +CPU implementer : 0x41 +CPU architecture: 8 +CPU variant : 0x1 +CPU part : 0xd40 +CPU revision : 1 From e8341a694bb3e645d9bdb7e9cf370daf5a0fe515 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Thu, 15 Sep 2022 11:23:49 +0200 Subject: [PATCH 23/55] add unset for feature vars --- init/eessi_archdetect.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index 09feff8c36..ada7149d62 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -16,6 +16,9 @@ cpupath () { # let the kernel tell base machine type MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} PROC_CPUINFO=${EESSI_PROC_CPUINFO:-/proc/cpuinfo} + + # clean up any existing pointers to cpu features + unset $(env | grep EESSI_HAS | cut -f1 -d=) # fallback path CPU_PATH="${MACHINE_TYPE}/generic" From 3ce8a01c890039e9cc9eccc6ea557b016e581f6b Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Fri, 16 Sep 2022 08:33:57 +0200 Subject: [PATCH 24/55] re-order power and add aarch64 detection --- init/eessi_archdetect.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index ada7149d62..571689a3d6 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -1,12 +1,14 @@ #!/bin/bash -# current pathways implemented in EESSI +# current pathways implemented in EESSI 2021.12 pilot version # x86_64/generic # x86_64/intel/haswell # x86_64/intel/skylake_avx512 # x86_64/amd/zen2 # x86_64/amd/zen3 # aarch64/generic +# aarch64/graviton2 +# aarch64/graviton3 # ppc64le/generic # ppc64le/power9le @@ -24,6 +26,14 @@ cpupath () { CPU_PATH="${MACHINE_TYPE}/generic" if [ ${MACHINE_TYPE} == "aarch64" ]; then + CPU_FLAGS=$(grep -m 1 -i ^flags ${PROC_CPUINFO} | sed 's/$/ /g') + [[ $CPU_FLAGS =~ " asimd " ]] && EESSI_HAS_ASIMD=true + [[ $CPU_FLAGS =~ " svei8mm " ]] && EESSI_HAS_SVEI8MM=true + + [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=graviton2 + [[ ${EESSI_HAS_SVEI8MM} ]] && EESSI_CPU_TYPE=graviton3 + + [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_TYPE}" echo ${CPU_PATH} exit fi @@ -32,7 +42,9 @@ cpupath () { CPU_FLAGS=$(grep -m 1 -i ^cpu ${PROC_CPUINFO}) [[ $CPU_FLAGS =~ " POWER9 " ]] && EESSI_HAS_POWER9=true - [[ ${EESSI_HAS_POWER9} ]] && CPU_PATH=${MACHINE_TYPE}/power9le + [[ ${EESSI_HAS_POWER9} ]] && EESSI_CPU_TYPE=power9le + + [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_TYPE}" echo ${CPU_PATH} exit fi From 30925e6e8953c143f436d1e482b5e30fdb0ad2ae Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Fri, 16 Sep 2022 08:35:29 +0200 Subject: [PATCH 25/55] add aarch64 tests --- .github/workflows/tests_archdetect.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index b5d51ea3c8..942bafe560 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -12,6 +12,8 @@ jobs: - x86_64/amd/zen2 - x86_64/amd/zen3 - ppc64le/power9le + - aarch64/graviton2 + - aarch64/graviton3 fail-fast: false steps: - uses: actions/checkout@v2 From e42e0a6f7076b7cf359ca963a906d471015874a8 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Fri, 16 Sep 2022 08:38:53 +0200 Subject: [PATCH 26/55] move to features for aarch64 --- init/eessi_archdetect.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index 571689a3d6..7680325417 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -26,7 +26,7 @@ cpupath () { CPU_PATH="${MACHINE_TYPE}/generic" if [ ${MACHINE_TYPE} == "aarch64" ]; then - CPU_FLAGS=$(grep -m 1 -i ^flags ${PROC_CPUINFO} | sed 's/$/ /g') + CPU_FLAGS=$(grep -m 1 -i ^features ${PROC_CPUINFO} | sed 's/$/ /g') [[ $CPU_FLAGS =~ " asimd " ]] && EESSI_HAS_ASIMD=true [[ $CPU_FLAGS =~ " svei8mm " ]] && EESSI_HAS_SVEI8MM=true From 51ddaa76603fc686bf68ec7e679334ded12acbb1 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Fri, 16 Sep 2022 08:53:41 +0200 Subject: [PATCH 27/55] add support for aarch64 neoverse-n1 --- init/eessi_archdetect.sh | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index 7680325417..d83242c00f 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -21,19 +21,33 @@ cpupath () { # clean up any existing pointers to cpu features unset $(env | grep EESSI_HAS | cut -f1 -d=) + unset EESSI_CPU_VENDOR # fallback path CPU_PATH="${MACHINE_TYPE}/generic" if [ ${MACHINE_TYPE} == "aarch64" ]; then - CPU_FLAGS=$(grep -m 1 -i ^features ${PROC_CPUINFO} | sed 's/$/ /g') - [[ $CPU_FLAGS =~ " asimd " ]] && EESSI_HAS_ASIMD=true - [[ $CPU_FLAGS =~ " svei8mm " ]] && EESSI_HAS_SVEI8MM=true - - [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=graviton2 - [[ ${EESSI_HAS_SVEI8MM} ]] && EESSI_CPU_TYPE=graviton3 + CPUINFO_VENDOR_FLAG=$(grep -m 1 -i ^vendor ${PROC_CPUINFO}) + [[ $CPUINFO_VENDOR_FLAG =~ "ARM" ]] && EESSI_CPU_VENDOR=arm + + if [ ${EESSI_CPU_VENDOR} == "arm" ]; then + CPU_FLAGS=$(grep -m 1 -i ^flags ${PROC_CPUINFO} | sed 's/$/ /g') + [[ $CPU_FLAGS =~ " asimd " ]] && EESSI_HAS_ASIMD=true + [[ $CPU_FLAGS =~ " svei8mm " ]] && EESSI_HAS_SVEI8MM=true + + [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=neoverse-n1 + [[ ${EESSI_HAS_SVEI8MM} ]] && EESSI_CPU_TYPE=neoverse-v1 + [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_VENDOR}/${EESSI_CPU_TYPE}" + else + CPU_FLAGS=$(grep -m 1 -i ^features ${PROC_CPUINFO} | sed 's/$/ /g') + [[ $CPU_FLAGS =~ " asimd " ]] && EESSI_HAS_ASIMD=true + [[ $CPU_FLAGS =~ " svei8mm " ]] && EESSI_HAS_SVEI8MM=true + + [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=graviton2 + [[ ${EESSI_HAS_SVEI8MM} ]] && EESSI_CPU_TYPE=graviton3 + [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_TYPE}" + fi - [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_TYPE}" echo ${CPU_PATH} exit fi From 38194b89ed7547734948c98384f59842fc0c4b5c Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Fri, 16 Sep 2022 08:54:24 +0200 Subject: [PATCH 28/55] add support for aarch64 neoverse-n1 --- tests/archdetect/aarch64/arm/neoverse-n1 | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/archdetect/aarch64/arm/neoverse-n1 diff --git a/tests/archdetect/aarch64/arm/neoverse-n1 b/tests/archdetect/aarch64/arm/neoverse-n1 new file mode 100644 index 0000000000..49824722f2 --- /dev/null +++ b/tests/archdetect/aarch64/arm/neoverse-n1 @@ -0,0 +1,30 @@ +Architecture: aarch64 +CPU op-mode(s): 32-bit, 64-bit +Byte Order: Little Endian +CPU(s): 64 +On-line CPU(s) list: 0-63 +Thread(s) per core: 1 +Core(s) per socket: 64 +Socket(s): 1 +NUMA node(s): 1 +Vendor ID: ARM +Model: 1 +Model name: Neoverse-N1 +Stepping: r3p1 +BogoMIPS: 50.00 +L1d cache: 4 MiB +L1i cache: 4 MiB +L2 cache: 64 MiB +L3 cache: 32 MiB +NUMA node0 CPU(s): 0-63 +Vulnerability Itlb multihit: Not affected +Vulnerability L1tf: Not affected +Vulnerability Mds: Not affected +Vulnerability Meltdown: Mitigation; PTI +Vulnerability Mmio stale data: Not affected +Vulnerability Spec store bypass: Not affected +Vulnerability Spectre v1: Mitigation; __user pointer sanitization +Vulnerability Spectre v2: Mitigation; CSV2, BHB +Vulnerability Srbds: Not affected +Vulnerability Tsx async abort: Not affected +Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp From d891813105f2eb34a5404bdd29b3b45918c53038 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Fri, 16 Sep 2022 08:55:09 +0200 Subject: [PATCH 29/55] add support for aarch64 neoverse-n1 --- .github/workflows/tests_archdetect.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index 942bafe560..51a6bcb4d8 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -14,6 +14,7 @@ jobs: - ppc64le/power9le - aarch64/graviton2 - aarch64/graviton3 + - aarch64/arm/neoverse-n1 fail-fast: false steps: - uses: actions/checkout@v2 From 0cd0af421b7b4be55f82224b6d5da423fd86040b Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Fri, 16 Sep 2022 09:48:13 +0200 Subject: [PATCH 30/55] add architecture-cpu comments --- init/eessi_archdetect.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index d83242c00f..c22ff4dfa3 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -35,7 +35,7 @@ cpupath () { [[ $CPU_FLAGS =~ " asimd " ]] && EESSI_HAS_ASIMD=true [[ $CPU_FLAGS =~ " svei8mm " ]] && EESSI_HAS_SVEI8MM=true - [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=neoverse-n1 + [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=neoverse-n1 #Ampere Altra [[ ${EESSI_HAS_SVEI8MM} ]] && EESSI_CPU_TYPE=neoverse-v1 [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_VENDOR}/${EESSI_CPU_TYPE}" else @@ -43,8 +43,8 @@ cpupath () { [[ $CPU_FLAGS =~ " asimd " ]] && EESSI_HAS_ASIMD=true [[ $CPU_FLAGS =~ " svei8mm " ]] && EESSI_HAS_SVEI8MM=true - [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=graviton2 - [[ ${EESSI_HAS_SVEI8MM} ]] && EESSI_CPU_TYPE=graviton3 + [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=graviton2 #AWS Graviton2 + [[ ${EESSI_HAS_SVEI8MM} ]] && EESSI_CPU_TYPE=graviton3 #AWS Graviton3 [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_TYPE}" fi @@ -56,7 +56,7 @@ cpupath () { CPU_FLAGS=$(grep -m 1 -i ^cpu ${PROC_CPUINFO}) [[ $CPU_FLAGS =~ " POWER9 " ]] && EESSI_HAS_POWER9=true - [[ ${EESSI_HAS_POWER9} ]] && EESSI_CPU_TYPE=power9le + [[ ${EESSI_HAS_POWER9} ]] && EESSI_CPU_TYPE=power9le #Power9 [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_TYPE}" echo ${CPU_PATH} @@ -81,13 +81,13 @@ cpupath () { [[ $CPU_FLAGS =~ " vaes " ]] && EESSI_HAS_VAES=true if [ ${EESSI_CPU_VENDOR} == "intel" ]; then - [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && EESSI_CPU_TYPE=haswell - [[ ${EESSI_HAS_AVX512F} ]] && EESSI_CPU_TYPE=skylake_avx512 + [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && EESSI_CPU_TYPE=haswell #Haswell, Broadwell + [[ ${EESSI_HAS_AVX512F} ]] && EESSI_CPU_TYPE=skylake_avx512 #Skylake, Cascade Lake # [[ ${HAS_AVX512IFMA} ]] && [[ ${HAS_AVX512_VBMI2} ]] && CPU_TYPE=icelake_avx512 # [[ ${HAS_AVX512_VNNI} ]] && [[ ${HAS_AVX512VL} ]] && [[ ${HAS_AVX512FP16} ]] && CPU_TYPE=sapphire_rapids_avx512 elif [ ${EESSI_CPU_VENDOR} == "amd" ]; then - [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && EESSI_CPU_TYPE=zen2 - [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && [[ ${EESSI_HAS_VAES} ]] && EESSI_CPU_TYPE=zen3 + [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && EESSI_CPU_TYPE=zen2 #Rome + [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && [[ ${EESSI_HAS_VAES} ]] && EESSI_CPU_TYPE=zen3 #Milan, Milan-X fi [[ ${EESSI_CPU_VENDOR} ]] && [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_VENDOR}/${EESSI_CPU_TYPE}" From 28c7b2310e10598bd5cc9671386a695729881fd0 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Fri, 16 Sep 2022 09:53:26 +0200 Subject: [PATCH 31/55] re-order aarch64 output and remove graviton --- init/eessi_archdetect.sh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index c22ff4dfa3..6ca9690eee 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -32,22 +32,17 @@ cpupath () { if [ ${EESSI_CPU_VENDOR} == "arm" ]; then CPU_FLAGS=$(grep -m 1 -i ^flags ${PROC_CPUINFO} | sed 's/$/ /g') - [[ $CPU_FLAGS =~ " asimd " ]] && EESSI_HAS_ASIMD=true - [[ $CPU_FLAGS =~ " svei8mm " ]] && EESSI_HAS_SVEI8MM=true - - [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=neoverse-n1 #Ampere Altra - [[ ${EESSI_HAS_SVEI8MM} ]] && EESSI_CPU_TYPE=neoverse-v1 - [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_VENDOR}/${EESSI_CPU_TYPE}" else CPU_FLAGS=$(grep -m 1 -i ^features ${PROC_CPUINFO} | sed 's/$/ /g') - [[ $CPU_FLAGS =~ " asimd " ]] && EESSI_HAS_ASIMD=true - [[ $CPU_FLAGS =~ " svei8mm " ]] && EESSI_HAS_SVEI8MM=true - - [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=graviton2 #AWS Graviton2 - [[ ${EESSI_HAS_SVEI8MM} ]] && EESSI_CPU_TYPE=graviton3 #AWS Graviton3 - [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_TYPE}" fi + [[ $CPU_FLAGS =~ " asimd " ]] && EESSI_HAS_ASIMD=true + [[ $CPU_FLAGS =~ " svei8mm " ]] && EESSI_HAS_SVEI8MM=true + + [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=neoverse-n1 #Ampere Altra + [[ ${EESSI_HAS_SVEI8MM} ]] && EESSI_CPU_TYPE=neoverse-v1 + [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_VENDOR}/${EESSI_CPU_TYPE}" + echo ${CPU_PATH} exit fi From ed42876f109e2ffebf4f1bc8dbd80b137e88920a Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Fri, 16 Sep 2022 09:56:40 +0200 Subject: [PATCH 32/55] re-order aarch64 output and remove graviton --- init/eessi_archdetect.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index 6ca9690eee..52f7af728e 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -38,9 +38,12 @@ cpupath () { [[ $CPU_FLAGS =~ " asimd " ]] && EESSI_HAS_ASIMD=true [[ $CPU_FLAGS =~ " svei8mm " ]] && EESSI_HAS_SVEI8MM=true - - [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=neoverse-n1 #Ampere Altra - [[ ${EESSI_HAS_SVEI8MM} ]] && EESSI_CPU_TYPE=neoverse-v1 + + # we will not return graviton2 as a result here, since then we get get graviton2 as a result while we're actually on a thunderx2, for example. + # We should break here with archspec, and symlink aarch64/arm/neoverse-n1 to aarch64/graviton2 in EESSI pilot 2021.12, + # and then the reverse in the next EESSI pilot (so it still works with archspec). + [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=neoverse-n1 # Ampere Altra, AWS graviton2 + [[ ${EESSI_HAS_SVEI8MM} ]] && EESSI_CPU_TYPE=neoverse-v1 # AWS graviton3 [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_VENDOR}/${EESSI_CPU_TYPE}" echo ${CPU_PATH} @@ -51,7 +54,7 @@ cpupath () { CPU_FLAGS=$(grep -m 1 -i ^cpu ${PROC_CPUINFO}) [[ $CPU_FLAGS =~ " POWER9 " ]] && EESSI_HAS_POWER9=true - [[ ${EESSI_HAS_POWER9} ]] && EESSI_CPU_TYPE=power9le #Power9 + [[ ${EESSI_HAS_POWER9} ]] && EESSI_CPU_TYPE=power9le # IBM Power9 [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_TYPE}" echo ${CPU_PATH} @@ -76,13 +79,13 @@ cpupath () { [[ $CPU_FLAGS =~ " vaes " ]] && EESSI_HAS_VAES=true if [ ${EESSI_CPU_VENDOR} == "intel" ]; then - [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && EESSI_CPU_TYPE=haswell #Haswell, Broadwell - [[ ${EESSI_HAS_AVX512F} ]] && EESSI_CPU_TYPE=skylake_avx512 #Skylake, Cascade Lake + [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && EESSI_CPU_TYPE=haswell # Intel Haswell, Broadwell + [[ ${EESSI_HAS_AVX512F} ]] && EESSI_CPU_TYPE=skylake_avx512 # Intel Skylake, Cascade Lake # [[ ${HAS_AVX512IFMA} ]] && [[ ${HAS_AVX512_VBMI2} ]] && CPU_TYPE=icelake_avx512 # [[ ${HAS_AVX512_VNNI} ]] && [[ ${HAS_AVX512VL} ]] && [[ ${HAS_AVX512FP16} ]] && CPU_TYPE=sapphire_rapids_avx512 elif [ ${EESSI_CPU_VENDOR} == "amd" ]; then - [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && EESSI_CPU_TYPE=zen2 #Rome - [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && [[ ${EESSI_HAS_VAES} ]] && EESSI_CPU_TYPE=zen3 #Milan, Milan-X + [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && EESSI_CPU_TYPE=zen2 # AMD Rome + [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && [[ ${EESSI_HAS_VAES} ]] && EESSI_CPU_TYPE=zen3 # AMD Milan, Milan-X fi [[ ${EESSI_CPU_VENDOR} ]] && [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_VENDOR}/${EESSI_CPU_TYPE}" From d0fdf4bfa620cf524d2d0b932a6dc40d13709d96 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Fri, 16 Sep 2022 10:15:25 +0200 Subject: [PATCH 33/55] remove graviton from test --- .github/workflows/tests_archdetect.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index 51a6bcb4d8..2b8b2f9465 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -12,8 +12,8 @@ jobs: - x86_64/amd/zen2 - x86_64/amd/zen3 - ppc64le/power9le - - aarch64/graviton2 - - aarch64/graviton3 + # - aarch64/graviton2 + # - aarch64/graviton3 - aarch64/arm/neoverse-n1 fail-fast: false steps: From 28999603e6f3089a85973cbd8a9aea798d3a0054 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Fri, 16 Sep 2022 10:21:08 +0200 Subject: [PATCH 34/55] move from /bin/bash to /usr/bin/env bash --- init/eessi_archdetect.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index 52f7af728e..4a598eafdc 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # current pathways implemented in EESSI 2021.12 pilot version # x86_64/generic From bbac2525de86b9d6e69e842648dbb61bbd4f6512 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Fri, 16 Sep 2022 11:15:47 +0200 Subject: [PATCH 35/55] synch output for archdetect / archspec --- init/eessi_environment_variables | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init/eessi_environment_variables b/init/eessi_environment_variables index caf935751e..d32a1c8279 100644 --- a/init/eessi_environment_variables +++ b/init/eessi_environment_variables @@ -28,11 +28,12 @@ if [ -d $EESSI_PREFIX ]; then if [ -z $EESSI_USE_ARCHDETECT ]; then # if archdetect is enabled, use internal code export EESSI_SOFTWARE_SUBDIR=$(${EESSI_INIT_DIR_PATH}/eessi_archdetect.sh cpupath) - echo "archdetect says ${EESSI_SOFTWARE_SUBDIR}" + echo "archdetect says ${EESSI_SOFTWARE_SUBDIR}" >> $output else # note: eessi_software_subdir_for_host.py will pick up value from $EESSI_SOFTWARE_SUBDIR_OVERRIDE if it's defined! export EESSI_EPREFIX_PYTHON=$EESSI_EPREFIX/usr/bin/python3 export EESSI_SOFTWARE_SUBDIR=$($EESSI_EPREFIX_PYTHON ${EESSI_INIT_DIR_PATH}/eessi_software_subdir_for_host.py $EESSI_PREFIX) + echo "archspec says ${EESSI_SOFTWARE_SUBDIR}" >> $output fi if [ ! -z $EESSI_SOFTWARE_SUBDIR ]; then From a5b4e8e5201d8de313b67bb727dd2f4f8bdf5aa7 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Mon, 19 Sep 2022 12:08:35 +0200 Subject: [PATCH 36/55] rewrite by Alex Domingo (lexming) --- init/arch_detect.sh | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 init/arch_detect.sh diff --git a/init/arch_detect.sh b/init/arch_detect.sh new file mode 100755 index 0000000000..d0516ac8ec --- /dev/null +++ b/init/arch_detect.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +# x86_64 CPU architecture specifications +arch_x86=() +arch_x86+=('("x86_64/intel/haswell" "GenuineIntel" "avx2 fma")') # Intel Haswell, Broadwell +arch_x86+=('("x86_64/intel/skylake_avx512" "GenuineIntel" "avx2 fma avx512f")') # Intel Skylake, Cascade Lake +arch_x86+=('("x86_64/amd/zen2" "AuthenticAMD" "avx2 fma")') # AMD Rome +arch_x86+=('("x86_64/amd/zen3" "AuthenticAMD" "avx2 fma vaes")') # AMD Milan, Milan-X + +# ARM CPU architecture specifications +arch_arm=() +arch_arm+=('("aarch64/arm/neoverse-n1" "ARM" "asimd")') # Ampere Altra +arch_arm+=('("aarch64/arm/neoverse-n1" "" "asimd")') # AWS Graviton2 +arch_arm+=('("aarch64/arm/neoverse-v1" "ARM" "asimd svei8mm")') +arch_arm+=('("aarch64/arm/neoverse-v1" "" "asimd svei8mm")') # AWS Graviton3 + +# CPU specification of host system +get_cpuinfo(){ + cpuinfo_pattern="^${1}\s*:" + #grep -i "$cpuinfo_pattern" /proc/cpuinfo | tail -n 1 | sed "s/$cpuinfo_pattern//" + grep -i "$cpuinfo_pattern" ${EESSI_PROC_CPUINFO:-/proc/cpuinfo} | tail -n 1 | sed "s/$cpuinfo_pattern//" +} + +#MACHINE_TYPE=$(uname -m) +MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} +echo cpu architecture seems to be $MACHINE_TYPE +[ "${MACHINE_TYPE}" == "x86_64" ] && CPU_ARCH_SPEC=("${arch_x86[@]}") +[ "${MACHINE_TYPE}" == "aarch64" ] && CPU_ARCH_SPEC=("${arch_arm[@]}") +[[ -z $CPU_ARCH_SPEC ]] && echo "ERROR: Unsupported CPU architecture $MACHINE_TYPE" && exit + +#CPU_VENDOR_TAG="vendor_id" +CPU_VENDOR_TAG="vendor[ _]id" +CPU_VENDOR=$(get_cpuinfo "$CPU_VENDOR_TAG") +CPU_VENDOR=$(echo ${CPU_VENDOR#*:} | xargs echo -n) +echo "== CPU vendor of host system: $CPU_VENDOR" >&2 + +CPU_FLAG_TAG='flags' +# cpuinfo of some ARM systems print features instead of flags +[ "${CPU_VENDOR}" == "ARM" ] && CPU_FLAG_TAG='flags' +[ "${MACHINE_TYPE}" == "aarch64" ] && [ "${CPU_VENDOR}x" == "x" ] && CPU_FLAG_TAG='features' + +CPU_FLAGS=$(get_cpuinfo "$CPU_FLAG_TAG") +echo "== CPU flags of host system: $CPU_FLAGS" >&2 + +# Default to generic CPU +BEST_MATCH="generic" + +# Find best match +check_flags(){ + for flag in "$@"; do + [[ " ${CPU_FLAGS[*]} " == *" $flag "* ]] || return 1 + done + return 0 +} + +for arch in "${CPU_ARCH_SPEC[@]}"; do + eval "arch_spec=$arch" + if [ "${CPU_VENDOR}x" == "${arch_spec[1]}x" ]; then + check_flags ${arch_spec[2]} && BEST_MATCH=${arch_spec[0]} + echo "== got a match with $BEST_MATCH" >&2 + fi +done + +echo "Best match is $BEST_MATCH" >&2 +echo "$BEST_MATCH" From 0d1daf422aa91c26c7c42787c0be95ea836fb33f Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Mon, 19 Sep 2022 12:11:22 +0200 Subject: [PATCH 37/55] move test to new code --- .github/workflows/tests_archdetect.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index 2b8b2f9465..c7eb41767f 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -24,7 +24,8 @@ jobs: export EESSI_MACHINE_TYPE=${{matrix.proc_cpuinfo}} export EESSI_MACHINE_TYPE=${EESSI_MACHINE_TYPE%%/*} export EESSI_PROC_CPUINFO=./tests/archdetect/${{matrix.proc_cpuinfo}} - CPU_ARCH=$(./init/eessi_archdetect.sh cpupath) + #CPU_ARCH=$(./init/eessi_archdetect.sh cpupath) + CPU_ARCH=$(./init/arch_detect.sh cpupath) if [[ $CPU_ARCH == "${{matrix.proc_cpuinfo}}" ]]; then echo "Test for ${{matrix.proc_cpuinfo}} PASSED: $CPU_ARCH" >&2 else From ce2dacae8f258bdc3532c94d2a3746520baf78fc Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Mon, 19 Sep 2022 12:14:19 +0200 Subject: [PATCH 38/55] redirecting output to err, keeping final echo --- init/arch_detect.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/arch_detect.sh b/init/arch_detect.sh index d0516ac8ec..74b308cf98 100755 --- a/init/arch_detect.sh +++ b/init/arch_detect.sh @@ -23,7 +23,7 @@ get_cpuinfo(){ #MACHINE_TYPE=$(uname -m) MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} -echo cpu architecture seems to be $MACHINE_TYPE +echo cpu architecture seems to be $MACHINE_TYPE >&2 [ "${MACHINE_TYPE}" == "x86_64" ] && CPU_ARCH_SPEC=("${arch_x86[@]}") [ "${MACHINE_TYPE}" == "aarch64" ] && CPU_ARCH_SPEC=("${arch_arm[@]}") [[ -z $CPU_ARCH_SPEC ]] && echo "ERROR: Unsupported CPU architecture $MACHINE_TYPE" && exit From 1d710951226e66ecf206fca7ade7f95bc35761af Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Mon, 19 Sep 2022 12:34:48 +0200 Subject: [PATCH 39/55] adding power to arch_detect --- init/arch_detect.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init/arch_detect.sh b/init/arch_detect.sh index 74b308cf98..a93256f678 100755 --- a/init/arch_detect.sh +++ b/init/arch_detect.sh @@ -14,6 +14,10 @@ arch_arm+=('("aarch64/arm/neoverse-n1" "" "asimd")') # AWS Graviton2 arch_arm+=('("aarch64/arm/neoverse-v1" "ARM" "asimd svei8mm")') arch_arm+=('("aarch64/arm/neoverse-v1" "" "asimd svei8mm")') # AWS Graviton3 +# Power CPU architecture specifications +arch_power=() +arch_power+=('("ppc64le/power9le" "" "POWER9")') # IBM Power9 + # CPU specification of host system get_cpuinfo(){ cpuinfo_pattern="^${1}\s*:" @@ -26,6 +30,7 @@ MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} echo cpu architecture seems to be $MACHINE_TYPE >&2 [ "${MACHINE_TYPE}" == "x86_64" ] && CPU_ARCH_SPEC=("${arch_x86[@]}") [ "${MACHINE_TYPE}" == "aarch64" ] && CPU_ARCH_SPEC=("${arch_arm[@]}") +[ "${MACHINE_TYPE}" == "ppc64le" ] && CPU_ARCH_SPEC=("${arch_power[@]}") [[ -z $CPU_ARCH_SPEC ]] && echo "ERROR: Unsupported CPU architecture $MACHINE_TYPE" && exit #CPU_VENDOR_TAG="vendor_id" @@ -35,9 +40,10 @@ CPU_VENDOR=$(echo ${CPU_VENDOR#*:} | xargs echo -n) echo "== CPU vendor of host system: $CPU_VENDOR" >&2 CPU_FLAG_TAG='flags' -# cpuinfo of some ARM systems print features instead of flags +# cpuinfo systems print different line identifiers, eg features, instead of flags [ "${CPU_VENDOR}" == "ARM" ] && CPU_FLAG_TAG='flags' [ "${MACHINE_TYPE}" == "aarch64" ] && [ "${CPU_VENDOR}x" == "x" ] && CPU_FLAG_TAG='features' +[ "${MACHINE_TYPE}" == "ppc64le" ] && CPU_FLAG_TAG='cpu' CPU_FLAGS=$(get_cpuinfo "$CPU_FLAG_TAG") echo "== CPU flags of host system: $CPU_FLAGS" >&2 From 70be449fc2e6f1f362a07cb86c92445e92a9e49c Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Mon, 19 Sep 2022 12:51:56 +0200 Subject: [PATCH 40/55] prep arch_detect for other functions, now: cpupath --- init/arch_detect.sh | 72 ++++++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/init/arch_detect.sh b/init/arch_detect.sh index a93256f678..ab7d96c986 100755 --- a/init/arch_detect.sh +++ b/init/arch_detect.sh @@ -25,32 +25,6 @@ get_cpuinfo(){ grep -i "$cpuinfo_pattern" ${EESSI_PROC_CPUINFO:-/proc/cpuinfo} | tail -n 1 | sed "s/$cpuinfo_pattern//" } -#MACHINE_TYPE=$(uname -m) -MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} -echo cpu architecture seems to be $MACHINE_TYPE >&2 -[ "${MACHINE_TYPE}" == "x86_64" ] && CPU_ARCH_SPEC=("${arch_x86[@]}") -[ "${MACHINE_TYPE}" == "aarch64" ] && CPU_ARCH_SPEC=("${arch_arm[@]}") -[ "${MACHINE_TYPE}" == "ppc64le" ] && CPU_ARCH_SPEC=("${arch_power[@]}") -[[ -z $CPU_ARCH_SPEC ]] && echo "ERROR: Unsupported CPU architecture $MACHINE_TYPE" && exit - -#CPU_VENDOR_TAG="vendor_id" -CPU_VENDOR_TAG="vendor[ _]id" -CPU_VENDOR=$(get_cpuinfo "$CPU_VENDOR_TAG") -CPU_VENDOR=$(echo ${CPU_VENDOR#*:} | xargs echo -n) -echo "== CPU vendor of host system: $CPU_VENDOR" >&2 - -CPU_FLAG_TAG='flags' -# cpuinfo systems print different line identifiers, eg features, instead of flags -[ "${CPU_VENDOR}" == "ARM" ] && CPU_FLAG_TAG='flags' -[ "${MACHINE_TYPE}" == "aarch64" ] && [ "${CPU_VENDOR}x" == "x" ] && CPU_FLAG_TAG='features' -[ "${MACHINE_TYPE}" == "ppc64le" ] && CPU_FLAG_TAG='cpu' - -CPU_FLAGS=$(get_cpuinfo "$CPU_FLAG_TAG") -echo "== CPU flags of host system: $CPU_FLAGS" >&2 - -# Default to generic CPU -BEST_MATCH="generic" - # Find best match check_flags(){ for flag in "$@"; do @@ -59,13 +33,51 @@ check_flags(){ return 0 } -for arch in "${CPU_ARCH_SPEC[@]}"; do +ARGUMENT=${1:-none} + +cpupath () { + #MACHINE_TYPE=$(uname -m) + MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} + echo cpu architecture seems to be $MACHINE_TYPE >&2 + [ "${MACHINE_TYPE}" == "x86_64" ] && CPU_ARCH_SPEC=("${arch_x86[@]}") + [ "${MACHINE_TYPE}" == "aarch64" ] && CPU_ARCH_SPEC=("${arch_arm[@]}") + [ "${MACHINE_TYPE}" == "ppc64le" ] && CPU_ARCH_SPEC=("${arch_power[@]}") + [[ -z $CPU_ARCH_SPEC ]] && echo "ERROR: Unsupported CPU architecture $MACHINE_TYPE" && exit + + #CPU_VENDOR_TAG="vendor_id" + CPU_VENDOR_TAG="vendor[ _]id" + CPU_VENDOR=$(get_cpuinfo "$CPU_VENDOR_TAG") + CPU_VENDOR=$(echo ${CPU_VENDOR#*:} | xargs echo -n) + echo "== CPU vendor of host system: $CPU_VENDOR" >&2 + + CPU_FLAG_TAG='flags' + # cpuinfo systems print different line identifiers, eg features, instead of flags + [ "${CPU_VENDOR}" == "ARM" ] && CPU_FLAG_TAG='flags' + [ "${MACHINE_TYPE}" == "aarch64" ] && [ "${CPU_VENDOR}x" == "x" ] && CPU_FLAG_TAG='features' + [ "${MACHINE_TYPE}" == "ppc64le" ] && CPU_FLAG_TAG='cpu' + + CPU_FLAGS=$(get_cpuinfo "$CPU_FLAG_TAG") + echo "== CPU flags of host system: $CPU_FLAGS" >&2 + + # Default to generic CPU + BEST_MATCH="generic" + + for arch in "${CPU_ARCH_SPEC[@]}"; do eval "arch_spec=$arch" if [ "${CPU_VENDOR}x" == "${arch_spec[1]}x" ]; then check_flags ${arch_spec[2]} && BEST_MATCH=${arch_spec[0]} echo "== got a match with $BEST_MATCH" >&2 fi -done + done + + echo "Best match is $BEST_MATCH" >&2 + echo "$BEST_MATCH" +} -echo "Best match is $BEST_MATCH" >&2 -echo "$BEST_MATCH" +if [ ${ARGUMENT} == "none" ]; then + echo usage: $0 cpupath + exit +elif [ ${ARGUMENT} == "cpupath" ]; then + echo $(cpupath) + exit +fi From a797d6def90027927260224dc0a80d2c301ee177 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Tue, 20 Sep 2022 09:11:56 +0200 Subject: [PATCH 41/55] renew tests schema --- .../x86_64/amd/{zen2 => zen2/Azure-CentOS7-7V12.cpuinfo} | 0 tests/archdetect/x86_64/amd/zen2/Azure-CentOS7-7V12.output | 1 + 2 files changed, 1 insertion(+) rename tests/archdetect/x86_64/amd/{zen2 => zen2/Azure-CentOS7-7V12.cpuinfo} (100%) create mode 100644 tests/archdetect/x86_64/amd/zen2/Azure-CentOS7-7V12.output diff --git a/tests/archdetect/x86_64/amd/zen2 b/tests/archdetect/x86_64/amd/zen2/Azure-CentOS7-7V12.cpuinfo similarity index 100% rename from tests/archdetect/x86_64/amd/zen2 rename to tests/archdetect/x86_64/amd/zen2/Azure-CentOS7-7V12.cpuinfo diff --git a/tests/archdetect/x86_64/amd/zen2/Azure-CentOS7-7V12.output b/tests/archdetect/x86_64/amd/zen2/Azure-CentOS7-7V12.output new file mode 100644 index 0000000000..9e4da0c5d6 --- /dev/null +++ b/tests/archdetect/x86_64/amd/zen2/Azure-CentOS7-7V12.output @@ -0,0 +1 @@ +x86_64/amd/zen2 From 8726b407bf20582d8c39812ea81d305b816072a2 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Tue, 20 Sep 2022 09:15:08 +0200 Subject: [PATCH 42/55] allow multiple tests scenarios --- .github/workflows/tests_archdetect.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index c7eb41767f..44104f1a23 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -9,7 +9,7 @@ jobs: proc_cpuinfo: - x86_64/intel/haswell - x86_64/intel/skylake_avx512 - - x86_64/amd/zen2 + - x86_64/amd/zen2/Azure-CentOS7-7V12 - x86_64/amd/zen3 - ppc64le/power9le # - aarch64/graviton2 @@ -23,10 +23,10 @@ jobs: run: | export EESSI_MACHINE_TYPE=${{matrix.proc_cpuinfo}} export EESSI_MACHINE_TYPE=${EESSI_MACHINE_TYPE%%/*} - export EESSI_PROC_CPUINFO=./tests/archdetect/${{matrix.proc_cpuinfo}} + export EESSI_PROC_CPUINFO=./tests/archdetect/${{matrix.proc_cpuinfo}}.cpuinfo #CPU_ARCH=$(./init/eessi_archdetect.sh cpupath) CPU_ARCH=$(./init/arch_detect.sh cpupath) - if [[ $CPU_ARCH == "${{matrix.proc_cpuinfo}}" ]]; then + if [[ $CPU_ARCH == "$( cat ${{matrix.proc_cpuinfo}}.output )" ]]; then echo "Test for ${{matrix.proc_cpuinfo}} PASSED: $CPU_ARCH" >&2 else echo "Test for ${{matrix.proc_cpuinfo}} FAILED: $CPU_ARCH" >&2 From 037abce956d213fa09903d685fe6a7e6e01c6ee2 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Tue, 20 Sep 2022 09:18:27 +0200 Subject: [PATCH 43/55] allow multiple tests scenarios --- .github/workflows/tests_archdetect.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index 44104f1a23..7fa5604804 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -26,7 +26,7 @@ jobs: export EESSI_PROC_CPUINFO=./tests/archdetect/${{matrix.proc_cpuinfo}}.cpuinfo #CPU_ARCH=$(./init/eessi_archdetect.sh cpupath) CPU_ARCH=$(./init/arch_detect.sh cpupath) - if [[ $CPU_ARCH == "$( cat ${{matrix.proc_cpuinfo}}.output )" ]]; then + if [[ $CPU_ARCH == "$( cat ./tests/archdetect/${{matrix.proc_cpuinfo}}.output )" ]]; then echo "Test for ${{matrix.proc_cpuinfo}} PASSED: $CPU_ARCH" >&2 else echo "Test for ${{matrix.proc_cpuinfo}} FAILED: $CPU_ARCH" >&2 From a31ce0e151b96de3c5c94badffb6fb46cafba9f3 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Tue, 20 Sep 2022 09:26:39 +0200 Subject: [PATCH 44/55] allow multiple tests scenarios --- .github/workflows/tests_archdetect.yml | 2 +- .../Azure-CentOS7-7V73X.cpuinfo} | 0 .../amd/zen3/Azure-CentOS7-7V73X.output | 1 + tests/archdetect/x86_64/intel/haswell | 25 ------------------- 4 files changed, 2 insertions(+), 26 deletions(-) rename tests/archdetect/x86_64/amd/{zen3 => zen3/Azure-CentOS7-7V73X.cpuinfo} (100%) create mode 100644 tests/archdetect/x86_64/amd/zen3/Azure-CentOS7-7V73X.output delete mode 100644 tests/archdetect/x86_64/intel/haswell diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index 7fa5604804..8509905f28 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -10,7 +10,7 @@ jobs: - x86_64/intel/haswell - x86_64/intel/skylake_avx512 - x86_64/amd/zen2/Azure-CentOS7-7V12 - - x86_64/amd/zen3 + - x86_64/amd/zen3/Azure-CentOS7-7V73X - ppc64le/power9le # - aarch64/graviton2 # - aarch64/graviton3 diff --git a/tests/archdetect/x86_64/amd/zen3 b/tests/archdetect/x86_64/amd/zen3/Azure-CentOS7-7V73X.cpuinfo similarity index 100% rename from tests/archdetect/x86_64/amd/zen3 rename to tests/archdetect/x86_64/amd/zen3/Azure-CentOS7-7V73X.cpuinfo diff --git a/tests/archdetect/x86_64/amd/zen3/Azure-CentOS7-7V73X.output b/tests/archdetect/x86_64/amd/zen3/Azure-CentOS7-7V73X.output new file mode 100644 index 0000000000..341c027cc2 --- /dev/null +++ b/tests/archdetect/x86_64/amd/zen3/Azure-CentOS7-7V73X.output @@ -0,0 +1 @@ +x86_64/amd/zen3 diff --git a/tests/archdetect/x86_64/intel/haswell b/tests/archdetect/x86_64/intel/haswell deleted file mode 100644 index 7bb5aa958f..0000000000 --- a/tests/archdetect/x86_64/intel/haswell +++ /dev/null @@ -1,25 +0,0 @@ -processor : 0 -vendor_id : GenuineIntel -cpu family : 6 -model : 63 -model name : Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz -stepping : 2 -microcode : 0x3c -cpu MHz : 1757.910 -cache size : 30720 KB -physical id : 0 -siblings : 12 -core id : 0 -cpu cores : 12 -apicid : 0 -initial apicid : 0 -fpu : yes -fpu_exception : yes -cpuid level : 15 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc ibpb ibrs stibp dtherm arat pln pts spec_ctrl intel_stibp -bogomips : 4987.97 -clflush size : 64 -cache_alignment : 64 -address sizes : 46 bits physical, 48 bits virtual -power management: From 95ae9202339a3f43cbccf5b7373279d88e53c6dd Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Tue, 20 Sep 2022 09:33:23 +0200 Subject: [PATCH 45/55] renewing tests --- .github/workflows/tests_archdetect.yml | 4 +-- .../haswell/archspec-linux-E5-2680-v3.cpuinfo | 25 +++++++++++++++++++ .../haswell/archspec-linux-E5-2680-v3.output | 1 + .../archspec-linux-6132.cpuinfo} | 0 .../skylake_avx512/archspec-linux-6132.output | 1 + 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 tests/archdetect/x86_64/intel/haswell/archspec-linux-E5-2680-v3.cpuinfo create mode 100644 tests/archdetect/x86_64/intel/haswell/archspec-linux-E5-2680-v3.output rename tests/archdetect/x86_64/intel/{skylake_avx512 => skylake_avx512/archspec-linux-6132.cpuinfo} (100%) create mode 100644 tests/archdetect/x86_64/intel/skylake_avx512/archspec-linux-6132.output diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index 8509905f28..1462fab22a 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -7,8 +7,8 @@ jobs: strategy: matrix: proc_cpuinfo: - - x86_64/intel/haswell - - x86_64/intel/skylake_avx512 + - x86_64/intel/haswell/archspec-linux-E5-2680-v3 + - x86_64/intel/skylake_avx512/archspec-linux-6132 - x86_64/amd/zen2/Azure-CentOS7-7V12 - x86_64/amd/zen3/Azure-CentOS7-7V73X - ppc64le/power9le diff --git a/tests/archdetect/x86_64/intel/haswell/archspec-linux-E5-2680-v3.cpuinfo b/tests/archdetect/x86_64/intel/haswell/archspec-linux-E5-2680-v3.cpuinfo new file mode 100644 index 0000000000..7bb5aa958f --- /dev/null +++ b/tests/archdetect/x86_64/intel/haswell/archspec-linux-E5-2680-v3.cpuinfo @@ -0,0 +1,25 @@ +processor : 0 +vendor_id : GenuineIntel +cpu family : 6 +model : 63 +model name : Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz +stepping : 2 +microcode : 0x3c +cpu MHz : 1757.910 +cache size : 30720 KB +physical id : 0 +siblings : 12 +core id : 0 +cpu cores : 12 +apicid : 0 +initial apicid : 0 +fpu : yes +fpu_exception : yes +cpuid level : 15 +wp : yes +flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc ibpb ibrs stibp dtherm arat pln pts spec_ctrl intel_stibp +bogomips : 4987.97 +clflush size : 64 +cache_alignment : 64 +address sizes : 46 bits physical, 48 bits virtual +power management: diff --git a/tests/archdetect/x86_64/intel/haswell/archspec-linux-E5-2680-v3.output b/tests/archdetect/x86_64/intel/haswell/archspec-linux-E5-2680-v3.output new file mode 100644 index 0000000000..5af6120686 --- /dev/null +++ b/tests/archdetect/x86_64/intel/haswell/archspec-linux-E5-2680-v3.output @@ -0,0 +1 @@ +x86_64/intel/haswell diff --git a/tests/archdetect/x86_64/intel/skylake_avx512 b/tests/archdetect/x86_64/intel/skylake_avx512/archspec-linux-6132.cpuinfo similarity index 100% rename from tests/archdetect/x86_64/intel/skylake_avx512 rename to tests/archdetect/x86_64/intel/skylake_avx512/archspec-linux-6132.cpuinfo diff --git a/tests/archdetect/x86_64/intel/skylake_avx512/archspec-linux-6132.output b/tests/archdetect/x86_64/intel/skylake_avx512/archspec-linux-6132.output new file mode 100644 index 0000000000..918c33245c --- /dev/null +++ b/tests/archdetect/x86_64/intel/skylake_avx512/archspec-linux-6132.output @@ -0,0 +1 @@ +x86_64/intel/skylake_avx512 From c3329d5452da8f1276ed7235a16ea28af4005ea3 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Tue, 20 Sep 2022 09:46:28 +0200 Subject: [PATCH 46/55] renew tests --- .github/workflows/tests_archdetect.yml | 8 ++++---- .../neoverse-n1/AWS-awslinux-graviton2.cpuinfo} | 0 .../aarch64/arm/neoverse-n1/AWS-awslinux-graviton2.output | 1 + .../Azure-Ubuntu20-Altra.cpuinfo} | 0 .../aarch64/arm/neoverse-n1/Azure-Ubuntu20-Altra.output | 1 + .../neoverse-v1/AWS-awslinux-graviton3.cpuinfo} | 0 .../aarch64/arm/neoverse-v1/AWS-awslinux-graviton3.output | 1 + .../{power9le => power9le/unknown-power9le.cpuinfo} | 0 tests/archdetect/ppc64le/power9le/unknown-power9le.output | 1 + 9 files changed, 8 insertions(+), 4 deletions(-) rename tests/archdetect/aarch64/{graviton2 => arm/neoverse-n1/AWS-awslinux-graviton2.cpuinfo} (100%) create mode 100644 tests/archdetect/aarch64/arm/neoverse-n1/AWS-awslinux-graviton2.output rename tests/archdetect/aarch64/arm/{neoverse-n1 => neoverse-n1/Azure-Ubuntu20-Altra.cpuinfo} (100%) create mode 100644 tests/archdetect/aarch64/arm/neoverse-n1/Azure-Ubuntu20-Altra.output rename tests/archdetect/aarch64/{graviton3 => arm/neoverse-v1/AWS-awslinux-graviton3.cpuinfo} (100%) create mode 100644 tests/archdetect/aarch64/arm/neoverse-v1/AWS-awslinux-graviton3.output rename tests/archdetect/ppc64le/{power9le => power9le/unknown-power9le.cpuinfo} (100%) create mode 100644 tests/archdetect/ppc64le/power9le/unknown-power9le.output diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index 1462fab22a..c8870a5cd1 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -11,10 +11,10 @@ jobs: - x86_64/intel/skylake_avx512/archspec-linux-6132 - x86_64/amd/zen2/Azure-CentOS7-7V12 - x86_64/amd/zen3/Azure-CentOS7-7V73X - - ppc64le/power9le - # - aarch64/graviton2 - # - aarch64/graviton3 - - aarch64/arm/neoverse-n1 + - ppc64le/power9le/unknown-power9le + - aarch64/arm/neoverse-n1/Azure-Ubuntu20-Altra + - aarch64/arm/neoverse-n1/AWS-awslinux-graviton2 + - aarch64/arm/neoverse-v1/AWS-awslinux-graviton3 fail-fast: false steps: - uses: actions/checkout@v2 diff --git a/tests/archdetect/aarch64/graviton2 b/tests/archdetect/aarch64/arm/neoverse-n1/AWS-awslinux-graviton2.cpuinfo similarity index 100% rename from tests/archdetect/aarch64/graviton2 rename to tests/archdetect/aarch64/arm/neoverse-n1/AWS-awslinux-graviton2.cpuinfo diff --git a/tests/archdetect/aarch64/arm/neoverse-n1/AWS-awslinux-graviton2.output b/tests/archdetect/aarch64/arm/neoverse-n1/AWS-awslinux-graviton2.output new file mode 100644 index 0000000000..b4dc5e9f1b --- /dev/null +++ b/tests/archdetect/aarch64/arm/neoverse-n1/AWS-awslinux-graviton2.output @@ -0,0 +1 @@ +aarch64/arm/neoverse-n1 diff --git a/tests/archdetect/aarch64/arm/neoverse-n1 b/tests/archdetect/aarch64/arm/neoverse-n1/Azure-Ubuntu20-Altra.cpuinfo similarity index 100% rename from tests/archdetect/aarch64/arm/neoverse-n1 rename to tests/archdetect/aarch64/arm/neoverse-n1/Azure-Ubuntu20-Altra.cpuinfo diff --git a/tests/archdetect/aarch64/arm/neoverse-n1/Azure-Ubuntu20-Altra.output b/tests/archdetect/aarch64/arm/neoverse-n1/Azure-Ubuntu20-Altra.output new file mode 100644 index 0000000000..b4dc5e9f1b --- /dev/null +++ b/tests/archdetect/aarch64/arm/neoverse-n1/Azure-Ubuntu20-Altra.output @@ -0,0 +1 @@ +aarch64/arm/neoverse-n1 diff --git a/tests/archdetect/aarch64/graviton3 b/tests/archdetect/aarch64/arm/neoverse-v1/AWS-awslinux-graviton3.cpuinfo similarity index 100% rename from tests/archdetect/aarch64/graviton3 rename to tests/archdetect/aarch64/arm/neoverse-v1/AWS-awslinux-graviton3.cpuinfo diff --git a/tests/archdetect/aarch64/arm/neoverse-v1/AWS-awslinux-graviton3.output b/tests/archdetect/aarch64/arm/neoverse-v1/AWS-awslinux-graviton3.output new file mode 100644 index 0000000000..20db96d01f --- /dev/null +++ b/tests/archdetect/aarch64/arm/neoverse-v1/AWS-awslinux-graviton3.output @@ -0,0 +1 @@ +aarch64/arm/neoverse-v1 diff --git a/tests/archdetect/ppc64le/power9le b/tests/archdetect/ppc64le/power9le/unknown-power9le.cpuinfo similarity index 100% rename from tests/archdetect/ppc64le/power9le rename to tests/archdetect/ppc64le/power9le/unknown-power9le.cpuinfo diff --git a/tests/archdetect/ppc64le/power9le/unknown-power9le.output b/tests/archdetect/ppc64le/power9le/unknown-power9le.output new file mode 100644 index 0000000000..8decf544ea --- /dev/null +++ b/tests/archdetect/ppc64le/power9le/unknown-power9le.output @@ -0,0 +1 @@ +ppc64le/power9le From 4e2033e59a5d298e857e687511487cc424264507 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Tue, 20 Sep 2022 09:50:06 +0200 Subject: [PATCH 47/55] roll-over to new code for eessi_archdetect.sh --- .github/workflows/tests_archdetect.yml | 3 +- init/arch_detect.sh | 83 ------------- init/archdetect.md | 96 --------------- init/eessi_archdetect.sh | 164 +++++++++++-------------- 4 files changed, 71 insertions(+), 275 deletions(-) delete mode 100755 init/arch_detect.sh delete mode 100644 init/archdetect.md diff --git a/.github/workflows/tests_archdetect.yml b/.github/workflows/tests_archdetect.yml index c8870a5cd1..4fffce0dde 100644 --- a/.github/workflows/tests_archdetect.yml +++ b/.github/workflows/tests_archdetect.yml @@ -24,8 +24,7 @@ jobs: export EESSI_MACHINE_TYPE=${{matrix.proc_cpuinfo}} export EESSI_MACHINE_TYPE=${EESSI_MACHINE_TYPE%%/*} export EESSI_PROC_CPUINFO=./tests/archdetect/${{matrix.proc_cpuinfo}}.cpuinfo - #CPU_ARCH=$(./init/eessi_archdetect.sh cpupath) - CPU_ARCH=$(./init/arch_detect.sh cpupath) + CPU_ARCH=$(./init/eessi_archdetect.sh cpupath) if [[ $CPU_ARCH == "$( cat ./tests/archdetect/${{matrix.proc_cpuinfo}}.output )" ]]; then echo "Test for ${{matrix.proc_cpuinfo}} PASSED: $CPU_ARCH" >&2 else diff --git a/init/arch_detect.sh b/init/arch_detect.sh deleted file mode 100755 index ab7d96c986..0000000000 --- a/init/arch_detect.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# x86_64 CPU architecture specifications -arch_x86=() -arch_x86+=('("x86_64/intel/haswell" "GenuineIntel" "avx2 fma")') # Intel Haswell, Broadwell -arch_x86+=('("x86_64/intel/skylake_avx512" "GenuineIntel" "avx2 fma avx512f")') # Intel Skylake, Cascade Lake -arch_x86+=('("x86_64/amd/zen2" "AuthenticAMD" "avx2 fma")') # AMD Rome -arch_x86+=('("x86_64/amd/zen3" "AuthenticAMD" "avx2 fma vaes")') # AMD Milan, Milan-X - -# ARM CPU architecture specifications -arch_arm=() -arch_arm+=('("aarch64/arm/neoverse-n1" "ARM" "asimd")') # Ampere Altra -arch_arm+=('("aarch64/arm/neoverse-n1" "" "asimd")') # AWS Graviton2 -arch_arm+=('("aarch64/arm/neoverse-v1" "ARM" "asimd svei8mm")') -arch_arm+=('("aarch64/arm/neoverse-v1" "" "asimd svei8mm")') # AWS Graviton3 - -# Power CPU architecture specifications -arch_power=() -arch_power+=('("ppc64le/power9le" "" "POWER9")') # IBM Power9 - -# CPU specification of host system -get_cpuinfo(){ - cpuinfo_pattern="^${1}\s*:" - #grep -i "$cpuinfo_pattern" /proc/cpuinfo | tail -n 1 | sed "s/$cpuinfo_pattern//" - grep -i "$cpuinfo_pattern" ${EESSI_PROC_CPUINFO:-/proc/cpuinfo} | tail -n 1 | sed "s/$cpuinfo_pattern//" -} - -# Find best match -check_flags(){ - for flag in "$@"; do - [[ " ${CPU_FLAGS[*]} " == *" $flag "* ]] || return 1 - done - return 0 -} - -ARGUMENT=${1:-none} - -cpupath () { - #MACHINE_TYPE=$(uname -m) - MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} - echo cpu architecture seems to be $MACHINE_TYPE >&2 - [ "${MACHINE_TYPE}" == "x86_64" ] && CPU_ARCH_SPEC=("${arch_x86[@]}") - [ "${MACHINE_TYPE}" == "aarch64" ] && CPU_ARCH_SPEC=("${arch_arm[@]}") - [ "${MACHINE_TYPE}" == "ppc64le" ] && CPU_ARCH_SPEC=("${arch_power[@]}") - [[ -z $CPU_ARCH_SPEC ]] && echo "ERROR: Unsupported CPU architecture $MACHINE_TYPE" && exit - - #CPU_VENDOR_TAG="vendor_id" - CPU_VENDOR_TAG="vendor[ _]id" - CPU_VENDOR=$(get_cpuinfo "$CPU_VENDOR_TAG") - CPU_VENDOR=$(echo ${CPU_VENDOR#*:} | xargs echo -n) - echo "== CPU vendor of host system: $CPU_VENDOR" >&2 - - CPU_FLAG_TAG='flags' - # cpuinfo systems print different line identifiers, eg features, instead of flags - [ "${CPU_VENDOR}" == "ARM" ] && CPU_FLAG_TAG='flags' - [ "${MACHINE_TYPE}" == "aarch64" ] && [ "${CPU_VENDOR}x" == "x" ] && CPU_FLAG_TAG='features' - [ "${MACHINE_TYPE}" == "ppc64le" ] && CPU_FLAG_TAG='cpu' - - CPU_FLAGS=$(get_cpuinfo "$CPU_FLAG_TAG") - echo "== CPU flags of host system: $CPU_FLAGS" >&2 - - # Default to generic CPU - BEST_MATCH="generic" - - for arch in "${CPU_ARCH_SPEC[@]}"; do - eval "arch_spec=$arch" - if [ "${CPU_VENDOR}x" == "${arch_spec[1]}x" ]; then - check_flags ${arch_spec[2]} && BEST_MATCH=${arch_spec[0]} - echo "== got a match with $BEST_MATCH" >&2 - fi - done - - echo "Best match is $BEST_MATCH" >&2 - echo "$BEST_MATCH" -} - -if [ ${ARGUMENT} == "none" ]; then - echo usage: $0 cpupath - exit -elif [ ${ARGUMENT} == "cpupath" ]; then - echo $(cpupath) - exit -fi diff --git a/init/archdetect.md b/init/archdetect.md deleted file mode 100644 index 384567ad4a..0000000000 --- a/init/archdetect.md +++ /dev/null @@ -1,96 +0,0 @@ -# archdetect - -bash based script to detect e.g. cpu architectures and provide cpupath for setting pointer to optimized software - - -example lscpu outputs: - -# Zen2 -Architecture: x86_64 -CPU op-mode(s): 32-bit, 64-bit -Byte Order: Little Endian -CPU(s): 120 -On-line CPU(s) list: 0-119 -Thread(s) per core: 1 -Core(s) per socket: 60 -Socket(s): 2 -NUMA node(s): 4 -Vendor ID: AuthenticAMD -CPU family: 23 -Model: 49 -Model name: AMD EPYC 7V12 64-Core Processor -Stepping: 0 -CPU MHz: 2445.424 -BogoMIPS: 4890.84 -Hypervisor vendor: Microsoft -Virtualization type: full -L1d cache: 32K -L1i cache: 32K -L2 cache: 512K -L3 cache: 16384K -NUMA node0 CPU(s): 0-29 -NUMA node1 CPU(s): 30-59 -NUMA node2 CPU(s): 60-89 -NUMA node3 CPU(s): 90-119 -Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm art rep_good nopl extd_apicid aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext retpoline_amd ssbd vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat umip - -# Zen3 -Architecture: x86_64 -CPU op-mode(s): 32-bit, 64-bit -Byte Order: Little Endian -CPU(s): 120 -On-line CPU(s) list: 0-119 -Thread(s) per core: 1 -Core(s) per socket: 60 -Socket(s): 2 -NUMA node(s): 4 -Vendor ID: AuthenticAMD -CPU family: 25 -Model: 1 -Model name: AMD EPYC 7V73X 64-Core Processor -Stepping: 2 -CPU MHz: 1846.550 -BogoMIPS: 3693.10 -Hypervisor vendor: Microsoft -Virtualization type: full -L1d cache: 32K -L1i cache: 32K -L2 cache: 512K -L3 cache: 98304K -NUMA node0 CPU(s): 0-29 -NUMA node1 CPU(s): 30-59 -NUMA node2 CPU(s): 60-89 -NUMA node3 CPU(s): 90-119 -Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm art rep_good nopl extd_apicid aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core invpcid_single retpoline_amd vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat umip vaes vpclmulqdq - -# Arm Ampere Altra -Architecture: aarch64 -CPU op-mode(s): 32-bit, 64-bit -Byte Order: Little Endian -CPU(s): 64 -On-line CPU(s) list: 0-63 -Thread(s) per core: 1 -Core(s) per socket: 64 -Socket(s): 1 -NUMA node(s): 1 -Vendor ID: ARM -Model: 1 -Model name: Neoverse-N1 -Stepping: r3p1 -BogoMIPS: 50.00 -L1d cache: 4 MiB -L1i cache: 4 MiB -L2 cache: 64 MiB -L3 cache: 32 MiB -NUMA node0 CPU(s): 0-63 -Vulnerability Itlb multihit: Not affected -Vulnerability L1tf: Not affected -Vulnerability Mds: Not affected -Vulnerability Meltdown: Mitigation; PTI -Vulnerability Mmio stale data: Not affected -Vulnerability Spec store bypass: Not affected -Vulnerability Spectre v1: Mitigation; __user pointer sanitization -Vulnerability Spectre v2: Mitigation; CSV2, BHB -Vulnerability Srbds: Not affected -Vulnerability Tsx async abort: Not affected -Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index 4a598eafdc..ab7d96c986 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -1,107 +1,83 @@ -#!/usr/bin/env bash +#!/bin/bash + +# x86_64 CPU architecture specifications +arch_x86=() +arch_x86+=('("x86_64/intel/haswell" "GenuineIntel" "avx2 fma")') # Intel Haswell, Broadwell +arch_x86+=('("x86_64/intel/skylake_avx512" "GenuineIntel" "avx2 fma avx512f")') # Intel Skylake, Cascade Lake +arch_x86+=('("x86_64/amd/zen2" "AuthenticAMD" "avx2 fma")') # AMD Rome +arch_x86+=('("x86_64/amd/zen3" "AuthenticAMD" "avx2 fma vaes")') # AMD Milan, Milan-X + +# ARM CPU architecture specifications +arch_arm=() +arch_arm+=('("aarch64/arm/neoverse-n1" "ARM" "asimd")') # Ampere Altra +arch_arm+=('("aarch64/arm/neoverse-n1" "" "asimd")') # AWS Graviton2 +arch_arm+=('("aarch64/arm/neoverse-v1" "ARM" "asimd svei8mm")') +arch_arm+=('("aarch64/arm/neoverse-v1" "" "asimd svei8mm")') # AWS Graviton3 + +# Power CPU architecture specifications +arch_power=() +arch_power+=('("ppc64le/power9le" "" "POWER9")') # IBM Power9 + +# CPU specification of host system +get_cpuinfo(){ + cpuinfo_pattern="^${1}\s*:" + #grep -i "$cpuinfo_pattern" /proc/cpuinfo | tail -n 1 | sed "s/$cpuinfo_pattern//" + grep -i "$cpuinfo_pattern" ${EESSI_PROC_CPUINFO:-/proc/cpuinfo} | tail -n 1 | sed "s/$cpuinfo_pattern//" +} -# current pathways implemented in EESSI 2021.12 pilot version -# x86_64/generic -# x86_64/intel/haswell -# x86_64/intel/skylake_avx512 -# x86_64/amd/zen2 -# x86_64/amd/zen3 -# aarch64/generic -# aarch64/graviton2 -# aarch64/graviton3 -# ppc64le/generic -# ppc64le/power9le +# Find best match +check_flags(){ + for flag in "$@"; do + [[ " ${CPU_FLAGS[*]} " == *" $flag "* ]] || return 1 + done + return 0 +} ARGUMENT=${1:-none} cpupath () { - # let the kernel tell base machine type + #MACHINE_TYPE=$(uname -m) MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} - PROC_CPUINFO=${EESSI_PROC_CPUINFO:-/proc/cpuinfo} - - # clean up any existing pointers to cpu features - unset $(env | grep EESSI_HAS | cut -f1 -d=) - unset EESSI_CPU_VENDOR - - # fallback path - CPU_PATH="${MACHINE_TYPE}/generic" - - if [ ${MACHINE_TYPE} == "aarch64" ]; then - CPUINFO_VENDOR_FLAG=$(grep -m 1 -i ^vendor ${PROC_CPUINFO}) - [[ $CPUINFO_VENDOR_FLAG =~ "ARM" ]] && EESSI_CPU_VENDOR=arm - - if [ ${EESSI_CPU_VENDOR} == "arm" ]; then - CPU_FLAGS=$(grep -m 1 -i ^flags ${PROC_CPUINFO} | sed 's/$/ /g') - else - CPU_FLAGS=$(grep -m 1 -i ^features ${PROC_CPUINFO} | sed 's/$/ /g') + echo cpu architecture seems to be $MACHINE_TYPE >&2 + [ "${MACHINE_TYPE}" == "x86_64" ] && CPU_ARCH_SPEC=("${arch_x86[@]}") + [ "${MACHINE_TYPE}" == "aarch64" ] && CPU_ARCH_SPEC=("${arch_arm[@]}") + [ "${MACHINE_TYPE}" == "ppc64le" ] && CPU_ARCH_SPEC=("${arch_power[@]}") + [[ -z $CPU_ARCH_SPEC ]] && echo "ERROR: Unsupported CPU architecture $MACHINE_TYPE" && exit + + #CPU_VENDOR_TAG="vendor_id" + CPU_VENDOR_TAG="vendor[ _]id" + CPU_VENDOR=$(get_cpuinfo "$CPU_VENDOR_TAG") + CPU_VENDOR=$(echo ${CPU_VENDOR#*:} | xargs echo -n) + echo "== CPU vendor of host system: $CPU_VENDOR" >&2 + + CPU_FLAG_TAG='flags' + # cpuinfo systems print different line identifiers, eg features, instead of flags + [ "${CPU_VENDOR}" == "ARM" ] && CPU_FLAG_TAG='flags' + [ "${MACHINE_TYPE}" == "aarch64" ] && [ "${CPU_VENDOR}x" == "x" ] && CPU_FLAG_TAG='features' + [ "${MACHINE_TYPE}" == "ppc64le" ] && CPU_FLAG_TAG='cpu' + + CPU_FLAGS=$(get_cpuinfo "$CPU_FLAG_TAG") + echo "== CPU flags of host system: $CPU_FLAGS" >&2 + + # Default to generic CPU + BEST_MATCH="generic" + + for arch in "${CPU_ARCH_SPEC[@]}"; do + eval "arch_spec=$arch" + if [ "${CPU_VENDOR}x" == "${arch_spec[1]}x" ]; then + check_flags ${arch_spec[2]} && BEST_MATCH=${arch_spec[0]} + echo "== got a match with $BEST_MATCH" >&2 fi + done - [[ $CPU_FLAGS =~ " asimd " ]] && EESSI_HAS_ASIMD=true - [[ $CPU_FLAGS =~ " svei8mm " ]] && EESSI_HAS_SVEI8MM=true - - # we will not return graviton2 as a result here, since then we get get graviton2 as a result while we're actually on a thunderx2, for example. - # We should break here with archspec, and symlink aarch64/arm/neoverse-n1 to aarch64/graviton2 in EESSI pilot 2021.12, - # and then the reverse in the next EESSI pilot (so it still works with archspec). - [[ ${EESSI_HAS_ASIMD} ]] && EESSI_CPU_TYPE=neoverse-n1 # Ampere Altra, AWS graviton2 - [[ ${EESSI_HAS_SVEI8MM} ]] && EESSI_CPU_TYPE=neoverse-v1 # AWS graviton3 - [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_VENDOR}/${EESSI_CPU_TYPE}" - - echo ${CPU_PATH} - exit - fi - - if [ ${MACHINE_TYPE} == "ppc64le" ]; then - CPU_FLAGS=$(grep -m 1 -i ^cpu ${PROC_CPUINFO}) - [[ $CPU_FLAGS =~ " POWER9 " ]] && EESSI_HAS_POWER9=true - - [[ ${EESSI_HAS_POWER9} ]] && EESSI_CPU_TYPE=power9le # IBM Power9 - - [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_TYPE}" - echo ${CPU_PATH} - exit - fi - - if [ ${MACHINE_TYPE} == "x86_64" ]; then - # check for vendor info, if available, for x86_64 - CPUINFO_VENDOR_FLAG=$(grep -m 1 -i ^vendor ${PROC_CPUINFO}) - [[ $CPUINFO_VENDOR_FLAG =~ "GenuineIntel" ]] && EESSI_CPU_VENDOR=intel - [[ $CPUINFO_VENDOR_FLAG =~ "AuthenticAMD" ]] && EESSI_CPU_VENDOR=amd - - CPU_FLAGS=$(grep -m 1 -i ^flags ${PROC_CPUINFO} | sed 's/$/ /g') - [[ $CPU_FLAGS =~ " avx2 " ]] && EESSI_HAS_AVX2=true - [[ $CPU_FLAGS =~ " fma " ]] && EESSI_HAS_FMA=true - [[ $CPU_FLAGS =~ " avx512f " ]] && EESSI_HAS_AVX512F=true - [[ $CPU_FLAGS =~ " avx512vl " ]] && EESSI_HAS_AVX512VL=true - [[ $CPU_FLAGS =~ " avx512ifma " ]] && EESSI_HAS_AVX512IFMA=true - [[ $CPU_FLAGS =~ " avx512_vbmi2 " ]] && EESSI_HAS_AVX512_VBMI2=true - [[ $CPU_FLAGS =~ " avx512_vnni " ]] && EESSI_HAS_AVX512_VNNI=true - [[ $CPU_FLAGS =~ " avx512fp16 " ]] && EESSI_HAS_AVX512FP16=true - [[ $CPU_FLAGS =~ " vaes " ]] && EESSI_HAS_VAES=true - - if [ ${EESSI_CPU_VENDOR} == "intel" ]; then - [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && EESSI_CPU_TYPE=haswell # Intel Haswell, Broadwell - [[ ${EESSI_HAS_AVX512F} ]] && EESSI_CPU_TYPE=skylake_avx512 # Intel Skylake, Cascade Lake - # [[ ${HAS_AVX512IFMA} ]] && [[ ${HAS_AVX512_VBMI2} ]] && CPU_TYPE=icelake_avx512 - # [[ ${HAS_AVX512_VNNI} ]] && [[ ${HAS_AVX512VL} ]] && [[ ${HAS_AVX512FP16} ]] && CPU_TYPE=sapphire_rapids_avx512 - elif [ ${EESSI_CPU_VENDOR} == "amd" ]; then - [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && EESSI_CPU_TYPE=zen2 # AMD Rome - [[ ${EESSI_HAS_AVX2} ]] && [[ ${EESSI_HAS_FMA} ]] && [[ ${EESSI_HAS_VAES} ]] && EESSI_CPU_TYPE=zen3 # AMD Milan, Milan-X - fi - - [[ ${EESSI_CPU_VENDOR} ]] && [[ $EESSI_CPU_TYPE ]] && CPU_PATH="${MACHINE_TYPE}/${EESSI_CPU_VENDOR}/${EESSI_CPU_TYPE}" - - echo ${CPU_PATH} - exit - fi - - echo "should not see this...something weird going on..." - echo "please mail output of lscpu to me..." + echo "Best match is $BEST_MATCH" >&2 + echo "$BEST_MATCH" } if [ ${ARGUMENT} == "none" ]; then - echo usage: $0 cpupath - exit + echo usage: $0 cpupath + exit elif [ ${ARGUMENT} == "cpupath" ]; then - echo $(cpupath) - exit + echo $(cpupath) + exit fi From 3eddc78e8f2527a0ce285f5244c8bbf0fdd6b960 Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Tue, 20 Sep 2022 11:11:51 +0200 Subject: [PATCH 48/55] change hardcoded bash --- init/eessi_archdetect.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index ab7d96c986..298c88a955 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # x86_64 CPU architecture specifications arch_x86=() From 818ecade77631f09828fd14e224c2bbe032d5e3a Mon Sep 17 00:00:00 2001 From: Alex Domingo Date: Wed, 21 Sep 2022 12:16:33 +0200 Subject: [PATCH 49/55] move CPU arch specifications to separate spec files --- init/arch_specs/eessi_arch_arm.spec | 6 +++ init/arch_specs/eessi_arch_ppc.spec | 3 ++ init/arch_specs/eessi_arch_x86.spec | 6 +++ init/eessi_archdetect.sh | 60 ++++++++++++++++------------- 4 files changed, 49 insertions(+), 26 deletions(-) create mode 100755 init/arch_specs/eessi_arch_arm.spec create mode 100755 init/arch_specs/eessi_arch_ppc.spec create mode 100755 init/arch_specs/eessi_arch_x86.spec diff --git a/init/arch_specs/eessi_arch_arm.spec b/init/arch_specs/eessi_arch_arm.spec new file mode 100755 index 0000000000..92f32a76d8 --- /dev/null +++ b/init/arch_specs/eessi_arch_arm.spec @@ -0,0 +1,6 @@ +# ARM CPU architecture specifications +# Software path in EESSI | Vendor ID | List of defining CPU features +"aarch64/arm/neoverse-n1" "ARM" "asimd" # Ampere Altra +"aarch64/arm/neoverse-n1" "" "asimd" # AWS Graviton2 +"aarch64/arm/neoverse-v1" "ARM" "asimd svei8mm" +"aarch64/arm/neoverse-v1" "" "asimd svei8mm" # AWS Graviton3 diff --git a/init/arch_specs/eessi_arch_ppc.spec b/init/arch_specs/eessi_arch_ppc.spec new file mode 100755 index 0000000000..a6cb922baf --- /dev/null +++ b/init/arch_specs/eessi_arch_ppc.spec @@ -0,0 +1,3 @@ +# x86_64 CPU architecture specifications +# Software path in EESSI | Vendor ID | List of defining CPU features +"ppc64le/power9le" "" "POWER9" # IBM Power9 diff --git a/init/arch_specs/eessi_arch_x86.spec b/init/arch_specs/eessi_arch_x86.spec new file mode 100755 index 0000000000..e165e6c96d --- /dev/null +++ b/init/arch_specs/eessi_arch_x86.spec @@ -0,0 +1,6 @@ +# x86_64 CPU architecture specifications +# Software path in EESSI | Vendor ID | List of defining CPU features +"x86_64/intel/haswell" "GenuineIntel" "avx2 fma" # Intel Haswell, Broadwell +"x86_64/intel/skylake_avx512" "GenuineIntel" "avx2 fma avx512f" # Intel Skylake, Cascade Lake +"x86_64/amd/zen2" "AuthenticAMD" "avx2 fma" # AMD Rome +"x86_64/amd/zen3" "AuthenticAMD" "avx2 fma vaes" # AMD Milan, Milan-X diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index 298c88a955..d9e2737b6f 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -1,22 +1,22 @@ #!/usr/bin/env bash -# x86_64 CPU architecture specifications -arch_x86=() -arch_x86+=('("x86_64/intel/haswell" "GenuineIntel" "avx2 fma")') # Intel Haswell, Broadwell -arch_x86+=('("x86_64/intel/skylake_avx512" "GenuineIntel" "avx2 fma avx512f")') # Intel Skylake, Cascade Lake -arch_x86+=('("x86_64/amd/zen2" "AuthenticAMD" "avx2 fma")') # AMD Rome -arch_x86+=('("x86_64/amd/zen3" "AuthenticAMD" "avx2 fma vaes")') # AMD Milan, Milan-X - -# ARM CPU architecture specifications -arch_arm=() -arch_arm+=('("aarch64/arm/neoverse-n1" "ARM" "asimd")') # Ampere Altra -arch_arm+=('("aarch64/arm/neoverse-n1" "" "asimd")') # AWS Graviton2 -arch_arm+=('("aarch64/arm/neoverse-v1" "ARM" "asimd svei8mm")') -arch_arm+=('("aarch64/arm/neoverse-v1" "" "asimd svei8mm")') # AWS Graviton3 - -# Power CPU architecture specifications -arch_power=() -arch_power+=('("ppc64le/power9le" "" "POWER9")') # IBM Power9 +# Supported CPU specifications +update_arch_specs(){ + # Add contents of given spec file into an array + # 1: array with CPU arch specs + # 2: spec file with the additional specs + + [ -z "$1" ] && echo "[ERROR] update_arch_specs: missing array in argument list" >&2 && exit 1 + local -n arch_specs=$1 + + [ ! -f "$2" ] && echo "[ERROR] update_arch_specs: spec file not found: $spec_file" >&2 && exit 1 + spec_file="$2" + while read spec_line; do + # format spec line as an array and append it to array with all CPU arch specs + arch_specs+=("(${spec_line})") + # remove comments from spec file + done < <(sed -E 's/(^|[\s\t])#.*$//g;/^\s*$/d' "$spec_file") +} # CPU specification of host system get_cpuinfo(){ @@ -35,14 +35,22 @@ check_flags(){ ARGUMENT=${1:-none} -cpupath () { - #MACHINE_TYPE=$(uname -m) - MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} - echo cpu architecture seems to be $MACHINE_TYPE >&2 - [ "${MACHINE_TYPE}" == "x86_64" ] && CPU_ARCH_SPEC=("${arch_x86[@]}") - [ "${MACHINE_TYPE}" == "aarch64" ] && CPU_ARCH_SPEC=("${arch_arm[@]}") - [ "${MACHINE_TYPE}" == "ppc64le" ] && CPU_ARCH_SPEC=("${arch_power[@]}") - [[ -z $CPU_ARCH_SPEC ]] && echo "ERROR: Unsupported CPU architecture $MACHINE_TYPE" && exit +cpupath(){ + # Return the best matching CPU architecture from a list of supported specifications for the host CPU + local CPU_ARCH_SPEC=() + + # Identify the host CPU architecture + local MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} + echo "[INFO] cpupath: Host CPU architecture identified as $MACHINE_TYPE" + + # Populate list of supported specs for this architecture + case $MACHINE_TYPE in + "x86_64") spec_file="eessi_arch_x86.spec";; + "aarch64") spec_file="eessi_arch_arm.spec";; + "ppc64le") spec_file="eessi_arch_ppc.spec";; + *) echo "[ERROR] cpupath: Unsupported CPU architecture $MACHINE_TYPE" >&2 && exit 1 + esac + update_arch_specs CPU_ARCH_SPEC "arch_specs/${spec_file}" #CPU_VENDOR_TAG="vendor_id" CPU_VENDOR_TAG="vendor[ _]id" @@ -78,6 +86,6 @@ if [ ${ARGUMENT} == "none" ]; then echo usage: $0 cpupath exit elif [ ${ARGUMENT} == "cpupath" ]; then - echo $(cpupath) + cpupath exit fi From 6726288a3b489c0673b39f52536be4942b089a26 Mon Sep 17 00:00:00 2001 From: Alex Domingo Date: Wed, 21 Sep 2022 14:45:43 +0200 Subject: [PATCH 50/55] fix execution from any location in the file system --- init/arch_specs/eessi_arch_ppc.spec | 2 +- init/eessi_archdetect.sh | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/init/arch_specs/eessi_arch_ppc.spec b/init/arch_specs/eessi_arch_ppc.spec index a6cb922baf..0932925046 100755 --- a/init/arch_specs/eessi_arch_ppc.spec +++ b/init/arch_specs/eessi_arch_ppc.spec @@ -1,3 +1,3 @@ -# x86_64 CPU architecture specifications +# POWER CPU architecture specifications # Software path in EESSI | Vendor ID | List of defining CPU features "ppc64le/power9le" "" "POWER9" # IBM Power9 diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index d9e2737b6f..bb6ceff27f 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -9,8 +9,8 @@ update_arch_specs(){ [ -z "$1" ] && echo "[ERROR] update_arch_specs: missing array in argument list" >&2 && exit 1 local -n arch_specs=$1 - [ ! -f "$2" ] && echo "[ERROR] update_arch_specs: spec file not found: $spec_file" >&2 && exit 1 - spec_file="$2" + [ ! -f "$2" ] && echo "[ERROR] update_arch_specs: spec file not found: $2" >&2 && exit 1 + local spec_file="$2" while read spec_line; do # format spec line as an array and append it to array with all CPU arch specs arch_specs+=("(${spec_line})") @@ -45,12 +45,14 @@ cpupath(){ # Populate list of supported specs for this architecture case $MACHINE_TYPE in - "x86_64") spec_file="eessi_arch_x86.spec";; - "aarch64") spec_file="eessi_arch_arm.spec";; - "ppc64le") spec_file="eessi_arch_ppc.spec";; + "x86_64") local spec_file="eessi_arch_x86.spec";; + "aarch64") local spec_file="eessi_arch_arm.spec";; + "ppc64le") local spec_file="eessi_arch_ppc.spec";; *) echo "[ERROR] cpupath: Unsupported CPU architecture $MACHINE_TYPE" >&2 && exit 1 esac - update_arch_specs CPU_ARCH_SPEC "arch_specs/${spec_file}" + # spec files are located in a subfolder with this script + local base_dir=$(dirname $(realpath $0)) + update_arch_specs CPU_ARCH_SPEC "$base_dir/arch_specs/${spec_file}" #CPU_VENDOR_TAG="vendor_id" CPU_VENDOR_TAG="vendor[ _]id" From d4d9681d1d0b04419f3fec99917d223172342e29 Mon Sep 17 00:00:00 2001 From: Alex Domingo Date: Wed, 21 Sep 2022 15:15:19 +0200 Subject: [PATCH 51/55] fix log messages ibeing printed in standard output --- init/eessi_archdetect.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index bb6ceff27f..d1b6417884 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -41,7 +41,7 @@ cpupath(){ # Identify the host CPU architecture local MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} - echo "[INFO] cpupath: Host CPU architecture identified as $MACHINE_TYPE" + echo "[INFO] cpupath: Host CPU architecture identified as $MACHINE_TYPE" >&2 # Populate list of supported specs for this architecture case $MACHINE_TYPE in From 50b46ca146bc2a421a4c6c1023913c7a304c3a84 Mon Sep 17 00:00:00 2001 From: Alex Domingo Date: Mon, 26 Sep 2022 14:37:25 +0200 Subject: [PATCH 52/55] standarize log formatting by adding logging function --- init/eessi_archdetect.sh | 174 +++++++++++++++++++++++++-------------- 1 file changed, 111 insertions(+), 63 deletions(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index d1b6417884..dd29baecde 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -1,9 +1,32 @@ #!/usr/bin/env bash +# Logging +LOG_LEVEL="INFO" + +timestamp () { + date "+%Y-%m-%d %H:%M:%S" +} + +log () { + # Simple logger function + declare -A levels=([DEBUG]=0 [INFO]=1 [WARN]=2 [ERROR]=3) + msg_type="${1:-INFO}" + msg_body="${2:-'null'}" + + [ ${levels[$msg_type]} ] || log "ERROR" "Unknown log level $msg_type" + + # ignore messages below log level + [ ${levels[$msg_type]} -lt ${levels[$LOG_LEVEL]} ] && return 0 + # print log message to standard error + echo "$(timestamp) [$msg_type] $msg_body" >&2 + # exit after any error message + [ $msg_type == "ERROR" ] && exit 1 +} + # Supported CPU specifications update_arch_specs(){ # Add contents of given spec file into an array - # 1: array with CPU arch specs + # 1: name of array with CPU arch specs # 2: spec file with the additional specs [ -z "$1" ] && echo "[ERROR] update_arch_specs: missing array in argument list" >&2 && exit 1 @@ -20,74 +43,99 @@ update_arch_specs(){ # CPU specification of host system get_cpuinfo(){ - cpuinfo_pattern="^${1}\s*:" - #grep -i "$cpuinfo_pattern" /proc/cpuinfo | tail -n 1 | sed "s/$cpuinfo_pattern//" - grep -i "$cpuinfo_pattern" ${EESSI_PROC_CPUINFO:-/proc/cpuinfo} | tail -n 1 | sed "s/$cpuinfo_pattern//" + # Return the value from cpuinfo for the matching key + # 1: string with key pattern + + [ -z "$1" ] && log "ERROR" "get_cpuinfo: missing key pattern in argument list" + cpuinfo_pattern="^${1}\s*:\s*" + + # case insensitive match of key pattern and delete key pattern from result + grep -i "$cpuinfo_pattern" ${EESSI_PROC_CPUINFO:-/proc/cpuinfo} | tail -n 1 | sed "s/$cpuinfo_pattern//i" } -# Find best match -check_flags(){ - for flag in "$@"; do - [[ " ${CPU_FLAGS[*]} " == *" $flag "* ]] || return 1 +check_allinfirst(){ + # Return true if all given arguments after the first are found in the first one + # 1: reference string of space separated values + # 2,3..: each additional argument is a single value to be found in the reference string + + [ -z "$1" ] && log "ERROR" "check_allinfirst: missing argument with reference string" + reference="$1" + shift + + for candidate in "$@"; do + [[ " $reference " == *" $candidate "* ]] || return 1 done return 0 } -ARGUMENT=${1:-none} - cpupath(){ - # Return the best matching CPU architecture from a list of supported specifications for the host CPU - local CPU_ARCH_SPEC=() - - # Identify the host CPU architecture - local MACHINE_TYPE=${EESSI_MACHINE_TYPE:-$(uname -m)} - echo "[INFO] cpupath: Host CPU architecture identified as $MACHINE_TYPE" >&2 - - # Populate list of supported specs for this architecture - case $MACHINE_TYPE in - "x86_64") local spec_file="eessi_arch_x86.spec";; - "aarch64") local spec_file="eessi_arch_arm.spec";; - "ppc64le") local spec_file="eessi_arch_ppc.spec";; - *) echo "[ERROR] cpupath: Unsupported CPU architecture $MACHINE_TYPE" >&2 && exit 1 - esac - # spec files are located in a subfolder with this script - local base_dir=$(dirname $(realpath $0)) - update_arch_specs CPU_ARCH_SPEC "$base_dir/arch_specs/${spec_file}" - - #CPU_VENDOR_TAG="vendor_id" - CPU_VENDOR_TAG="vendor[ _]id" - CPU_VENDOR=$(get_cpuinfo "$CPU_VENDOR_TAG") - CPU_VENDOR=$(echo ${CPU_VENDOR#*:} | xargs echo -n) - echo "== CPU vendor of host system: $CPU_VENDOR" >&2 - - CPU_FLAG_TAG='flags' - # cpuinfo systems print different line identifiers, eg features, instead of flags - [ "${CPU_VENDOR}" == "ARM" ] && CPU_FLAG_TAG='flags' - [ "${MACHINE_TYPE}" == "aarch64" ] && [ "${CPU_VENDOR}x" == "x" ] && CPU_FLAG_TAG='features' - [ "${MACHINE_TYPE}" == "ppc64le" ] && CPU_FLAG_TAG='cpu' - - CPU_FLAGS=$(get_cpuinfo "$CPU_FLAG_TAG") - echo "== CPU flags of host system: $CPU_FLAGS" >&2 - - # Default to generic CPU - BEST_MATCH="generic" - - for arch in "${CPU_ARCH_SPEC[@]}"; do - eval "arch_spec=$arch" - if [ "${CPU_VENDOR}x" == "${arch_spec[1]}x" ]; then - check_flags ${arch_spec[2]} && BEST_MATCH=${arch_spec[0]} - echo "== got a match with $BEST_MATCH" >&2 - fi - done - - echo "Best match is $BEST_MATCH" >&2 - echo "$BEST_MATCH" + # Identify the best matching CPU architecture from a list of supported specifications for the host CPU + # Return the path to the installation files in EESSI of the best matching architecture + local cpu_arch_spec=() + + # Identify the host CPU architecture + local machine_type=${EESSI_MACHINE_TYPE:-$(uname -m)} + log "DEBUG" "cpupath: Host CPU architecture identified as '$machine_type'" + + # Populate list of supported specs for this architecture + case $machine_type in + "x86_64") local spec_file="eessi_arch_x86.spec";; + "aarch64") local spec_file="eessi_arch_arm.spec";; + "ppc64le") local spec_file="eessi_arch_ppc.spec";; + *) log "ERROR" "cpupath: Unsupported CPU architecture $machine_type" + esac + # spec files are located in a subfolder with this script + local base_dir=$(dirname $(realpath $0)) + update_arch_specs cpu_arch_spec "$base_dir/arch_specs/${spec_file}" + + # Identify the host CPU vendor + local cpu_vendor_tag="vendor[ _]id" + local cpu_vendor=$(get_cpuinfo "$cpu_vendor_tag") + log "DEBUG" "cpupath: CPU vendor of host system: '$cpu_vendor'" + + # Identify the host CPU flags or features + local cpu_flag_tag='flags' + # cpuinfo systems print different line identifiers, eg features, instead of flags + [ "${cpu_vendor}" == "ARM" ] && cpu_flag_tag='flags' + [ "${machine_type}" == "aarch64" ] && [ "${cpu_vendor}x" == "x" ] && cpu_flag_tag='features' + [ "${machine_type}" == "ppc64le" ] && cpu_flag_tag='cpu' + + local cpu_flags=$(get_cpuinfo "$cpu_flag_tag") + log "DEBUG" "cpupath: CPU flags of host system: '$cpu_flags'" + + # Default to generic CPU + local best_arch_match="generic" + + # Iterate over the supported CPU specifications to find the best match for host CPU + # Order of the specifications matters, the last one to match will be selected + for arch in "${cpu_arch_spec[@]}"; do + eval "arch_spec=$arch" + if [ "${cpu_vendor}x" == "${arch_spec[1]}x" ]; then + # each flag in this CPU specification must be found in the list of flags of the host + check_allinfirst "${cpu_flags[*]}" ${arch_spec[2]} && best_arch_match=${arch_spec[0]} && \ + log "DEBUG" "cpupath: host CPU best match updated to $best_arch_match" + fi + done + + log "INFO" "cpupath: best match for host CPU: $best_arch_match" + echo "$best_arch_match" } -if [ ${ARGUMENT} == "none" ]; then - echo usage: $0 cpupath - exit -elif [ ${ARGUMENT} == "cpupath" ]; then - cpupath - exit -fi +# Parse command line arguments +USAGE="Usage: eessi_archdetect.sh [-h][-d] " + +while getopts 'hd' OPTION; do + case "$OPTION" in + h) echo "$USAGE"; exit 0;; + d) LOG_LEVEL="DEBUG";; + ?) echo "$USAGE"; exit 1;; + esac +done +shift "$(($OPTIND -1))" + +ARGUMENT=${1:-none} + +case "$ARGUMENT" in + "cpupath") cpupath; exit;; + *) echo "$USAGE"; log "ERROR" "Missing argument";; +esac From c74bb8ee7eec93b06d011c7f5463a16ffbb74e27 Mon Sep 17 00:00:00 2001 From: Alex Domingo Date: Mon, 26 Sep 2022 14:52:44 +0200 Subject: [PATCH 53/55] add version tag and option to print it --- init/eessi_archdetect.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init/eessi_archdetect.sh b/init/eessi_archdetect.sh index dd29baecde..af63e36f3a 100755 --- a/init/eessi_archdetect.sh +++ b/init/eessi_archdetect.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +VERSION="1.0.0" # Logging LOG_LEVEL="INFO" @@ -124,10 +125,11 @@ cpupath(){ # Parse command line arguments USAGE="Usage: eessi_archdetect.sh [-h][-d] " -while getopts 'hd' OPTION; do +while getopts 'hdv' OPTION; do case "$OPTION" in h) echo "$USAGE"; exit 0;; d) LOG_LEVEL="DEBUG";; + v) echo "eessi_archdetect.sh v$VERSION"; exit 0;; ?) echo "$USAGE"; exit 1;; esac done From 806e1fbe0c0e982bf2b6c9e4b619711e155944bb Mon Sep 17 00:00:00 2001 From: hugo meiland Date: Sun, 2 Oct 2022 06:46:23 +0200 Subject: [PATCH 54/55] be more specific on skylake_avx512 to avoid KNL confusion --- init/arch_specs/eessi_arch_x86.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/arch_specs/eessi_arch_x86.spec b/init/arch_specs/eessi_arch_x86.spec index e165e6c96d..8d01cb0c03 100755 --- a/init/arch_specs/eessi_arch_x86.spec +++ b/init/arch_specs/eessi_arch_x86.spec @@ -1,6 +1,6 @@ # x86_64 CPU architecture specifications # Software path in EESSI | Vendor ID | List of defining CPU features "x86_64/intel/haswell" "GenuineIntel" "avx2 fma" # Intel Haswell, Broadwell -"x86_64/intel/skylake_avx512" "GenuineIntel" "avx2 fma avx512f" # Intel Skylake, Cascade Lake +"x86_64/intel/skylake_avx512" "GenuineIntel" "avx2 fma avx512f avx512bw avx512cd avx512dq avx512vl" # Intel Skylake, Cascade Lake "x86_64/amd/zen2" "AuthenticAMD" "avx2 fma" # AMD Rome "x86_64/amd/zen3" "AuthenticAMD" "avx2 fma vaes" # AMD Milan, Milan-X From 2d77d74a2950496fbb63fca1a7112bd35779d1c8 Mon Sep 17 00:00:00 2001 From: Hugo Meiland <32266151+hmeiland@users.noreply.github.com> Date: Tue, 8 Nov 2022 06:41:05 +0100 Subject: [PATCH 55/55] Update init/eessi_environment_variables Co-authored-by: Kenneth Hoste --- init/eessi_environment_variables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/eessi_environment_variables b/init/eessi_environment_variables index d32a1c8279..10ac1926f4 100644 --- a/init/eessi_environment_variables +++ b/init/eessi_environment_variables @@ -25,7 +25,7 @@ if [ -d $EESSI_PREFIX ]; then if [ -d $EESSI_EPREFIX ]; then # determine subdirectory in software layer - if [ -z $EESSI_USE_ARCHDETECT ]; then + if [ "$EESSI_USE_ARCHDETECT" == "1" ]; then # if archdetect is enabled, use internal code export EESSI_SOFTWARE_SUBDIR=$(${EESSI_INIT_DIR_PATH}/eessi_archdetect.sh cpupath) echo "archdetect says ${EESSI_SOFTWARE_SUBDIR}" >> $output