Closed jeremiedb closed 3 years ago
Thanks for the feedback!
I just do a quick search and find that CUDA.jl
is a dependency for both EvoTrees.jl
and Flux.jl
, which depends on LLVM.jl
.
And the error seems to be from https://github.com/maleadt/LLVM.jl/blob/b0780fa710219b1ca2e0a418d5dc82fa6dfafe71/src/LLVM.jl#L72-L76
So I think the cause of the problem is that during the initialization of LLVM.jl
, it finds multiple LLVM library, so the initialization process is interrupted. The second and the third try will try to continue the initiation process, but since LLVM.jl
is not initialized properly, some weird things will happen.
So I guess the problem is that RStudio (or something else) somehow loads another LLVM library, which is the cause of the confliction. Since the error seems to be related to LLVM.jl
and CUDA.jl
, functionality without CUDA may still work.
To investigate the problem deeper,
julia_library("Libdl")
julia_command("Libdl.dllist()")
as suggested by the first error message?
https://github.com/maleadt/LLVM.jl
and link the issue to this one.Thanks for quick feedback! I think you nailed it with about the multiple LLVM lbraries.
From the R console, only one LLVM library found:
dllist <- julia_eval("Libdl.dllist()")
grep("LLVM", dllist, value=T)
[1] "/home/jeremie/julia-1.5.0/bin/../lib/julia/libLLVM-9jl.so"
While the same call through Rstudio returns 2:
[1] "/usr/lib/x86_64-linux-gnu/libLLVM-10.so.1" "/home/jeremie/julia-1.5.0/bin/../lib/julia/libLLVM-9jl.so"
These 2 libraries are returned on a Ubuntu machine. On Windows (also with a CUDA.jl install), the error doesn't occur and only 1 LLVM library is found from RStudio.
Do you think that having this 2nd LLVM library being linked by RStudio in Ubuntu (but not in windows) could be an issue on the RStudio side? Otherwise, I'd assume that it should be to the LLVM.jl library to handle the case where 2 LLVMs are found.
Solved in maleadt/LLVM.jl#209
Calling a Julia library fails on first 2 attempts in RStudio, with different error message at each attempt, before successfully working at 3rd attempt. Using R 4.03 and latest RStudio: Version 1.3.1093. The error doesn't occur with all Julia libraries. For example, DataFrames works fine, but Flux gets an error on first call and needs a second call to
julia_library
before loading successfully.It however go fine if making the same directly in R console: