JuliaMath / FFTW.jl

Julia bindings to the FFTW library for fast Fourier transforms
https://juliamath.github.io/FFTW.jl/stable
MIT License
273 stars 55 forks source link

Intel MKL FATAL ERROR #280

Closed AshtonSBradley closed 10 months ago

AshtonSBradley commented 10 months ago

On 1.10 release cases on Intel mac:

abradley@higgs Projects % julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.0-rc2 (2023-12-03)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using FFTW

julia> FFTW.get_num_threads()
1

julia> FFTW.set_num_threads(8)

Intel MKL FATAL ERROR: Cannot load libmkl_intel_thread.2.dylib.
abradley@higgs Projects % julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.0-rc2 (2023-12-03)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> versioninfo()
Julia Version 1.10.0-rc2
Commit dbb9c46795b (2023-12-03 15:25 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (x86_64-apple-darwin22.4.0)
  CPU: 16 × Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
  Threads: 11 on 16 virtual cores
Environment:
  JULIA_NUM_THREADS = 8
  JULIA_PKG_DEVDIR = /Users/abradley/Dropbox/Julia/Dev

julia> using FFTW

julia> FFTW.get_provider()
"mkl"

works if I switch back to "fftw" provider.

giordano commented 10 months ago

There's no build of MKL 2024 for x86_64 macos: https://www.intel.com/content/www/us/en/developer/articles/release-notes/onemkl-release-notes.html. Either downgrade your MKL_jll to v2023 or don't use it.

AshtonSBradley commented 10 months ago

There's no build of MKL 2024 for x86_64 macos: https://www.intel.com/content/www/us/en/developer/articles/release-notes/onemkl-release-notes.html. Either downgrade your MKL_jll to v2023 or don't use it.

Thanks @giordano Just to say that as a user I don't have direct control over the MKL fftw uses.

All I am told in the docs is to do FFTW.set_provider!("mkl")

As I understand it, this is not the same as using MKL

but it would be good to have some clarity on this. Can I somehow choose which MKL to use?

giordano commented 10 months ago

Just to say that as a user I don't have direct control over the MKL fftw uses.

Yes, you do:

]add MKL_jll@2023
AshtonSBradley commented 10 months ago

Thank you for this