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.

Not only Julia related paths can cause problems, but any folder that contains any of these libraries:

ufechner@ufryzen:~/.julia/juliaup/julia-1.10.10+0.x64.linux.gnu/lib/julia$ ls
libamd.so                    libgcc_s.so.1                 libLLVM.so                librbio.so.4.2.1
libamd.so.3                  libgfortran.so                libmbedcrypto.so          libspqr.so
libamd.so.3.2.1              libgfortran.so.5              libmbedcrypto.so.2.28.2   libspqr.so.4
libatomic.so                 libgfortran.so.5.0.0          libmbedcrypto.so.7        libspqr.so.4.2.1
libatomic.so.1               libgit2.so                    libmbedtls.so             libssh2.so
libatomic.so.1.2.0           libgit2.so.1.6                libmbedtls.so.14          libssh2.so.1
libblastrampoline.so         libgit2.so.1.6.4              libmbedtls.so.2.28.2      libssh2.so.1.0.1
libblastrampoline.so.5       libgmp.so                     libmbedx509.so            libssp.so
libblastrampoline.so.5.11.0  libgmp.so.10                  libmbedx509.so.1          libssp.so.0
libbtf.so                    libgmp.so.10.4.1              libmbedx509.so.2.28.2     libssp.so.0.0.0
libbtf.so.2                  libgmpxx.so                   libmpfr.so                libstdc++.so
libbtf.so.2.2.1              libgmpxx.so.4                 libmpfr.so.6              libstdc++.so.6
libcamd.so                   libgmpxx.so.4.6.1             libmpfr.so.6.2.0          libstdc++.so.6.0.32
libcamd.so.3                 libgomp.so                    libnghttp2.so             libsuitesparseconfig.so
libcamd.so.3.2.1             libgomp.so.1                  libnghttp2.so.14          libsuitesparseconfig.so.7
libccalltest.so              libgomp.so.1.0.0              libnghttp2.so.14.24.1     libsuitesparseconfig.so.7.2.1
libccalltest.so.debug        libjulia-codegen.so           libopenblas64_.0.3.23.so  libumfpack.so
libccolamd.so                libjulia-codegen.so.1.10      libopenblas64_.so         libumfpack.so.6
libccolamd.so.3              libjulia-codegen.so.1.10.10   libopenblas64_.so.0       libumfpack.so.6.2.1
libccolamd.so.3.2.1          libjulia-internal.so          libopenlibm.so            libunwind.so
libcholmod.so                libjulia-internal.so.1.10     libopenlibm.so.4          libunwind.so.8
libcholmod.so.4              libjulia-internal.so.1.10.10  libopenlibm.so.4.0        libunwind.so.8.0.1
libcholmod.so.4.2.1          libklu.so                     libpcre2-8.so             libuv.so
libcolamd.so                 libklu.so.2                   libpcre2-8.so.0           libuv.so.2
libcolamd.so.3               libklu.so.2.2.1               libpcre2-8.so.0.11.2      libuv.so.2.0.0
libcolamd.so.3.2.1           libldl.so                     libquadmath.so            libz.so
libcurl.so                   libldl.so.3                   libquadmath.so.0          libz.so.1
libcurl.so.4                 libldl.so.3.2.1               libquadmath.so.0.0.0      libz.so.1.2.13
libcurl.so.4.8.0             libLLVM-15jl.so               librbio.so                sys.so
libdSFMT.so                  libllvmcalltest.so            librbio.so.4

The library that most often causes problems is libstdc++.so.

1 Like

It seems you are right, @ufechner7 . Thank you very much! :handshake:

But, after I typed ENV["LD_LIBRARY_PATH"]="", I add CUDA and using CUDA again, and the same error also occurred.

And, do I have to execute ENV["LD_LIBRARY_PATH"]="" every time I restart Julia?

I would add

export LD_LIBRARY_PATH=""

to .bashrc if you have this file in your home folder. This might break other tools you use, though. Or you add

alias jl='export LD_LIBRARY_PATH=""; julia'

to .bashrc and launch Julia by typing jl.

I think that setting this variable within Julia is too late and has no effect.

1 Like

Given various issues, I have decided to abandon using a portable version of Julia while an installation version of Juliaup is in existence. I found that if there are two Julia versions with the same version number, even if one is installed via Juliaup and the other is a binary file, the latter’s packages cannot be installed and used properly.

I would not use a portable version with CUDA, because CUDA is specific to a graphics card, which is usually different for each computer.

Can you mark one of the answers as a resolution of the initial question?

1 Like

Sure. Thank you @ufechner7 ! :handshake:

1 Like