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

cudaPackages: keep $ORIGIN in Runpaths? #225240

Closed
SomeoneSerge opened this issue Apr 7, 2023 · 2 comments
Closed

cudaPackages: keep $ORIGIN in Runpaths? #225240

SomeoneSerge opened this issue Apr 7, 2023 · 2 comments

Comments

@SomeoneSerge
Copy link
Contributor

Describe the bug

We've just observed libnvrtc.so unsuccessfully dlopen()-ing libnvrtc-builtins.so: #224848 (comment). The former had an empty Runpath (except for /run/opengl-driver/lib). Presumably, before autoPatchelf hook it must have been $ORIGIN, since the two libraries live in the same directory. I think we should respect and even prefer $ORIGIN

I suggest we modify the autopatchelf script so as to accommodate:

  1. forcefully appending $ORIGIN to the runpaths,
  2. and optionally replacing absolute paths with $ORIGIN, when they coincide with the modified library's installation path

Notify maintainers

@NixOS/cuda-maintainers

@SomeoneSerge
Copy link
Contributor Author

Assuming we start appending $ORIGIN, what happens when symlink we cuda libraries into another location? E.g. symlinkJoin, buildFHSUserEnv (/lib), and /run/opengl-driver/lib

@SomeoneSerge SomeoneSerge changed the title cudaPackages: keep $ORIGIN in Runpaths cudaPackages: keep $ORIGIN in Runpaths? May 8, 2023
@SomeoneSerge
Copy link
Contributor Author

Introduced in #226038 to save the trouble, but this is arguably is a dirty hack. I think we should keep adding patchelf --add-needed to make dependencies explicit, because this would be more consistent with the rest of nixpkgs. That said, it would be somewhat nice, if these libraries used DT_NEEDED instead of dlopen in the first place: NVIDIA/build-system-archive-import-examples#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant