Failed to precompile CUDA

julia> using CUDA
┌ Warning: Circular dependency detected. Precompilation will be skipped for:
│   SparseArraysExt [85068d23-b5fb-53f1-8204-05c2aba6942f]
│   AtomixCUDAExt [13011619-4c7c-5ef0-948f-5fc81565cd05]
│   LinearAlgebraExt [66d79d19-2cc4-5b0b-ac7a-b340256d1ecd]
│   GPUArrays [0c68f7d7-f131-5f86-a1c3-88cf8149b2d7]
│   KernelAbstractions [63c18a36-062a-441e-b654-da1e3ab1ce7c]
│   CUDA [052768ef-5323-5732-b1bb-66c8b64840ba]
└ @ Pkg.API /somepath/Software/julia-1.10.3/share/julia/stdlib/v1.10/Pkg/src/API.jl:1239

[ Info: Precompiling CUDA [052768ef-5323-5732-b1bb-66c8b64840ba]
ERROR: LoadError: ArgumentError: Platform `riscv64-linux-gnu-cxx03-llvm_version+20.asserts` is not an officially supported platform
...
ERROR: LoadError: Failed to precompile LLVMExtra_jll [dad2f222-ce93-54a1-a47d-0025e8a3acab] to "/home/name/.julia/compiled/v1.10/LLVMExtra_jll/jl_q7V02j".
...
ERROR: LoadError: Failed to precompile LLVM [929cbde3-209d-540e-8aea-75f648917ca0] to "/home/name/.julia/compiled/v1.10/LLVM/jl_vLDbEp".
...
ERROR: LoadError: Failed to precompile GPUCompiler [61eb1bfa-7361-4325-ad38-22787b887f55] to "/home/name/.julia/compiled/v1.10/GPUCompiler/jl_nmJKIc".
...
ERROR: Failed to precompile CUDA [052768ef-5323-5732-b1bb-66c8b64840ba] to "/home/name/.julia/compiled/v1.10/CUDA/jl_b9MMFH".
...

Can you share the output of:

using Pkg
Pkg.status()

?
And the output of

versioninfo()

?

1 Like
(test) pkg> status
Status `/somepath/test/Project.toml`
  [052768ef] CUDA v5.9.5
julia> versioninfo()
Julia Version 1.10.3
Commit 0b4590a5507 (2024-04-30 10:59 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 56 × Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake-avx512)
Threads: 1 default, 0 interactive, 1 GC (on 56 virtual cores)
Environment:
  LD_LIBRARY_PATH = ...
  JULIA_PKG_SERVER = ...

Now I might have figured out what the problem is. It could be because I used a portable version of Julia 1.10. When I used another installation version of 1.11, everything worked fine.

1 Like

You deleted the LD_LIBRARY_PATH in your reply, but it could also be the reason for your failure. You could try to set it to an empty string.

1 Like

Ah, I think it’s too lengthy. What is this for? I see that it involves many paths. If it is set to be empty, will it cause any bad consequences?

When loading shared libraries, the OS looks in the folders in this path first. The libraries Julia needs are, for example, in this directory:

/.julia/juliaup/julia-1.10.10+0.x64.linux.gnu/lib/julia

If the same libraries are - in a slightly different version - in any of the folders in
LD_LIBRARY_PATH, those are loaded instead of the official Julia libraries. This usually results in a crash.

This variable may be required for other command-line applications you are using. If so, you should set it only for these applications and delete it before starting Julia.

1 Like

It makes sense. Thank you very much.

But I checked the paths in LD_LIBRARY_PATH carefully and didn’t find any julia related path.