-
-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
llvmPackages_rocm.llvm: don't build shared libs #163698
llvmPackages_rocm.llvm: don't build shared libs #163698
Conversation
This seems to fix the notorious "CommandLine Error: Option 'xxxxx' registered more than once!" error in applications that use both Mesa and ROCm. Since Mesa is built with llvmPackages_latest and ROCm stuff is built with llvmPackages_rocm, applications that use both (such as Blender) end up with two different `libLLVM*.so`s loaded, which breaks things. This seems like a straightforward way to fix the problem, and since the ROCm stack seems to be the only thing in Nixpkgs that uses llvmPackages_rocm this hopefully shouldn't break anything. While there might be another way to fix this problem that doesn't require disabling the shared libraries, I haven't been able to find it yet, and since this issue seems to affect a lot of people I think it might make sense to merge this fix for now and revisit it later if a better solution is found. This also removes a small patch to rocm-comgr since there are no longer LLVM shared libraries for it to link against.
I can confirm that this works for me and solves a very long-standing problem. |
Nice! This looks like a good change. |
That's really interesting! I wouldn't really feel comfortable making that decision though, since a) it's used by a ton of people and b) I've personally never encountered any issues like that before. Do any other distros link it statically? |
Linking LLVM statically seems like it would always be the right thing to do for libraries that expect to be loaded dynamically. LLVM seems very unwilling to share address space with other instances of itself. But I think that would be a separate change from this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ROCm still compiles and the OpenCL samples I tried still work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested that ROCm works after this and that processes can have both OpenGL and ROCm running simultaneously. This fixes a long-standing bug.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Wonderful, thank you! |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/blender-error-when-i-install-the-radeon-pro-render-plugin/16678/9 |
Description of changes
This seems to fix the notorious "CommandLine Error: Option 'xxxxx' registered more than once!" error in applications that use both Mesa and ROCm.
Since Mesa is built with
llvmPackages_latest
and ROCm stuff is built withllvmPackages_rocm
, applications that use both (such as Blender) end up with two differentlibLLVM*.so
s loaded, which breaks things.This seems like a straightforward way to fix the problem, and since the ROCm stack seems to be the only thing in Nixpkgs that uses
llvmPackages_rocm
this hopefully shouldn't break anything.While there might be another way to fix this problem that doesn't require disabling the shared libraries, I haven't been able to find it yet, and since this issue seems to affect a lot of people I think it might make sense to merge this fix for now and revisit it later if a better solution is found.
This also removes a small patch to rocm-comgr since there are no longer LLVM shared libraries for it to link against.
Closes #97401, closes #157457.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes