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

Intel MKL FATAL ERROR: Cannot load libmkl_intel_thread.2.dylib. on x86_64 macOS #281

Closed
AshtonSBradley opened this issue Dec 7, 2023 · 11 comments · Fixed by JuliaRegistries/General#96745

Comments

@AshtonSBradley
Copy link

#280 was not fixed by installing the 2023 mkl:

pkg> add MKL_jll@2023
   Resolving package versions...
    Updating `~/.julia/environments/v1.10/Project.toml`
⌅ [856f044c] + MKL_jll v2023.2.0+0
  No Changes to `~/.julia/environments/v1.10/Manifest.toml`

julia> using FFTW

julia> FFTW.get_provider()
"fftw"

julia> FFTW.set_provider!("mkl")
┌ Info: FFTW provider changed; restart Julia for this change to take effect
└   provider = "mkl"

julia> exit()

julia> using FFTW

julia> FFTW.get_provider()
"mkl"

julia> fft(randn(10))

Intel MKL FATAL ERROR: Cannot load libmkl_intel_thread.2.dylib.
@AshtonSBradley
Copy link
Author

so I think my question is still open: how do I choose the MKL used by FFTW?

@giordano
Copy link
Member

giordano commented Dec 7, 2023

What's the output of

]st -m MKL_jll

in that environment?

@AshtonSBradley
Copy link
Author

(@v1.10) pkg> st -m MKL_jll
Status `~/.julia/environments/v1.10/Manifest.toml`
⌅ [856f044c] MKL_jll v2023.2.0+0
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`

@AshtonSBradley
Copy link
Author

how do I query which MKL is being used by fftw?

@giordano
Copy link
Member

giordano commented Dec 7, 2023

using MKL_jll
pkgversion(MKL_jll)

@giordano
Copy link
Member

giordano commented Dec 7, 2023

Also

using MKL_jll
MKL_jll.is_available()

@AshtonSBradley
Copy link
Author

ok, I don't know internals, but I got the impression that fftw installs is own MKL and presumably this is distinct from user installed, because deps run their own versioning. When I install FFTW on its own I don't see an MKL_jll appear in the project. If I install my own MKL_jll I would assume that this is distinct from the one FFTW uses for its own deps, no?

@giordano
Copy link
Member

giordano commented Dec 7, 2023

but I got the impression that fftw installs is own MKL

No:

FFTW.jl/Project.toml

Lines 5 to 9 in ef8fc5b

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
FFTW_jll = "f5851436-0d7a-5f13-b9de-f02708fd171a"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MKL_jll = "856f044c-d86e-5d09-b602-aeab76dc8ba7"

I install FFTW on its own I don't see an MKL_jll appear in the project.

That seems unlikely since MKL_jll is a direct dependency of this package. How are you checking the project? For example, ]st only shows the the packages you installed directly, but if you want to see also the other packages pulled by your packages you have to use ]st -m, as suggested above.

If I install my own MKL_jll I would assume that this is distinct from the one FFTW uses for its own deps, no?

No. Why would it be the case? In each environment there can be one and only one version of each package.

@giordano giordano changed the title MKL seg fault MKL not found on x86_64 macOS Dec 7, 2023
@giordano
Copy link
Member

giordano commented Dec 7, 2023

]add IntelOpenMP_jll@2023

Should fix your problem.

@AshtonSBradley
Copy link
Author

]add IntelOpenMP_jll@2023

Should fix your problem.

Fixed. Thanks for your help and explanation!

@giordano giordano changed the title MKL not found on x86_64 macOS Intel MKL FATAL ERROR: Cannot load libmkl_intel_thread.2.dylib. on x86_64 macOS Dec 8, 2023
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.

2 participants