Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zen3 R9 5950x in wsl2 Zen3 is recognized as Zen2, and compile with Zen3 architecture will report an error #36817

Open
3 tasks done
clxqyt opened this issue Apr 13, 2023 · 4 comments

Comments

@clxqyt
Copy link

clxqyt commented Apr 13, 2023

Steps to reproduce

when I compiled vasp6.3.2 with aocc@4.0.0, by:
spack -d install -v -j 16 vasp@6.3.2 +scalapack +openmp %aocc@4.0.0 target=zen3 ^amdfftw@3.1 ^amdblis@3.1 threads=openmp ^amdlibflame@3.1 ^amdscalapack@3.1 ^openmpi@4.1.1 fabrics=auto
It shows that The machine does not apply zen3。When I changed the zen3 option to zen2 and tried to compile, some strange errors were reported so I don't have to paste it

Error message

The machine does not apply zen3

Information on your system

Win 11 wsl 2-ubuntu 20.04.2

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output
@clxqyt clxqyt added bug Something isn't working triage The issue needs to be prioritized labels Apr 13, 2023
@alalazo
Copy link
Member

alalazo commented Jun 6, 2023

Can you post the output of spack debug report? Note that, if you are concretizing for a target that is newer than your host as detected by Spack, you need to tweak some concretizer configuration:

$ spack config add "concretizer:targets:host_compatible:false"

@alalazo
Copy link
Member

alalazo commented Jul 5, 2023

@clxqyt

@alalazo alalazo added unreproducible and removed triage The issue needs to be prioritized labels Jul 7, 2023
@isots-code
Copy link

I'm having the same issue, but on a Win10 machine

Here's a /proc/info and what spack detects

dev@DESKTOP-2R35S6F:/mnt/c/spack$ cat /proc/cpuinfo | head -n 28
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 25
model           : 33
model name      : AMD Ryzen 7 5700X 8-Core Processor
stepping        : 2
microcode       : 0xffffffff
cpu MHz         : 3399.997
cache size      : 512 KB
physical id     : 0
siblings        : 16
core id         : 0
cpu cores       : 8
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
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 rep_good nopl cpuid extd_apicid 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 ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr arat umip vaes vpclmulqdq rdpid fsrm
bugs            : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 6799.99
TLB size        : 2560 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management:

dev@DESKTOP-2R35S6F:/mnt/c/spack$ spack arch
linux-ubuntu20.04-zen2
dev@DESKTOP-2R35S6F:/mnt/c/spack$

And here's a spack debug report output

dev@DESKTOP-2R35S6F:/mnt/c/spack$ spack debug report
* **Spack:** 0.22.0.dev0 (624df2a1bbf27da4b7e3ea6a3b1a6348baef2e25)
* **Python:** 3.8.10
* **Platform:** linux-ubuntu20.04-zen2
* **Concretizer:** clingo

Steps ran:

export SPACK_ROOT=/mnt/c/spack/
source ${SPACK_ROOT}/share/spack/setup-env.sh
cat /proc/cpuinfo | head -n 28
spack arch
spack debug report

@isots-code
Copy link

isots-code commented Nov 26, 2023

Found the problem, apparently some Zen3 CPU's don't have the "pku" flag enabled, causing detention to fallback to Zen2.
A solution is to remove the "pku" flags from the microarchitectures.json file provided by archspec

They have some issues related to this aswell
archspec/archspec-json#38
archspec/archspec-json#40

One small advice to any one trying the fix, be careful with compiler flags, and make sure "-mpku" is NOT set, since if CPUID cant find the flag for the CPU, if the compiler emits PKU instructions it gets an Illegal Instruction exception

Try the fix at your own risk

Tagging @alalazo so that this can be either closed or looked further

And thank you for your work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants