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

Julia v1.8.0-rc1: support for znver3 (even though underlying LLVM13 supports is) is missing #45657

Closed
LebedevRI opened this issue Jun 12, 2022 · 4 comments · Fixed by #45663
Closed

Comments

@LebedevRI
Copy link
Contributor

This is with the official https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.0-rc1-linux-x86_64.tar.gz

$ /opt/julia/bin/julia --cpu-target znver2 
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.0-rc1 (2022-05-27)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> exit()
$ /opt/julia/bin/julia --cpu-target native
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.0-rc1 (2022-05-27)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> exit()
$ /opt/julia/bin/julia --cpu-target znver3 
ERROR: Your CPU does not support the CX16 instruction, which is required by this version of Julia!  This is often due to running inside of a virtualized environment.  Please read https://docs.julialang.org/en/v1/devdocs/sysimg/ for more.
$ lscpu
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         48 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  32
  On-line CPU(s) list:   0-31
Vendor ID:               AuthenticAMD
  Model name:            AMD Ryzen 9 5950X 16-Core Processor
    CPU family:          25
    Model:               33
    Thread(s) per core:  2
    Core(s) per socket:  16
    Socket(s):           1
    Stepping:            0
    Frequency boost:     disabled
    CPU(s) scaling MHz:  67%
    CPU max MHz:         6017.8462
    CPU min MHz:         2200.0000
    BogoMIPS:            8050.09
    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 constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse
                         3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_p
                         state ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbn
                         oinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm
Virtualization features: 
  Virtualization:        AMD-V
Caches (sum of all):     
  L1d:                   512 KiB (16 instances)
  L1i:                   512 KiB (16 instances)
  L2:                    8 MiB (16 instances)
  L3:                    64 MiB (2 instances)
NUMA:                    
  NUMA node(s):          1
  NUMA node0 CPU(s):     0-31
Vulnerabilities:         
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP always-on, RSB filling
  Srbds:                 Not affected
  Tsx async abort:       Not affected
@vtjnash
Copy link
Member

vtjnash commented Jun 12, 2022

This also means Julia doesn't recognize the name znver3 (we only list features up to znver2). Perhaps we should improve the error message to clarify that?

@LebedevRI
Copy link
Contributor Author

This also means Julia doesn't recognize the name znver3 (we only list features up to znver2).

o_O
And yet,

 /opt/julia/bin/julia --cpu-target help
Available CPUs for this target:
<...>
  znver3         - Select the znver3 processor.

Since Julia v1.8 is LLVM13-based, which already had good Zen3 support,
i would really expect this to work.

Does this mean --cpu-target native also picks wrong CPU?

I'm actually surprised that the target CPU is not emitted in LLVM IR metadata, similarly to how clang/halide does it.

@LebedevRI LebedevRI changed the title Julia v1.8.0-rc1: on AMD Zen 3 CPU, --cpu-target native works but --cpu-target znver3 fails with "missing CX16 instruction support" Julia v1.8.0-rc1: support for znver3 (even though underlying LLVM13 supports is) is missing Jun 12, 2022
@gbaraldi
Copy link
Member

One has to do something similar to #44696 but for zen 3.

LebedevRI added a commit to LebedevRI/julia that referenced this issue Jun 13, 2022
I've omitted `invpcid` feature since it's clearly omitted for other CPU's.

It's a bit sad that the very same code
is being repeated in every project :/

Fixes JuliaLang#45657
@LebedevRI
Copy link
Contributor Author

One has to do something similar to #44696 but for zen 3.

Okay, thank you for the hint, done: #45663
I've verified that (with the right JULIA_CPU_TARGET in Make.inc, to actually result in usable sysmage),
--cpu-target native / --cpu-target znver3 now work for me.

Thanks.

LebedevRI added a commit to LebedevRI/julia that referenced this issue Jun 13, 2022
I've omitted `invpcid` feature since it's clearly omitted for other CPU's.

It's a bit sad that the very same code
is being repeated in every project :/

Fixes JuliaLang#45657
LebedevRI added a commit to LebedevRI/julia that referenced this issue Jun 13, 2022
I've omitted `invpcid` feature since it's clearly omitted for other CPU's.

It's a bit sad that the very same code
is being repeated in every project :/

Fixes JuliaLang#45657

(cherry picked from commit ffd11b2)
LebedevRI added a commit to LebedevRI/julia that referenced this issue Jun 13, 2022
I've omitted `invpcid` feature since it's clearly omitted for other CPU's.

It's a bit sad that the very same code
is being repeated in every project :/

Fixes JuliaLang#45657
LebedevRI added a commit to LebedevRI/julia that referenced this issue Jun 13, 2022
I've omitted `invpcid` feature since it's clearly omitted for other CPU's.

It's a bit sad that the very same code
is being repeated in every project :/

Fixes JuliaLang#45657

(cherry picked from commit 404abb4)
KristofferC pushed a commit that referenced this issue Jun 14, 2022
I've omitted `invpcid` feature since it's clearly omitted for other CPU's.

Fixes #45657
LebedevRI added a commit to LebedevRI/julia that referenced this issue Jun 14, 2022
I've omitted `invpcid` feature since it's clearly omitted for other CPU's.

Fixes JuliaLang#45657

(cherry picked from commit 3f047f7)
KristofferC pushed a commit that referenced this issue Jun 14, 2022
I've omitted `invpcid` feature since it's clearly omitted for other CPU's.

Fixes #45657

(cherry picked from commit 3f047f7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants