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

1.9.0-beta2: Unable to find compatible target in system image, when loading a package #48111

Closed
mkitti opened this issue Jan 4, 2023 · 18 comments · Fixed by #48131
Closed

1.9.0-beta2: Unable to find compatible target in system image, when loading a package #48111

mkitti opened this issue Jan 4, 2023 · 18 comments · Fixed by #48131
Labels
bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@mkitti
Copy link
Contributor

mkitti commented Jan 4, 2023

I encountered "ERROR: Unable to find compatible target in system image." when loading a package I was developing while using Julia 1.9.0-beta2.

julia> using MyPackage
ERROR: Unable to find compatible target in system image.
Stacktrace:
  [1] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:949
  [2] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1361
  [3] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1638
  [4] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1515
  [5] macro expansion
    @ ./loading.jl:1503 [inlined]
  [6] macro expansion
    @ ./lock.jl:267 [inlined]
  [7] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1466
  [8] eval
    @ ./boot.jl:370 [inlined]
  [9] eval
    @ ./Base.jl:68 [inlined]
...

I suspect this is a new variant of an old problem. The old problem occurs when compiling a system image when Julia from source. Now with native code precompilation, the problem can occurring when precompiling a package. This is likely to affect more users.

For users encountering this problem, setting the environment variable JULIA_CPU_TARGET to "generic; native" will resolve the issue. This can be done within Julia with the following command.

ENV["JULIA_CPU_TARGET"] = "generic; native"

This command can be inserted into the .julia/config/startup.jl file. Additionally, since I already have .so files, I had to remove some of the .so files located in .julia/compiled/v1.9 for the affected packages.

Previously I would say that the above would suffice, but I think a much larger set of users will encounter this issue. Perhaps we should attempt to detect older processor architectures and automatically select or include generic as a target architecture.

julia> versioninfo()
Julia Version 1.9.0-beta2
Commit 7daffeecb8c (2022-12-29 07:45 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × AMD FX(tm)-8350 Eight-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, bdver1)
  Threads: 8 on 8 virtual cores
cat /proc/cpuinfo
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 2
model name	: AMD FX(tm)-8350 Eight-Core Processor
stepping	: 0
microcode	: 0x6000852
cpu MHz		: 1400.000
cache size	: 2048 KB
physical id	: 0
siblings	: 8
core id		: 0
cpu cores	: 4
apicid		: 16
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 constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb cpb hw_pstate ssbd ibpb vmmcall bmi1 arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
bugs		: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed
bogomips	: 8668.48
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor	: 1
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 2
model name	: AMD FX(tm)-8350 Eight-Core Processor
stepping	: 0
microcode	: 0x6000852
cpu MHz		: 1400.000
cache size	: 2048 KB
physical id	: 0
siblings	: 8
core id		: 1
cpu cores	: 4
apicid		: 17
initial apicid	: 1
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 constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb cpb hw_pstate ssbd ibpb vmmcall bmi1 arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
bugs		: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed
bogomips	: 8668.48
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor	: 2
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 2
model name	: AMD FX(tm)-8350 Eight-Core Processor
stepping	: 0
microcode	: 0x6000852
cpu MHz		: 1400.000
cache size	: 2048 KB
physical id	: 0
siblings	: 8
core id		: 2
cpu cores	: 4
apicid		: 18
initial apicid	: 2
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 constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb cpb hw_pstate ssbd ibpb vmmcall bmi1 arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
bugs		: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed
bogomips	: 8668.48
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor	: 3
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 2
model name	: AMD FX(tm)-8350 Eight-Core Processor
stepping	: 0
microcode	: 0x6000852
cpu MHz		: 1516.976
cache size	: 2048 KB
physical id	: 0
siblings	: 8
core id		: 3
cpu cores	: 4
apicid		: 19
initial apicid	: 3
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 constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb cpb hw_pstate ssbd ibpb vmmcall bmi1 arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
bugs		: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed
bogomips	: 8668.48
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor	: 4
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 2
model name	: AMD FX(tm)-8350 Eight-Core Processor
stepping	: 0
microcode	: 0x6000852
cpu MHz		: 2356.330
cache size	: 2048 KB
physical id	: 0
siblings	: 8
core id		: 4
cpu cores	: 4
apicid		: 20
initial apicid	: 4
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 constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb cpb hw_pstate ssbd ibpb vmmcall bmi1 arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
bugs		: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed
bogomips	: 8668.48
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor	: 5
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 2
model name	: AMD FX(tm)-8350 Eight-Core Processor
stepping	: 0
microcode	: 0x6000852
cpu MHz		: 1400.000
cache size	: 2048 KB
physical id	: 0
siblings	: 8
core id		: 5
cpu cores	: 4
apicid		: 21
initial apicid	: 5
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 constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb cpb hw_pstate ssbd ibpb vmmcall bmi1 arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
bugs		: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed
bogomips	: 8668.48
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor	: 6
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 2
model name	: AMD FX(tm)-8350 Eight-Core Processor
stepping	: 0
microcode	: 0x6000852
cpu MHz		: 1730.829
cache size	: 2048 KB
physical id	: 0
siblings	: 8
core id		: 6
cpu cores	: 4
apicid		: 22
initial apicid	: 6
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 constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb cpb hw_pstate ssbd ibpb vmmcall bmi1 arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
bugs		: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed
bogomips	: 8668.48
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

processor	: 7
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 2
model name	: AMD FX(tm)-8350 Eight-Core Processor
stepping	: 0
microcode	: 0x6000852
cpu MHz		: 2100.000
cache size	: 2048 KB
physical id	: 0
siblings	: 8
core id		: 7
cpu cores	: 4
apicid		: 23
initial apicid	: 7
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 constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb cpb hw_pstate ssbd ibpb vmmcall bmi1 arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
bugs		: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed
bogomips	: 8668.48
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro
@vchuravy
Copy link
Member

vchuravy commented Jan 4, 2023

Can you describe a bit more what your setup was? We should have rejected the cache file before we loaded it.

Did you compile on a more modern machine and then used the cache on a older node? What are the architectures involved?

@vchuravy
Copy link
Member

vchuravy commented Jan 4, 2023

Also can you rerun Julia with: JULIA_DEBUG=loading?

@DilumAluthge DilumAluthge added the bug Indicates an unexpected problem or unintended behavior label Jan 4, 2023
@DilumAluthge DilumAluthge added this to the 1.9 milestone Jan 4, 2023
@mkitti
Copy link
Contributor Author

mkitti commented Jan 4, 2023

Can you describe a bit more what your setup was? We should have rejected the cache file before we loaded it.

This is a single Linux machine with the processor I detailed above. Something seems heterogeneous about the cores though. If I compile Julia from source without specifying JULIA_CPU_TARGET, julia will stochastically report "Unable to find compatible target in system image".

Did you compile on a more modern machine and then used the cache on a older node? What are the architectures involved?

No . It's just the processor I reported above.

@mkitti
Copy link
Contributor Author

mkitti commented Jan 4, 2023

$ JULIA_DEBUG=loading julia-1.9.0-beta2/bin/julia 
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0-beta2 (2022-12-29)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.9) pkg> activate --temp
  Activating new project at `/tmp/jl_nMTqTK`

(jl_nMTqTK) pkg> add Interpolations
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
   Installed StaticArrays ─ v1.5.12
    Updating `/tmp/jl_nMTqTK/Project.toml`
  [a98d9a8b] + Interpolations v0.14.7
    Updating `/tmp/jl_nMTqTK/Manifest.toml`
  [79e6a3ab] + Adapt v3.4.0
  [13072b0f] + AxisAlgorithms v1.0.1
  [d360d2e6] + ChainRulesCore v1.15.6
  [34da2185] + Compat v4.5.0
  [a98d9a8b] + Interpolations v0.14.7
  [6fe1bfb0] + OffsetArrays v1.12.8
  [c84ed2f1] + Ratios v0.4.3
  [ae029012] + Requires v1.3.0
  [90137ffa] + StaticArrays v1.5.12
  [1e83bf80] + StaticArraysCore v1.4.0
  [efce3f68] + WoodburyMatrices v0.5.5
  [0dad84c5] + ArgTools v1.1.1
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching
  [b77e0a4c] + InteractiveUtils
  [b27032c2] + LibCURL v0.6.3
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.8.0
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [1a1011a3] + SharedArrays
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics v1.9.0
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll v1.0.2+0
  [deac9b47] + LibCURL_jll v7.84.0+0
  [29816b5a] + LibSSH2_jll v1.10.2+0
  [c8ffd9c3] + MbedTLS_jll v2.28.0+0
  [14a3606d] + MozillaCACerts_jll v2022.10.11
  [4536629a] + OpenBLAS_jll v0.3.21+0
  [bea87d4a] + SuiteSparse_jll v5.10.1+0
  [83775a58] + Zlib_jll v1.2.13+0
  [8e850b90] + libblastrampoline_jll v5.2.0+0
  [8e850ede] + nghttp2_jll v1.48.0+0
  [3f19e933] + p7zip_jll v17.4.0+0
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/Statistics/src/Statistics.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/Statistics/ERcPL_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/Adapt/rUIgN_W9fcW.ji due to it containing an invalid cache header
└ @ Base loading.jl:2518
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/Compat/GSFWK_W9fcW.ji due to it containing an invalid cache header
└ @ Base loading.jl:2518
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/WoodburyMatrices/LdtKf_W9fcW.ji due to it containing an invalid cache header
└ @ Base loading.jl:2518
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/StaticArraysCore/Tzw28_dPJkm.ji due to it containing an invalid cache header
└ @ Base loading.jl:2518
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/Requires/IyxeS_W9fcW.ji due to it containing an invalid cache header
└ @ Base loading.jl:2518
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/Zlib_jll/src/Zlib_jll.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/Zlib_jll/xjq3Q_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/MbedTLS_jll/src/MbedTLS_jll.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/MbedTLS_jll/u5NEn_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/SuiteSparse_jll/src/SuiteSparse_jll.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/SuiteSparse_jll/ME9At_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
Precompiling┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/LibSSH2_jll/src/LibSSH2_jll.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/LibSSH2_jll/K6mup_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
 environment...
  ✗ StaticArrays
  ✗ Interpolations
  9 dependencies successfully precompiled in 21 seconds. 5 already precompiled.
  2 dependencies errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the packages

julia> import Pkg; Pkg.precompile()
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/Statistics/src/Statistics.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/Statistics/ERcPL_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/Zlib_jll/src/Zlib_jll.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/Zlib_jll/xjq3Q_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/MbedTLS_jll/src/MbedTLS_jll.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/MbedTLS_jll/u5NEn_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/SuiteSparse_jll/src/SuiteSparse_jll.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/SuiteSparse_jll/ME9At_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/LibSSH2_jll/src/LibSSH2_jll.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/LibSSH2_jll/K6mup_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/Interpolations/VpKVx_W9fcW.ji due to it containing an invalid cache header
└ @ Base loading.jl:2518
Precompiling environment...
  ✗ Interpolations
  0 dependencies successfully precompiled in 5 seconds. 15 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

Interpolations [a98d9a8b-a2ab-59e6-89dd-64a1c18fca59]

Failed to precompile Interpolations [a98d9a8b-a2ab-59e6-89dd-64a1c18fca59] to "/home/mkitti/.julia/compiled/v1.9/Interpolations/jl_QYb6WL".
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/Statistics/src/Statistics.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/Statistics/ERcPL_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Loading object cache file /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/Statistics/ERcPL_2A8RB.so for Statistics [10745b16-79ce-11e8-11f9-7d13ad32a3b2]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/StaticArraysCore/Tzw28_QorxP.so for StaticArraysCore [1e83bf80-4336-4d27-bf5d-d5a4f845583c]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/StaticArrays/yY9vm_QorxP.so for StaticArrays [90137ffa-7385-5640-81b9-e52037218182]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/WoodburyMatrices/LdtKf_QorxP.so for WoodburyMatrices [efce3f68-66dc-5838-9240-27a6d6f5f9b6]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/Requires/IyxeS_QorxP.so for Requires [ae029012-a4dd-5104-9daa-d747884805df]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/Ratios/zQEsd_QorxP.so for Ratios [c84ed2f1-dad5-54f0-aa8e-dbefe2724439]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/AxisAlgorithms/lW7vi_QorxP.so for AxisAlgorithms [13072b0f-2c55-5437-9ae7-d433b7a33950]
└ @ Base loading.jl:948
┌ Debug: Ignoring cache file /home/mkitti/.julia/compiled/v1.9/Adapt/rUIgN_QorxP.ji for Adapt [79e6a3ab-5dfb-504d-930d-738a2a938a0e] (fafbfcfd-3161-dc13-0000-68ff7f70a1d9) since it is does not provide desired build_id (fafbfcfd-406d-1f28-0000-68fb7b596f42)
└ @ Base loading.jl:2556
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/Adapt/rUIgN_W9fcW.ji due to it containing an invalid cache header
└ @ Base loading.jl:2518
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/OffsetArrays/UDEDl_QorxP.ji because required dependency Adapt [79e6a3ab-5dfb-504d-930d-738a2a938a0e] with build ID fafbfcfd-406d-1f28-0000-68fb7b596f42 is missing from the cache.
└ @ Base loading.jl:1330
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/OffsetArrays/UDEDl_W9fcW.ji due to it containing an invalid cache header
└ @ Base loading.jl:2518
┌ Debug: Precompiling OffsetArrays [6fe1bfb0-de20-5000-8ca7-80f57d26f881]
└ @ Base loading.jl:2029
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/Adapt/rUIgN_QorxP.ji for Adapt [79e6a3ab-5dfb-504d-930d-738a2a938a0e] since pkgimage can't be loaded on this target
└ @ Base loading.jl:2538
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/Adapt/rUIgN_W9fcW.ji due to it containing an invalid cache header
└ @ Base loading.jl:2518
┌ Debug: Precompiling Adapt [79e6a3ab-5dfb-504d-930d-738a2a938a0e]
└ @ Base loading.jl:2029
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/Adapt/rUIgN_QorxP.so for Adapt [79e6a3ab-5dfb-504d-930d-738a2a938a0e]
└ @ Base loading.jl:948
ERROR: LoadError: Unable to find compatible target in system image.
Stacktrace:
  [1] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:949
  [2] _tryrequire_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String)
    @ Base ./loading.jl:1297
  [3] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1671
  [4] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1515
  [5] macro expansion
    @ ./loading.jl:1503 [inlined]
  [6] macro expansion
    @ ./lock.jl:267 [inlined]
  [7] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1466
  [8] include
    @ ./Base.jl:452 [inlined]
  [9] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base ./loading.jl:1900
 [10] top-level scope
    @ stdin:2
in expression starting at /home/mkitti/.julia/packages/OffsetArrays/WvkHl/src/OffsetArrays.jl:1
in expression starting at stdin:2
ERROR: LoadError: Failed to precompile OffsetArrays [6fe1bfb0-de20-5000-8ca7-80f57d26f881] to "/home/mkitti/.julia/compiled/v1.9/OffsetArrays/jl_rUieRP".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2124
  [3] compilecache
    @ ./loading.jl:2016 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1515
  [6] macro expansion
    @ ./loading.jl:1503 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1466
  [9] include
    @ ./Base.jl:452 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:1900
 [11] top-level scope
    @ stdin:2
in expression starting at /home/mkitti/.julia/packages/Interpolations/nDwIa/src/Interpolations.jl:1
in expression starting at stdin:2
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types ~/src/julia-1.9.0-beta2/share/julia/stdlib/v1.9/Pkg/src/Types.jl:68
 [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{String}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API ~/src/julia-1.9.0-beta2/share/julia/stdlib/v1.9/Pkg/src/API.jl:1473
 [3] precompile
   @ ~/src/julia-1.9.0-beta2/share/julia/stdlib/v1.9/Pkg/src/API.jl:1075 [inlined]
 [4] #precompile#217
   @ ~/src/julia-1.9.0-beta2/share/julia/stdlib/v1.9/Pkg/src/API.jl:1074 [inlined]
 [5] precompile
   @ ~/src/julia-1.9.0-beta2/share/julia/stdlib/v1.9/Pkg/src/API.jl:1074 [inlined]
 [6] precompile()
   @ Pkg.API ~/src/julia-1.9.0-beta2/share/julia/stdlib/v1.9/Pkg/src/API.jl:1074
 [7] top-level scope
   @ REPL[3]:1

@mkitti
Copy link
Contributor Author

mkitti commented Jan 4, 2023

Now with JULIA_CPU_TARGET set with generic.

$ JULIA_CPU_TARGET="generic; native" JULIA_DEBUG=loading julia-1.9.0-beta2/bin/julia 
              _
  _       _ _(_)_     |  Documentation: https://docs.julialang.org
 (_)     | (_) (_)    |
  _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
 | | | | | | |/ _` |  |
 | | |_| | | | (_| |  |  Version 1.9.0-beta2 (2022-12-29)
_/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.9) pkg> activate --temp
 Activating new project at `/tmp/jl_6AE6hc`

(jl_6AE6hc) pkg> add Interpolations
   Updating registry at `~/.julia/registries/General.toml`
  Resolving package versions...
   Updating `/tmp/jl_6AE6hc/Project.toml`
 [a98d9a8b] + Interpolations v0.14.7
   Updating `/tmp/jl_6AE6hc/Manifest.toml`
 [79e6a3ab] + Adapt v3.4.0
 [13072b0f] + AxisAlgorithms v1.0.1
 [d360d2e6] + ChainRulesCore v1.15.6
 [34da2185] + Compat v4.5.0
 [a98d9a8b] + Interpolations v0.14.7
 [6fe1bfb0] + OffsetArrays v1.12.8
 [c84ed2f1] + Ratios v0.4.3
 [ae029012] + Requires v1.3.0
 [90137ffa] + StaticArrays v1.5.12
 [1e83bf80] + StaticArraysCore v1.4.0
 [efce3f68] + WoodburyMatrices v0.5.5
 [0dad84c5] + ArgTools v1.1.1
 [56f22d72] + Artifacts
 [2a0f44e3] + Base64
 [ade2ca70] + Dates
 [8ba89e20] + Distributed
 [f43a241f] + Downloads v1.6.0
 [7b1f6079] + FileWatching
 [b77e0a4c] + InteractiveUtils
 [b27032c2] + LibCURL v0.6.3
 [76f85450] + LibGit2
 [8f399da3] + Libdl
 [37e2e46d] + LinearAlgebra
 [56ddb016] + Logging
 [d6f4376e] + Markdown
 [a63ad114] + Mmap
 [ca575930] + NetworkOptions v1.2.0
 [44cfe95a] + Pkg v1.8.0
 [de0858da] + Printf
 [3fa0cd96] + REPL
 [9a3f8284] + Random
 [ea8e919c] + SHA v0.7.0
 [9e88b42a] + Serialization
 [1a1011a3] + SharedArrays
 [6462fe0b] + Sockets
 [2f01184e] + SparseArrays
 [10745b16] + Statistics v1.9.0
 [fa267f1f] + TOML v1.0.3
 [a4e569a6] + Tar v1.10.0
 [cf7118a7] + UUIDs
 [4ec0a83e] + Unicode
 [e66e0078] + CompilerSupportLibraries_jll v1.0.2+0
 [deac9b47] + LibCURL_jll v7.84.0+0
 [29816b5a] + LibSSH2_jll v1.10.2+0
 [c8ffd9c3] + MbedTLS_jll v2.28.0+0
 [14a3606d] + MozillaCACerts_jll v2022.10.11
 [4536629a] + OpenBLAS_jll v0.3.21+0
 [bea87d4a] + SuiteSparse_jll v5.10.1+0
 [83775a58] + Zlib_jll v1.2.13+0
 [8e850b90] + libblastrampoline_jll v5.2.0+0
 [8e850ede] + nghttp2_jll v1.48.0+0
 [3f19e933] + p7zip_jll v17.4.0+0
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/Statistics/src/Statistics.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/Statistics/ERcPL_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/Adapt/rUIgN_QorxP.ji for  [top-level] since pkgimage can't be loaded on this target
└ @ Base loading.jl:2538
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/Compat/GSFWK_QorxP.ji for  [top-level] since pkgimage can't be loaded on this target
└ @ Base loading.jl:2538
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/Zlib_jll/src/Zlib_jll.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/Zlib_jll/xjq3Q_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/MbedTLS_jll/src/MbedTLS_jll.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/MbedTLS_jll/u5NEn_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/SuiteSparse_jll/src/SuiteSparse_jll.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/SuiteSparse_jll/ME9At_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/Adapt/rUIgN_W9fcW.ji due to it containing an invalid cache header
└ @ Base loading.jl:2518
┌ Debug: Rejecting cache file /home/mkitti/.julia/compiled/v1.9/Compat/GSFWK_W9fcW.ji due to it containing an invalid cache header
└ @ Base loading.jl:2518
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/LibSSH2_jll/src/LibSSH2_jll.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/LibSSH2_jll/K6mup_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
Precompiling environment...
 5 dependencies successfully precompiled in 20 seconds. 11 already precompiled.

julia> using Interpolations
┌ Debug: Skipping mtime check for file /cache/build/default-amdci5-1/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/Statistics/src/Statistics.jl used by /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/Statistics/ERcPL_2A8RB.ji, since it is a stdlib
└ @ Base loading.jl:2627
┌ Debug: Loading object cache file /home/mkitti/src/julia-1.9.0-beta2/share/julia/compiled/v1.9/Statistics/ERcPL_2A8RB.so for Statistics [10745b16-79ce-11e8-11f9-7d13ad32a3b2]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/StaticArraysCore/Tzw28_Cd0mR.so for StaticArraysCore [1e83bf80-4336-4d27-bf5d-d5a4f845583c]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/StaticArrays/yY9vm_Cd0mR.so for StaticArrays [90137ffa-7385-5640-81b9-e52037218182]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/WoodburyMatrices/LdtKf_Cd0mR.so for WoodburyMatrices [efce3f68-66dc-5838-9240-27a6d6f5f9b6]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/Requires/IyxeS_Cd0mR.so for Requires [ae029012-a4dd-5104-9daa-d747884805df]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/Ratios/zQEsd_Cd0mR.so for Ratios [c84ed2f1-dad5-54f0-aa8e-dbefe2724439]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/AxisAlgorithms/lW7vi_Cd0mR.so for AxisAlgorithms [13072b0f-2c55-5437-9ae7-d433b7a33950]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/Adapt/rUIgN_Cd0mR.so for Adapt [79e6a3ab-5dfb-504d-930d-738a2a938a0e]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/OffsetArrays/UDEDl_Cd0mR.so for OffsetArrays [6fe1bfb0-de20-5000-8ca7-80f57d26f881]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/Compat/GSFWK_Cd0mR.so for Compat [34da2185-b29b-5c13-b0c7-acf172513d20]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/ChainRulesCore/G6ax7_Cd0mR.so for ChainRulesCore [d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4]
└ @ Base loading.jl:948
┌ Debug: Loading object cache file /home/mkitti/.julia/compiled/v1.9/Interpolations/VpKVx_Cd0mR.so for Interpolations [a98d9a8b-a2ab-59e6-89dd-64a1c18fca59]
└ @ Base loading.jl:948

@mkitti
Copy link
Contributor Author

mkitti commented Jan 4, 2023

Two suggestions:

  1. We may want to modify the error message to indicate this a problem with package cache
  2. We may want to defensively use a generic CPU target on older AMD architectures.

@mkitti
Copy link
Contributor Author

mkitti commented Jan 5, 2023

I found the difference between my cores. Only half of them have "LWP" or Lightweight Profiling Specification

using CpuId
f = [Symbol[] for i in 1:Threads.nthreads()];
Threads.@threads for i in 1:Threads.nthreads()
    f[Threads.threadid()] = cpufeatures()
end
all_features = union(f...);

julia> setdiff.((all_features,), f)
8-element Vector{Vector{Symbol}}:
 []
 []
 [:LWP]
 [:LWP]
 []
 []
 [:LWP]
 [:LWP]

flags = split.(Iterators.filter(startswith("flag"), eachline("/proc/cpuinfo"))," ");
all_flags = union(flags...);

julia> setdiff.((all_flags,), flags)
8-element Vector{Vector{SubString{String}}}:
 ["lwp"]
 []
 ["lwp"]
 []
 ["lwp"]
 []
 ["lwp"]
 []

Part of this is because the Bulldozer architecture is actually 4 cores masquerading as 8 cores:
https://en.wikipedia.org/wiki/Bulldozer_(microarchitecture)#False_advertising_lawsuit

https://www.youtube.com/watch?v=RpcDF-qQHIo

@mkitti
Copy link
Contributor Author

mkitti commented Jan 5, 2023

Related:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86007 (RESOLVED, INVALID)
https://bugzilla.kernel.org/show_bug.cgi?id=216211 (REOPENED, patch available that disables lwp on all cores)

@mkitti
Copy link
Contributor Author

mkitti commented Jan 5, 2023

In my case, I think I want to use either JULIA_CPU_TARGET="bdver1,-lwp" julia or julia -C "bdver1,-lwp"

I got the processor name from

julia> Sys.CPU_NAME
"bdver1"

@giordano
Copy link
Contributor

giordano commented Jan 5, 2023

I don't think we can do much about this, apart from documenting this more explicitly somewhere. But heterogeneous systems are always problematic like that, and this isn't limited to Julia as the GCC bug report shows. What changed is that pkgimages cache the native code in advance, like statically compiled languages typically do, instead of compiling on-the-fly.

@vchuravy
Copy link
Member

vchuravy commented Jan 5, 2023

Oh this is devious... I think we can on our side define bulldozer as -lwp

@mkitti
Copy link
Contributor Author

mkitti commented Jan 5, 2023

Lightweight Profiling was introduced in Bulldozer (Fam15h), but was dropped
from Zen (Fam17h) processors. Furthermore, LWP was dropped from Fam15/16 CPUs
when IBPB for Spectre v2 was introduced in microcode, owing to LWP not being
used in practice.

https://patchwork.kernel.org/project/xen-devel/patch/[email protected]/

To summarize the above, AMD Bulldozer, Piledriver, Steamroller and Excavator processors have a featured called LWP, or "Lightweight Profiling". This feature was later disabled by a microcode update. However, the Linux kernel only applied the microcode update to half the cores due to a bug. A Linux kernel patch has been developed to deploy the microcode update to all cores, disabling lwp everywhere.

While we could just wait for the Linux kernel to be patched, an alternative would be just to drop detection of that feature in Julia since AMD no longer supports it.

@giordano
Copy link
Contributor

giordano commented Jan 5, 2023

Oh this is devious... I think we can on our side define bulldozer as -lwp

We can special case some CPUs (is it worth it since it's so old? Also, if anything should it be done at llvm-level rather than in Julia?), but again, there can be other heterogeneous systems where you can't do much.

@vchuravy
Copy link
Member

vchuravy commented Jan 5, 2023

@mkitti can you try if #48131 solves the issue for you?

@giordano Yeah the particular devious case is that the scheduler migrated use between cores with different feature flags and so we verified that we could load the cache on one core, and then loaded it on another core.

I think everyone else with heterogeneous cores is currently using the same feature set among them (since otherwise migrating a process wouldn't work).

@mkitti
Copy link
Contributor Author

mkitti commented Jan 5, 2023

I'm building it now.

@mkitti
Copy link
Contributor Author

mkitti commented Jan 5, 2023

julia/src/processor.cpp:848:
julia/src/processor_x86.cpp:222:77: error: 'lwp' was not declared in this scope
  222 |                                                      prfchw, pclmul, xsave, lwp);
      |                                                                             ^~~

Fix:

diff --git a/src/processor_x86.cpp b/src/processor_x86.cpp
index 6f064ddd47..c61712ada7 100644
--- a/src/processor_x86.cpp
+++ b/src/processor_x86.cpp
@@ -219,7 +219,7 @@ constexpr auto btver2 = btver1 | get_feature_masks(sse41, sse42, avx, aes, pclmu
                                                    movbe, xsave, xsaveopt);
 
 constexpr auto bdver1 = amdfam10 | get_feature_masks(xop, fma4, avx, ssse3, sse41, sse42, aes,
-                                                     prfchw, pclmul, xsave, lwp);
+                                                     prfchw, pclmul, xsave);
 constexpr auto bdver2 = bdver1 | get_feature_masks(f16c, bmi, tbm, fma);
 constexpr auto bdver3 = bdver2 | get_feature_masks(xsaveopt, fsgsbase);
 constexpr auto bdver4 = bdver3 | get_feature_masks(avx2, bmi2, mwaitx, movbe, rdrnd);

@mkitti
Copy link
Contributor Author

mkitti commented Jan 5, 2023

With my patch, it seems to be working well so far!

@mkitti
Copy link
Contributor Author

mkitti commented Jan 5, 2023

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants