# Ask for official guide for Julia installation, deployment and use on Linux cluster

**URL:** <https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396>\
**Category:** Tooling\
**Tags:** question, hpc, linux, cluster, server\
**Created:** [January 29, 2024, 1:32pm UTC](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396 "2024-01-29T13:32:29Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [January 30, 2024, 4:21pm UTC](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396/21 "2024-01-30T16:21:39Z")

</div>

That’s great! Look forward to seeing it born! 😀

---

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [January 30, 2024, 4:40pm UTC](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396/22 "2024-01-30T16:40:49Z")

</div>

Last time I tried, I was able to avoid this issue by running a very small computation sequentially on one node, before running the full parallel computation. The rationale was that if precompilation is performed sequentially by a single node, then there wouldn’t be conflicts between nodes at the beginning of the parallel run. Not sure this is guaranteed to work, but maybe worth trying?

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [January 30, 2024, 6:15pm UTC](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396/23 "2024-01-30T18:15:56Z")

</div>

@greatpet consider adding those tips to our guide, they are very helpful:

> **[GitHub - Arpeggeo/julia-distributed-computing: The ultimate guide to...](https://github.com/Arpeggeo/julia-distributed-computing)**
>
> The ultimate guide to distributed computing in Julia - GitHub - Arpeggeo/julia-distributed-computing: The ultimate guide to distributed computing in Julia

---

<div class="post-metadata">

**Author:** ![tamasgal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamasgal/32/27946_2.png) [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Post date:** [January 31, 2024, 10:21am UTC](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396/24 "2024-01-31T10:21:52Z")

</div>

Yes, that’s something which worked here and there but I guess it boils down to how many invalidations are caused during the processing. Some jobs might trigger recompiliation… That being said, this workaround is not consistent enough, unfortunately.

---

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [February 1, 2024, 7:20am UTC](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396/25 "2024-02-01T07:20:20Z")

</div>

> [@ffevotte](#):
>
> ```julia
> # Environment variables
> export PATH=$PATH:/path/to/julia-1.9.3/bin
> 
> ```

Writing this line in the submission script doesn’t seem to have priority over that in the file `~/.bashrc`. I submitted this SLURM script when there was an environment variable written in the `~/.bashrc` file pointing to another version of Julia and it turned out that the Julia actually executing the code is not the julia-1.9.3 I specified in the SLURM script.

Do I also have to make sure that no other version of Julia is specified in the `~/.bashrc` file before I submit such a SLURM script?

---

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [February 1, 2024, 1:54pm UTC](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396/26 "2024-02-01T13:54:33Z")

</div>

> [@WuSiren](#):
>
> Writing this line in the submission script doesn’t seem to have priority over that in the file `~/.bashrc`.

Yes, the first entries in the PATH take precedence over the following ones. If you prepend the julia path before the existing contents of `PATH`, then the version specified in the SLURM submission script will take precedence:

```julia
export PATH=/path/to/julia-1.9.3/bin:$PATH

```

---

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [February 1, 2024, 3:24pm UTC](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396/27 "2024-02-01T15:24:44Z")

</div>

Ah, that makes sense. Thanks a lot!

---

<div class="post-metadata">

**Author:** ![yvikhlya](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yvikhlya/32/3753_2.png) [@yvikhlya](https://discourse.julialang.org/u/yvikhlya)\
**Post date:** [February 1, 2024, 4:02pm UTC](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396/28 "2024-02-01T16:02:45Z")

</div>

The way I use Julia on SLURM cluster is I manage installation with juliaup, then submit an interactive job like this:

```julia
$ salloc --x11 --time=1:00:00 --nodes=1 --tasks-per-node=126 --constrain=mil --qos=debug

```

This imports all environment from the calling shell on my cluster, so I don’t need to set up PATH etc. Then I call Julia normal way:

```julia
$ jullia
> using Distributed
> addprocs(126)
> @everywhere using MyPackage
> @everywhere include("my_script.jl")

```

This works. Submitting a job with `sbatch` also works. Julia compiler knows when it needs to recompile packages (usually when I switch between Milan an Cascade Lake nodes, besides different architecture, they run different OS too). Compilation takes some time, so I try to run my jobs on same type of nodes.

P.S. If your environment variables are not propagated from login shell into SLURM session, I believe `sbatch --export=ALL ...` or setting `SLURM_EXPORT_ENV` variable may be usefull.

---

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [February 1, 2024, 4:44pm UTC](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396/29 "2024-02-01T16:44:12Z")

</div>

Thanks! I’m being curious about the interactive work mode of SLURM but not quite familiar with that for now.

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [February 1, 2024, 5:06pm UTC](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396/30 "2024-02-01T17:06:26Z")

</div>

@WuSiren For a simple interactive job

sbatch --nodes=1 --ntasks-per-node=1 -i - -pty /bin/bash

---

<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:** [September 9, 2024, 7:25pm UTC](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396/31 "2024-09-09T19:25:10Z")

</div>

Now I recommend this guide:  
[https://juliahpc.github.io/](https://juliahpc.github.io/)  
(In particular, item (4) in my old long answer in this thread is not considered ideal.)

---

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [December 1, 2025, 11:10am UTC](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396/32 "2025-12-01T11:10:11Z")

</div>

> [@ffevotte](#):
>
> ```julia-auto
> # Environment variables
> export PATH=$PATH:/path/to/julia-1.9.3/bin
> export JULIA_CPU_TARGET="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"
> ## other env vars here as needed
> 
> ```

If I’m going to use the GPU partition on the cluster, how should I modify this part of the code?

I found it `Failed to precompile CUDA [052768ef-5323-5732-b1bb-66c8b64840ba]` when I used the original code.

[Previous page](https://discourse.julialang.org/t/ask-for-official-guide-for-julia-installation-deployment-and-use-on-linux-cluster/109396.md?page=1)
