# Error precompiling on cluster

**URL:** <https://discourse.julialang.org/t/error-precompiling-on-cluster/104974>\
**Category:** General Usage\
**Tags:** question, cluster, precompilation\
**Created:** [October 15, 2023, 8:43am UTC](https://discourse.julialang.org/t/error-precompiling-on-cluster/104974 "2023-10-15T08:43:05Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Post date:** [October 16, 2023, 2:20pm UTC](https://discourse.julialang.org/t/error-precompiling-on-cluster/104974/21 "2023-10-16T14:20:13Z")

</div>

Note also that [another way](https://discourse.julialang.org/t/julia-1-9-same-depot-with-different-machines/103463/17) to get the CPU info is

```julia
julia -e 'println(Sys.CPU_NAME)'

```

---

<div class="post-metadata">

**Author:** ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Post date:** [October 18, 2023, 7:33am UTC](https://discourse.julialang.org/t/error-precompiling-on-cluster/104974/22 "2023-10-18T07:33:20Z")

</div>

I just wanted to update here that my first attempt

```julia
export JULIA_CPU_TARGET="generic"

```

Surprisingly worked.

---

<div class="post-metadata">

**Author:** ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Post date:** [October 18, 2023, 8:49am UTC](https://discourse.julialang.org/t/error-precompiling-on-cluster/104974/23 "2023-10-18T08:49:28Z")

</div>

This will work, but will likely lead to slow code as the compiled package code is not specialised for your system. The other options are expected to improve the performance

---

<div class="post-metadata">

**Author:** ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Post date:** [October 19, 2023, 8:41am UTC](https://discourse.julialang.org/t/error-precompiling-on-cluster/104974/24 "2023-10-19T08:41:59Z")

</div>

This summarizes the solution to my issue.

The culprit was indeed in @jishnub tip:

> [@jishnub](#):
>
> `export JULIA_CPU_TARGET="generic;skylake-avx512,clone_all;znver2,clone_all"`

For me, I have an LSF cluster, and the appropriate way to find the CPU of the nodes is to run

```julia
lshosts -w

```

This shows that many CPUs are `Intel_Skylake`, but does not reveal the full details of the CPU.  
Setting in `.bashrc`

```julia
export JULIA_CPU_TARGET="generic;skylake,clone_all;icelake-server,clone_all"

```

solved the issue.

Let me also mention that for the LSF cluster, one can submit the job to run only on nodes with a specific CPU. I used when I run `bsub` this option

```julia
-R select [model=Intel_Skylake]

```

Thanks, Everyone!

---

<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:** [October 20, 2023, 3:15pm UTC](https://discourse.julialang.org/t/error-precompiling-on-cluster/104974/26 "2023-10-20T15:15:03Z")

</div>

> [@jishnub](#):
>
> `export JULIA_CPU_TARGET="generic;skylake-avx512,clone_all;znver2,clone_all"`

this doesn’t help for my case because both login and remote says:

```julia
$ julia -e 'println(Sys.CPU_NAME)'
znver2

```

---

<div class="post-metadata">

**Author:** ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Post date:** [October 23, 2023, 7:10am UTC](https://discourse.julialang.org/t/error-precompiling-on-cluster/104974/27 "2023-10-23T07:10:58Z")

</div>

Do you know why? I do not know why it does not help in your case…

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [January 9, 2024, 2:14am UTC](https://discourse.julialang.org/t/error-precompiling-on-cluster/104974/28 "2024-01-09T02:14:09Z")

</div>

Why doesn’t Julia detect if the current CPU is compatible, before loading cached binaries?

I’m getting lazy, so I just use the same `CPU_TARGET` setting as the official Julia binaries:

```julia
export JULIA_CPU_TARGET="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"

```

I’ll change it to something more specific only if I need to run a job consuming more than a few thousand CPU hours…

[Previous page](https://discourse.julialang.org/t/error-precompiling-on-cluster/104974.md?page=1)
