# Flux precompilation takes way too long (1.6.1)

**URL:** https://discourse.julialang.org/t/flux-precompilation-takes-way-too-long-1-6-1/61018
**Category:** New to Julia
**Created:** [May 12, 2021, 12:32pm UTC](https://discourse.julialang.org/t/flux-precompilation-takes-way-too-long-1-6-1/61018 "2021-05-12T12:32:12Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [May 12, 2021, 12:32pm UTC](https://discourse.julialang.org/t/flux-precompilation-takes-way-too-long-1-6-1/61018/1 "2021-05-12T12:32:12Z")

</div>

I am not able to use `Flux` (Linux 64 bits, Julia 1.6.1). Precompilation takes forever. Killing it and `using` it in a new section goes down the same road and precompilation never ends. I do not get any error message, though.

Any idea of what may be going on?

```julia
(@v1.6) pkg> st
      Status `~/.julia/environments/v1.6/Project.toml`
  [6e4b80f9] BenchmarkTools v0.7.0
  [336ed68f] CSV v0.8.4
  [b630d9fa] CheapThreads v0.2.3
  [46823bd8] Chemfiles v0.9.3
  [35d6a980] ColorSchemes v3.12.0
  [6f35c628] ComplexMixtures v0.4.16
  [a93c6f00] DataFrames v1.0.1
  [b4f34e82] Distances v0.10.2
  [e30172f5] Documenter v0.26.3
  [35a29f4d] DocumenterTools v0.1.10
  [fde71243] EasyFit v0.5.4
  [7a1cc6ca] FFTW v1.4.0
  [cc61a311] FLoops v0.1.10
  [587475ba] Flux v0.12.3
  [59287772] Formatting v0.4.2
  [c58ffaec] FortranFiles v0.6.0
  [28b8d3ca] GR v0.57.4
  [4c0ca9eb] Gtk v1.1.7
  [f67ccb44] HDF5 v0.15.4
  [cd3eb016] HTTP v0.9.0
  [7073ff75] IJulia v1.23.2
  [18364772] IPython v0.5.0
  [916415d5] Images v0.24.1
  [0f8b85d8] JSON3 v1.8.1
  [b964fa9f] LaTeXStrings v1.2.1
  [23fbe1c1] Latexify v0.15.5
  [bdcacae8] LoopVectorization v0.12.12
  [33e6dc65] MKL v0.4.0
  [6741aa20] Neptune v0.14.0
  [6fd5a793] Octavian v0.2.13
  [6fe1bfb0] OffsetArrays v1.7.0
  [429524aa] Optim v1.3.0
  [e29189f1] PDBTools v0.12.9
  [8314cec4] PGFPlotsX v1.2.10
  [d96e819e] Parameters v0.12.2
  [91a5bcdd] Plots v1.12.0
  [c3e4b0f8] Pluto v0.14.3
  [7f904dfe] PlutoUI v0.7.1
  [08abe8d2] PrettyTables v1.0.0
  [92933f4c] ProgressMeter v1.5.0
  [d330b81b] PyPlot v2.9.0
  [1fd47b50] QuadGK v2.4.1
  [295af30f] Revise v3.1.15
  [efcf1570] Setfield v0.7.0
  [f62ebe17] ShortCodes v0.3.2
  [aa65fe97] SnoopCompile v2.6.0
  [e2b509da] SnoopCompileCore v2.5.2
  [860ef19b] StableRNGs v1.0.0
  [90137ffa] StaticArrays v1.1.1
  [2913bbd2] StatsBase v0.33.7
  [09ab397b] StructArrays v0.5.1
  [856f2bd8] StructTypes v1.7.2
  [0c5d862f] Symbolics v0.1.24
  [b189fb0b] ThreadPools v1.2.1
  [ac1d9e8a] ThreadsX v0.1.7
  [a759f4b9] TimerOutputs v0.5.8
  [bc48ee85] Tullio v0.2.14
  [1986cc42] Unitful v1.7.0
  [45397f5d] UnitfulLatexify v1.5.1
  [42071c24] UnitfulRecipes v1.2.0
  [33b4df10] VectorizedRNG v0.2.8
  [9fa8497b] Future
  [de0858da] Printf

```

Now (not before), when I tried to use it, it started to download CUDA, and this is taking a lot of time (less than 1% per minute):

```julia
julia> using Flux
[Info: Precompiling Flux [587475ba-b771-5e3f-ad9e-33799f191a9c]
 Downloading artifact: CUDA
    Downloading [======>] 13.4 %

```

My connection is not bad. How large is that? Or there is another problem?

Also, is that what is possibly slowing down the precompilation when I first added it (without the download being shown?)

Might be this issue:

[https://github.com/FluxML/Flux.jl/issues/1554](https://github.com/FluxML/Flux.jl/issues/1554)

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [May 12, 2021, 12:46pm UTC](https://discourse.julialang.org/t/flux-precompilation-takes-way-too-long-1-6-1/61018/2 "2021-05-12T12:46:38Z")

</div>

I got curious: what are the `artifacts`? They occupy 9GB in my `.julia` directory.

(I have only some more 15Gb free space here in my SSD, so that starts to make a difference).

---

<div class="post-metadata">

### Author: ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)
#### Post date: [May 12, 2021, 1:19pm UTC](https://discourse.julialang.org/t/flux-precompilation-takes-way-too-long-1-6-1/61018/3 "2021-05-12T13:19:37Z")

</div>

`artifacts` are compiled binaries that libraries pull in. They typically occur from libraries that use C packages (like, say `Arpack`).

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [May 12, 2021, 1:22pm UTC](https://discourse.julialang.org/t/flux-precompilation-takes-way-too-long-1-6-1/61018/4 "2021-05-12T13:22:33Z")

</div>

> [@lmiq](#):
>
> (I have only some more 15Gb free space here in my SSD, so that starts to make a difference).

Run

```julia
]gc

```

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [May 12, 2021, 1:27pm UTC](https://discourse.julialang.org/t/flux-precompilation-takes-way-too-long-1-6-1/61018/5 "2021-05-12T13:27:34Z")

</div>

thanks, though after that CUDA install I have 3GB more 😬

probably I will have to restart over at some point

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [May 12, 2021, 1:29pm UTC](https://discourse.julialang.org/t/flux-precompilation-takes-way-too-long-1-6-1/61018/6 "2021-05-12T13:29:25Z")

</div>

It appears that the problem was the silent download of CUDA drivers. It finally finished (~2 hours) and it worked. The developers are aware of the issue, I don’t know why this download takes so much.

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [May 14, 2021, 12:28pm UTC](https://discourse.julialang.org/t/flux-precompilation-takes-way-too-long-1-6-1/61018/7 "2021-05-14T12:28:23Z")

</div>

Just an important update. The issue was the download of the CUDA drivers while precompiling, associated to the fact that the access to Julia servers from here (Brazil) was very slow. But now a server in São Paulo [was established](https://github.com/FluxML/Flux.jl/issues/1554#issuecomment-840849892) and everything is much, much faster here. That is an important improvement on the user experience in general for people here in Brazil.
