# PackageCompiler: cpu\_target silently fails to create image for specified architecture

**URL:** <https://discourse.julialang.org/t/packagecompiler-cpu-target-silently-fails-to-create-image-for-specified-architecture/99954>\
**Category:** General Usage\
**Tags:** package-compiler\
**Created:** [June 6, 2023, 5:42pm UTC](https://discourse.julialang.org/t/packagecompiler-cpu-target-silently-fails-to-create-image-for-specified-architecture/99954 "2023-06-06T17:42:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nrontsis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nrontsis/32/38535_2.png) [@nrontsis](https://discourse.julialang.org/u/nrontsis)\
**Post date:** [June 6, 2023, 5:42pm UTC](https://discourse.julialang.org/t/packagecompiler-cpu-target-silently-fails-to-create-image-for-specified-architecture/99954/1 "2023-06-06T17:42:01Z")

</div>

I am trying to build a system image for a package. The system image is built in a different machine than the one that it runs on. For efficiency reasons I want to be able to build for the cpu type of the target which is `znver3`.

Unfortunately, the resulting system image is not loadable in the target machine, resulting in:

```julia
ERROR: Unable to find compatible target in system image

```

Here is the versioninfo of the machine that created the system image:

```julia
julia> versioninfo()
Julia Version 1.9.0
Commit 8e630552924 (2023-05-07 11:25 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, icelake-server)
  Threads: 1 on 4 virtual cores
Environment:
  JULIA_GPG = 3673DF529D9049477F76B37566E3C7DC03D6E495
  JULIA_VERSION = 1.9.0
  JULIA_PATH = /usr/local/julia

```

and here is the one that is supposed to use it:

```julia
julia> versioninfo()
Julia Version 1.9.0
Commit 8e630552924 (2023-05-07 11:25 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD EPYC 7B13
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver3)
  Threads: 16 on 16 virtual cores
Environment:
  JULIA_DEPOT_PATH = /root/.julia
  JULIA_NUM_THREADS = auto

```

Note that `znver3` appears when in the output of `julia -C help` in both machines.

The code used to create the system image is:

```julia
julia -e 'using Pkg; Pkg.add("PackageCompiler")'
julia --project=/my_project/ -e 'using Pkg, PackageCompiler; create_sysimage(["MyPackage"]; sysimage_path="/my_project/sysimage.so", cpu_target="znver3")'

```

and the code that makes use of it:

```julia
julia -J/my_project/sysimage.so --project=/my_project 

```

Any ideas what is going wrong or how can I get more debug information? I can provide a full dockerized example, if that’s useful.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [June 6, 2023, 8:51pm UTC](https://discourse.julialang.org/t/packagecompiler-cpu-target-silently-fails-to-create-image-for-specified-architecture/99954/2 "2023-06-06T20:51:23Z")

</div>

maybe try setting cpu target to generic?

> <https://github.com/JuliaLang/julia/issues/48217>
>
> it is common for a user of some cluster to create remote processes via e.g. http…s://github.com/JuliaParallel/ClusterManagers.jl, the workflow essentially looks like this:
> \`\`\`julia
> | | |\_| | | | (\_| | | Version 1.8.5 (2023-01-08)
> \_/ |\\\_\_'\_|\_|\_|\\\_\_'\_| | Official https://julialang.org/ release
> |\_\_/ |
> 
> julia\> using WVZAnalysis, ClusterManagers, Distributed
> 
> julia\> addprocs(HTCManager(80))
> Waiting for 80 workers: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 .
> 
> julia\> @everywhere using WVZAnalysis
> \`\`\`
> 
> this has stopped working on 1.9-beta2 with errors like:
> \`\`\`julia
> julia\> @everywhere using WVZAnalysis
> From worker 2:	┌ Warning: The call to compilecache failed to create a usable precompiled cache file for SentinelArrays \[91c51154-3ec4-41a3-a24f-3f23e20d615c\]
> From worker 2:	│ exception = ArgumentError: Invalid checksum in cache file /home/jiling/.julia/compiled/v1.9/SentinelArrays/uMYVe\_zIiTQ.so.
> From worker 2:	└ @ Base loading.jl:1673
> From worker 3:	┌ Warning: The call to compilecache failed to create a usable precompiled cache file for SentinelArrays \[91c51154-3ec4-41a3-a24f-3f23e20d615c\]
> From worker 3:	│ exception = ArgumentError: Invalid checksum in cache file /home/jiling/.julia/compiled/v1.9/SentinelArrays/uMYVe\_zIiTQ.so.
> From worker 3:	└ @ Base loading.jl:1673
> From worker 8:	┌ Warning: The call to compilecache failed to create a usable precompiled cache file for JLLWrappers \[692b3bcd-3c85-4b1f-b108-f13ce0eb3210\]
> From worker 8:	│ exception = Required dependency Preferences \[21216c6a-2e73-6563-6e65-726566657250\] failed to load from a cache file.
> From worker 8:	└ @ Base loading.jl:1673
> From worker 2:	┌ Warning: The call to compilecache failed to create a usable precompiled cache file for JLLWrappers \[692b3bcd-3c85-4b1f-b108-f13ce0eb3210\]
> From worker 2:	│ exception = Required dependency Preferences \[21216c6a-2e73-6563-6e65-726566657250\] failed to load from a cache file.
> \`\`\`
> 
> might be related to #48057 and #48039

---

<div class="post-metadata">

**Author:** ![nrontsis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nrontsis/32/38535_2.png) [@nrontsis](https://discourse.julialang.org/u/nrontsis)\
**Post date:** [June 6, 2023, 9:07pm UTC](https://discourse.julialang.org/t/packagecompiler-cpu-target-silently-fails-to-create-image-for-specified-architecture/99954/3 "2023-06-06T21:07:13Z")

</div>

Thanks, I tried that and it works, but it can have performance implications.

---

<div class="post-metadata">

**Author:** ![nrontsis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nrontsis/32/38535_2.png) [@nrontsis](https://discourse.julialang.org/u/nrontsis)\
**Post date:** [June 7, 2023, 9:12am UTC](https://discourse.julialang.org/t/packagecompiler-cpu-target-silently-fails-to-create-image-for-specified-architecture/99954/4 "2023-06-07T09:12:08Z")

</div>

Actually, using `generic` results in a drastic slowdown in my use case.

---

<div class="post-metadata">

**Author:** ![nrontsis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nrontsis/32/38535_2.png) [@nrontsis](https://discourse.julialang.org/u/nrontsis)\
**Post date:** [June 16, 2023, 8:10am UTC](https://discourse.julialang.org/t/packagecompiler-cpu-target-silently-fails-to-create-image-for-specified-architecture/99954/5 "2023-06-16T08:10:41Z")

</div>

Soved via [Remove xsaves from Zen cpuspec by vchuravy · Pull Request #50186 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/50186) after discussion in [https://github.com/JuliaLang/julia/issues/50102](https://github.com/JuliaLang/julia/issues/50102)
