-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Existence of system-wide version of a shared library causes undefined symbol
error
#1640
Comments
To be clear, |
Thanks for reporting! Are you using the RStudio IDE? Does this happen only in the RStudio IDE, or outside the IDE too? |
Ah, I should have added that I'm using R Studio Server. And I should have tested running the repro code directly in R. I don't have access to a machine at the moment where I can test running the code in normal R Studio Desktop, so I can't check whether it's a R Studio Server specific issue. But running library(reticulate)
venv_name <- "deleteme_5267"
virtualenv_create(venv_name)
use_virtualenv(venv_name)
py_install("torch", pip = true)
pytorch <- import("torch")
|
Wait, scratch that, I forgot I uninstalled So it has nothing to do with R Studio (Server) in particular. |
I don't think reticulate is modifying the order of loaded libs. If this occurs with
Can you please double-check the value of |
Both
What I do find weird is that there is no mention of the virtualenv, even in |
Okay, it appears Python does not simply use the However, Python does use an environment variable
I will investigate whether I can fix the issue by messing with Update: I have experimented with both |
By the way,
In case that's of any help. |
I am unable to reproduce locally. Note that PyTorch can be installed a few different ways, depending on your environment. You may want to consult https://pytorch.org/get-started/locally/ and see if there is something that will work better for you than a bare |
This comment was marked as outdated.
This comment was marked as outdated.
This issue sounds very similar to the Quarto issue I just reported, though given discussion there, I probably reported it in the wrong place. @cderv suggested I report the issue here to That said, in the Quarto issue @cscheid commented that it seemed like it's a |
Sorry for the late reply. As I get the same bug when running my repro script in the plain R REPL, I don't see how this could be an issue with And indeed your issue seems to be due to the same underlying bug. |
Also, as I use pip for my setup and not conda, the suggestion in your issue that the problem is your use of conda seems to me to also be incorrect. |
As I discussed in an update to the issue I filed with quarto, in my case, the system copy of the library was being opened first (based on looking at the output of A work-around is to use
And yes, the issue is not specific to |
To reproduce (assuming you have
libnvjitlink12
installed system-wide, and in a different version):The final line gives me this error:
Checking
nm -gDC ~/.virtualenvs/deleteme_5267/lib/python3.12/site-packages/nvidia/nvjitlink/lib/libnvJitLink.so.12 | grep nvJitLinkAddData
is get:So the version of
libnvJitLink.so.12
in the virtualenv has the symbol. And if I activate the virtualenv normally in a shell and importtorch
from inside a normal Python REPL I don't get any errors. So it's not the fault oflibcusparse.so.12
.The thing is though, the library
libnvJitLink.so.12
is also installed system-wide, but in a different version. Checking there withnm -gDC /usr/lib/x86_64-linux-gnu/libnvJitLink.so.12 | grep nvJitLinkAddData
, I get only:And when I remove the system-wide version of the library with
the error no longer occurs.
It appears to be that if there is a system-wide version of a shared library, it is preferred over the local version in the virtualenv. This is not how it things should be!
R version is
4.4.1 (2024-06-14)
and reticulate version isreticulate_1.38.0
.The text was updated successfully, but these errors were encountered: