-
-
Notifications
You must be signed in to change notification settings - Fork 14.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
BLAS/LAPACK switching mechanism does not work #93977
Comments
I don't quite understand your issue. The new blas package corresponds to the requested blasProvider, where the libraries are named e.g. Note I did notice that numpy depends on the openblas derivation (through lapack) as well as the blas wrapper derivation, which is bad for the closure size. |
Acutally I just did a deep-dive into pkgs/build-support/alternatives/blas/default.nix and pkgs/build-support/alternatives/lapack/default.nix, and recognized that the derivation is picking up the lib from the provider so it might be good then. When the package was built first, I got rather confused, becase in the configuration phase, libmkl_rt, libblas and liblapack are "found" (I must admit that first I did not even realize that the libmkl_rt was not from the MKL pacakge, just found it later):
And when I saw libblas.so linked instead of libmkl_rt.so, I was expecting that it is something different - even if I saw libmkl_rt is symlinked as libblas, etc, the size was different (I assume it is because of patchElf, which, to my understanding, is actually not allowed for MKL - or do I misunderstand something here?). Probably I also got confused by the name blas-3 since the netlib implementation has this as libname - so I was assuming that it is the netlib implementation (actually that is called blas-reference but this is again a bit confusing). Unfortunately there are quite a few packages that we use which depend on blas/lapack and switching onto MKL caused seg faults and very weird observed behavioras well as the build logs of e.g. armadillo give me the false impression that it is not MKL that was linked. So it looks like that there is no real issue with this, I wonder if it would be possible to make it more clear which implementation when a certain package has been built. |
I agree it's confusing. In other scenarios it has been suggested to put a text file in e.g. |
Describe the bug
There is a feature introduced in #83888 to select BLAS/LAPACK implementation globally. According to the documentation (https://github.com/NixOS/nixpkgs/blob/master/doc/using/overlays.xml#L188), the implementation can be selected by using the following overlay:
When selected MKL as implementation, the default implementation is considered as MKL and linked for armadillo (did not check other BLAS/LAPACK user packages):
Looks like blas package is guilty for this:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The default BLAS/LAPACKimplementation should not hijack the desired libraries (or, in the implementation was selected in an incorrect way, the documentation could be updated)
Notify maintainers
@matthewbauer
Metadata
"x86_64-linux"
Linux 4.4.110-1.el7.elrepo.x86_64, CentOS Linux, 7 (Core)
no
no
nix-env (Nix) 2.3.2
"nixpkgs"
/home/afarkas/work/nixpkgs
The text was updated successfully, but these errors were encountered: