# Cannot install CUDA.jl on Linux

**URL:** <https://discourse.julialang.org/t/cannot-install-cuda-jl-on-linux/64625>\
**Category:** General Usage\
**Tags:** cuda\
**Created:** [July 14, 2021, 9:53am UTC](https://discourse.julialang.org/t/cannot-install-cuda-jl-on-linux/64625 "2021-07-14T09:53:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChunXi\_Zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chunxi_zhang/32/22556_2.png) [@ChunXi\_Zhang](https://discourse.julialang.org/u/ChunXi_Zhang)\
**Post date:** [July 14, 2021, 9:53am UTC](https://discourse.julialang.org/t/cannot-install-cuda-jl-on-linux/64625/1 "2021-07-14T09:53:37Z")

</div>

I’ve been using CUDA.jl on windows so far, today I switched to Manjaro, and installed the julia 1.6.1, and tried to install CUDA.jl.  
But there is an error for not founding the lib:

```julia
julia> using CUDA
[Info: Precompiling CUDA [052768ef-5323-5732-b1bb-66c8b64840ba]
ERROR: LoadError: InitError: could not load library "/home/zhangcx93/.julia/artifacts/503611619dce439df9bf3428c01561723188769b/lib/libLLVMExtra-11.so"
libLLVM-11jl.so: cannot open shared object file: No such file or directory
Stacktrace:
 [1] dlopen(s::String, flags::UInt32)
   @ Base.Libc.Libdl ./libdl.jl:114
 [2] macro expansion
   @ ~/.julia/packages/JLLWrappers/bkwIo/src/products/library_generators.jl:54 [inlined]
 [3] __init__ ()
   @ LLVMExtra_jll ~/.julia/packages/LLVMExtra_jll/DW0cO/src/wrappers/x86_64-linux-gnu-cxx11-julia_version+1.6.0.jl:8
 [4] top-level scope (repeats 2 times)
   @ none:1
during initialization of module LLVMExtra_jll
in expression starting at /home/zhangcx93/.julia/packages/LLVM/aqg20/src/LLVM.jl:1
ERROR: LoadError: Failed to precompile LLVM [929cbde3-209d-540e-8aea-75f648917ca0] to /home/zhangcx93/.julia/compiled/v1.6/LLVM/jl_XFGci6.
Stacktrace:
 [1] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
   @ Base ./loading.jl:1360
 [2] top-level scope (repeats 2 times)
   @ none:1
in expression starting at /home/zhangcx93/.julia/packages/GPUCompiler/wHjqZ/src/GPUCompiler.jl:1
ERROR: LoadError: Failed to precompile GPUCompiler [61eb1bfa-7361-4325-ad38-22787b887f55] to /home/zhangcx93/.julia/compiled/v1.6/GPUCompiler/jl_31kqo0.
Stacktrace:
 [1] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
   @ Base ./loading.jl:1360
 [2] top-level scope (repeats 2 times)
   @ none:1
in expression starting at /home/zhangcx93/.julia/packages/CUDA/02Kjq/src/CUDA.jl:1
ERROR: Failed to precompile CUDA [052768ef-5323-5732-b1bb-66c8b64840ba] to /home/zhangcx93/.julia/compiled/v1.6/CUDA/jl_xnvFXU.
Stacktrace:
 [1] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
   @ Base ./loading.jl:1360

```

It’s a fresh install, I tried to purge everything in .julia folder, and the problem remains, there is no any download error.  
And aslo I checked the file it claimed not found, it exists, and it has read permission and can be run as program.  
I checked other package involve using artifacts, like Plots, it’s working fine.

---

<div class="post-metadata">

**Author:** ![lcm](https://avatars.discourse-cdn.com/v4/letter/l/58956e/32.png) [@lcm](https://discourse.julialang.org/u/lcm)\
**Post date:** [July 17, 2021, 9:32pm UTC](https://discourse.julialang.org/t/cannot-install-cuda-jl-on-linux/64625/2 "2021-07-17T21:32:48Z")

</div>

I stumbled upon the same error trying to use ReinforcementLearning.jl on Arch Linux with linux kernel 5.12.15 and Julia 1.6.2 and don’t (yet) know how to fix this.  
Precompilation fails because the package `LLVM` fails to precompile `during initialization of module LLVMExtra_jll` (as can be seen in your stacktrace, just wanted to confirm this is exactly what i see too).  
I’m replying in order for this topic to gain some traction, and maybe someone knowing how to fix this comes around.

---

<div class="post-metadata">

**Author:** ![Pangoraw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pangoraw/32/24719_2.png) [@Pangoraw](https://discourse.julialang.org/u/Pangoraw)\
**Post date:** [July 17, 2021, 9:48pm UTC](https://discourse.julialang.org/t/cannot-install-cuda-jl-on-linux/64625/3 "2021-07-17T21:48:42Z")

</div>

I had the same issue on both Manjaro and Arch and I fixed it by installing the aur `julia-bin` package instead of `julia` as explained in [LLVMExtra JLL doesn't support USE\_SYSTEM\_LLVM · Issue #253 · maleadt/LLVM.jl · GitHub](https://github.com/maleadt/LLVM.jl/issues/253)

---

<div class="post-metadata">

**Author:** ![lcm](https://avatars.discourse-cdn.com/v4/letter/l/58956e/32.png) [@lcm](https://discourse.julialang.org/u/lcm)\
**Post date:** [July 17, 2021, 9:58pm UTC](https://discourse.julialang.org/t/cannot-install-cuda-jl-on-linux/64625/4 "2021-07-17T21:58:27Z")

</div>

Thank you! Worked for me.
