Skip to content
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

KvikIO: Need to canonicalize dlopen'd library names #200

Closed
jakirkham opened this issue Apr 19, 2023 · 5 comments · Fixed by #203
Closed

KvikIO: Need to canonicalize dlopen'd library names #200

jakirkham opened this issue Apr 19, 2023 · 5 comments · Fixed by #203
Assignees

Comments

@jakirkham
Copy link
Member

Documenting an offline discussion with @jakirkham in preparation of CUDA 12 bring-up on conda-forge.

Currently, there're some places where libXXXXX.so without any SONAME being dlopen'd, for example,

void* lib = load_library({"libcufile.so.1", "libcufile.so.0", "libcufile.so"});

There will become problematic because the libXXXXX.so symlink is supposed to exist only in the libXXXXX-dev package by the stand practice of Linux distros, not in libXXXXX which only contains libXXXXX.so.{major}. The dlopen'd names need to be canonicalized.

Note: Text borrowed from Leo's issue ( rapidsai/cudf#12708 ) and tweaked

@jakirkham
Copy link
Member Author

Some comments:

  • It appears we load libcufile.so.1. Where have we seen that in use?
  • AFAICT libcufile.so.0 is the typical name. So this looks good.
  • It looks like we fallback to libcufile.so. Does that show up in places where libcufile.so.0 isn't present?

@madsbk
Copy link
Member

madsbk commented Apr 20, 2023

I have seen all of them in the wild :)
On my current workstation, I have libcufile.so, libcufile.so.0, libcufile.so.1.4.0, all pointing to the same library

@jakirkham
Copy link
Member Author

Have seen those 3:

  • Unversioned symlink ( libcufile.so ) - used in third-party development (not typically in runtime)
  • SOVERSION library ( libcufile.so.0 ) - used by third-party tools/libraries at runtime
  • Release versioned library ( libcufile.so.1.4.0 ) - (guessing?) for management of cuFile installed on system

Though haven't seen the SOVERSION bumped ( libcufile.so.1 ). Is that something that is showing up? If so, are there any more details about when it shows up?

@madsbk
Copy link
Member

madsbk commented Apr 21, 2023

Sorry, I can't remember when I saw libcufile.so.1 :/

@wence-
Copy link
Contributor

wence- commented Apr 25, 2023

We need to dlopen libcufile.so.0 and no other. libcufile.so is installed in "dev" mode always pointing at the most recent "ABI-versioned" .so. That in turn symlinks to the actual versioned library. If both libcufile.so.1 and libcufile.so.0 were to exist (I do not believe that they do) they are (by definition) ABI-incompatible. This would mean that it is not safe to use a library built against an old version of libcufile with a new version (because, say, struct layouts will have changed).

@wence- wence- self-assigned this Apr 25, 2023
@rapids-bot rapids-bot bot closed this as completed in #203 Apr 26, 2023
rapids-bot bot pushed a commit that referenced this issue Apr 26, 2023
Rather than searching for a list of possible library names for libcufile, only look for the single ABI-compatible version of libcufile that we support. This avoids both ABI incompatibilities and loading stub libraries. It morally does what #127 attempted, but with the correct versioning suffix.

Closes #200.

Authors:
  - Lawrence Mitchell (https://github.com/wence-)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Mads R. B. Kristensen (https://github.com/madsbk)

URL: #203
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants